Closed RealBug closed 10 years ago
Example :
1) load this in a webview myURL = [NSURL URLWithString:@"http://clk.tradedoubler.com/click?p=23753&a=1611348&g=0&td_partnerId=2003&url=https://itunes.apple.com/fr/app/twitter/id333903271"]; [myWebView loadRequest:[NSURLRequest requestWithURL:myURL]];
3) Apple load this : URL: https://itunes.apple.com/fr/app/twitter/id333903271?partnerId=2003&tduid=87c0fe43ef95770e08a1329d2f5d469f&affId=1611348
4) Apple launch the app store and quit the webview URL: itms-appss://itunes.apple.com/fr/app/twitter/id333903271?partnerId=2003&tduid=87c0fe43ef95770e08a1329d2f5d469f&affId=1611348
I think if we cut the process of the step 4, it will be ok maybe because Apple write the affiliation line in his BDD at the step 3.
Hi RB,
I did the same test as you did, also I use did this the affiliate redirection class to get the URL on the step 3:
So here it is a piece of code can be add to get a proper App Store URL.
AffiliateRedirection *aff = [[AffiliateRedirection alloc] initWithURL:MyURL];
[aff openAffiliateRedirectionWithBlock:^(NSURL *itunesURL, NSError *error) {
NSString *schema = [itunesURL.scheme stringByAppendingString:@"://"];
NSRange range = [itunesURL.absoluteString rangeOfString:schema];
if (range.location == NSNotFound) {
//Error
NSLog(@"string was not found");
} else {
NSString *noSchemaString = [itunesURL.absoluteString stringByReplacingCharactersInRange:range withString:@""];
NSString *absoluteAppStoreURL = [NSString stringWithFormat:@"%@%@", @"itms-appss://", noSchemaString];
NSURL *appStoreURL = [NSURL URLWithString:absoluteAppStoreURL];
NSLog(@"%@", appStoreURL);
if ( [[UIApplication sharedApplication] canOpenURL:appStoreURL] ) {
[[UIApplication sharedApplication] openURL:appStoreURL];
}
}
}];
After doing this I am going to create a new method called openAffiliateRedirectionOnAppStoreWithBlock
.
Open the SKStoreProductViewController
is still interesting but there is not way to get revenue from affiliate links, so I hope apple create a new parameters to pass to the SKStoreProductViewController
.
Any idea and comment are welcome :)
Hi,
the idea is nice but sadly the redirection doesnt work in background. Maybe, can we open a transparent webview with the redirection ?
BR