From 1b51d59f2fd238231fdbdcfb76216152b9612302 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=B4me=2EVouillon?= Date: Mon, 2 Sep 2019 13:46:33 +0200 Subject: [PATCH] Compatibility with cordova-plugin-googleplus on iOS --- src/ios/AppDelegate+BranchSdk.m | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/src/ios/AppDelegate+BranchSdk.m b/src/ios/AppDelegate+BranchSdk.m index d09670ca..1b1ba221 100644 --- a/src/ios/AppDelegate+BranchSdk.m +++ b/src/ios/AppDelegate+BranchSdk.m @@ -24,7 +24,19 @@ - (BOOL)application:(UIApplication *)app openURL:(NSURL *)url options:(NSDiction // pass the url to the handle deep link call if (![[Branch getInstance] application:app openURL:url options:options]) { // do other deep link routing for the Facebook SDK, Pinterest SDK, etc - [[NSNotificationCenter defaultCenter] postNotification:[NSNotification notificationWithName:CDVPluginHandleOpenURLNotification object:url]]; + NSMutableDictionary * openURLData = [[NSMutableDictionary alloc] init]; + [openURLData setValue:url forKey:@"url"]; + NSMutableString * sourceApplication = + [options objectForKey:UIApplicationOpenURLOptionsSourceApplicationKey]; + if (sourceApplication) { + [openURLData setValue:sourceApplication forKey:@"sourceApplication"]; + } + NSMutableString * annotation = + [options objectForKey:UIApplicationOpenURLOptionsAnnotationKey]; + if (annotation) { + [openURLData setValue:annotation forKey:@"annotation"]; + } + [[NSNotificationCenter defaultCenter] postNotification:[NSNotification notificationWithName:CDVPluginHandleOpenURLWithAppSourceAndAnnotationNotification object:openURLData]]; // send unhandled URL to notification [[NSNotificationCenter defaultCenter] postNotification:[NSNotification notificationWithName:@"BSDKPostUnhandledURL" object:[url absoluteString]]]; }