I am using Facebook's AppLinks deferred deep linking (DDL) option to pass some custom deep link info upon install. Once I get the DDL trigger, I call a certain external URL to log the DDL activity using a simple call to stringWithContentsOfURL. For some unexplained reason, the URL is automatically injected with a 'al_applink_data' param although I did not add it (I only add 'deeplink' and 'idfa' manually). How does it get 'injected' into my URL call? Here is the DDL trigger code:
- (void) onFbDeferredAppLink:(NSURL*)deeplink error:(NSError*)error {
NSLog(@"onFbDeferredAppLink: %@", deeplink);
NSMutableDictionary* d = [NSMutableDictionary dictionaryWithObjectsAndKeys:
deeplink, @"deeplink",
[self getIdfa], @"idfa"
, nil];
dispatch_async(dispatch_get_global_queue( DISPATCH_QUEUE_PRIORITY_DEFAULT, 0),
^{
NSError* error = nil;
__block NSMutableString* s = [NSMutableString stringWithString:@"https://api.myservers.com/test.php?a=b"];
[d enumerateKeysAndObjectsUsingBlock:^(id key, id obj, BOOL *stop) {
[s appendFormat:@"&%@=%@", [key description], [obj description]];
}];
NSURL* url = [NSURL URLWithString:s];
[NSString stringWithContentsOfURL:url encoding:NSUTF8StringEncoding error:&error];
});