ADJSubscription class

You can use the ADJSubscription class to pass subscription information to the Adjust backend. Once you have formed the object, you can pass it to the trackSubscription method.

Instance methods

Initialize the subscription object

To initialize the ADJSubscription object, you need to call the initWithPrice method. You can pass details of your subscription to this method.

- (nullable id) initWithPrice: (nonnull NSDecimalNumber *) price
                     currency: (nonnull NSString *)        currency
                transactionId: (nonnull NSString *)        transactionId
                   andReceipt: (nonnull NSData *)          receipt
Objective-C
Swift
ADJSubscription *subscription = [[ADJSubscription alloc] initWithPrice:price
                                                              currency:currency
                                                         transactionId:transactionId
                                                            andReceipt:receipt];

Parameters

Set the date of the transaction

You can record the date on which a transaction occurred. To do this, pass the date to the setTransactionDate method.

- (void) setTransactionDate: (nonnull NSDate *) transactionDate
Objective-C
Swift
[subscription setTransactionDate:transactionDate];

Parameters

Set the sales region of the transaction

You can record the region in which a purchase took place. To do this, pass the country code to the setSalesRegion method.

- (void) setSalesRegion: (nonnull NSString *) salesRegion
Objective-C
Swift
[subscription setSalesRegion:salesRegion];

Parameters

Add callback parameters to the subscription object

You can attach custom parameters to your subscription object. The Adjust SDK will send these when it calls on your callback URL. To add these parameters, call the addCallbackParameter method.

- (void) addCallbackParameter: (nonnull NSString *) key 
                        value: (nonnull NSString *) value
Objective-C
Swift
[subscription addCallbackParameter:@"foo" value:@"bar"];

Add partner callback parameters to the subscription object

You can attach partner parameters to your subscription object. The Adjust SDK will send these parameters to the Adjust backend when a user triggers a subscription event. The Adjust backend will then forward these to the network partner. To add these parameters, call the addPartnerParameter method.

- (void) addPartnerParameter: (nonnull NSString *) key 
-                      value: (nonnull NSString *) value
Objective-C
Swift
[subscription addPartnerParameter:@"foo" value:@"bar"];