Add -ObjC into TARGETS → Build Setting → Linking → Other Linker Flags .
// Setting parameters
NSString *devKey = @"your devKey";
NSString *publicKey = @"your publicKey";
NSString *trackUrl = @"your trackUrl";
NSString *channelId = @"your channelId";
NSString *appid = @"your appid";
// init SDK
[XhanceSDK initWithDevKey:devKey publicKey:publicKey trackUrl:trackUrl channelId:channelId appId:appid];About the parameters of devKey、publicKey、trackUrl、channelId、appid, please apply for them from the website.
The time to initialize SDK should be set in a relative earlier position. Such as in AppDelegate’s (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
After initialization, relevant information about DeepLink can be fetched asynchronously through this method.
[XhanceSDK getDeeplink:^(XhanceDeeplinkModel *deeplinkModel) {
NSLog(@"%@",deeplinkModel);
}];XhanceDeeplinkModel includes the following parameters:
targetUrllinkArgs
After initialization, you should use this method to upload IAP information after IAP.
NSString *receiptDataString = @"your receipt data string";
NSNumber *productPrice = [NSNumber numberWithDouble:your price];
NSString *productCurrencyCode = @"your product currency code";
NSString *pubkey = @"your itunes connect pubkey";
[XhanceSDK appStoreWithProductPrice:productPrice productCurrencyCode:productCurrencyCode receiptDataString:receiptDataString pubkey:pubkey params:nil];
Parameters are as follows:
receiptDataStringsuch asyour receipt data stringproductPricesuch as6.00productCurrencyCodesuch asCNYpubkeysuch as48a07332496a4bcb9eea4d32e1234582
After initializating, you should use this method to upload IAP information after Third Pay process.
NSNumber *productPrice = [NSNumber numberWithDouble:your price];
NSString *productCurrencyCode = @"your product currency code";
NSString *productIdentifier = @"your product id";
NSString *productCategory = @"your product category";
[XhanceSDK thirdPayWithProductPrice:productPrice productCurrencyCode:productCurrencyCode productIdentifier:productIdentifier productCategory:productCategory];Parameters are as follows:
productPricesuch as6.00productCurrencyCodesuch asCNY