From c575200f4cf6be8c2ff79c8d3409751de5b95a20 Mon Sep 17 00:00:00 2001 From: Ethan Neff Date: Tue, 11 Jul 2017 09:54:30 -0700 Subject: [PATCH] fix: removed testbed/config.xml from GitHub since cordova 7.0.0 overrides defaults --- .gitignore | 1 + src/ios/AppDelegate+BranchSdk.m | 12 +++++++++++- testbed/{config.xml => config.template.xml} | 0 3 files changed, 12 insertions(+), 1 deletion(-) rename testbed/{config.xml => config.template.xml} (100%) diff --git a/.gitignore b/.gitignore index daafabfd..6488eb4b 100644 --- a/.gitignore +++ b/.gitignore @@ -3,6 +3,7 @@ testbed/platforms testbed/plugins testbed/hooks testbed/build.json +testbed/config.xml testbed/package.json node_modules .installed diff --git a/src/ios/AppDelegate+BranchSdk.m b/src/ios/AppDelegate+BranchSdk.m index 64e19e39..451dc396 100644 --- a/src/ios/AppDelegate+BranchSdk.m +++ b/src/ios/AppDelegate+BranchSdk.m @@ -16,7 +16,7 @@ #import #endif -@interface AppDelegate (BranchSDK) +@interface AppDelegate (BranchSdk) - (BOOL)application:(UIApplication *)application continueUserActivity:(NSUserActivity *)userActivity restorationHandler:(void (^)(NSArray * _Nullable))restorationHandler; @@ -48,4 +48,14 @@ - (BOOL)application:(UIApplication *)application continueUserActivity:(NSUserAct return YES; } +// Respond to Push Notifications +- (void)application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)userInfo { + @try { + [[Branch getInstance] handlePushNotification:userInfo]; + } + @catch (NSException *exception) { + [[NSNotificationCenter defaultCenter] postNotification:[NSNotification notificationWithName:@"BSDKPostUnhandledURL" object:userInfo]]; + } +} + @end diff --git a/testbed/config.xml b/testbed/config.template.xml similarity index 100% rename from testbed/config.xml rename to testbed/config.template.xml