Skip to content

Commit

Permalink
updating Unity plugins to 1.8.2
Browse files Browse the repository at this point in the history
  • Loading branch information
Wenzhi committed Sep 19, 2016
1 parent fac7941 commit 51c417f
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
12 changes: 9 additions & 3 deletions Assets/Plugins/iOS/AppboyAppDelegate.mm
Original file line number Diff line number Diff line change
Expand Up @@ -33,14 +33,18 @@ - (BOOL)application:(UIApplication*)application didFinishLaunchingWithOptions:(N
}

- (void)application:(UIApplication *)application didRegisterForRemoteNotificationsWithDeviceToken:(NSData *)deviceToken {
[super application:application didRegisterForRemoteNotificationsWithDeviceToken:deviceToken];
if ([UnityAppController instancesRespondToSelector:@selector(application:didRegisterForRemoteNotificationsWithDeviceToken:)]) {
[super application:application didRegisterForRemoteNotificationsWithDeviceToken:deviceToken];
}
NSLog(@"AppboyAppDelegate called from application:didRegisterForRemoteNotificationsWithDeviceToken with token %@", deviceToken);
// Register push token with Appboy
[[AppboyUnityManager sharedInstance] registerPushToken:deviceToken];
}

- (void)application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)userInfo {
[super application:application didReceiveRemoteNotification:userInfo];
if ([UnityAppController instancesRespondToSelector:@selector(application:didReceiveRemoteNotification:)]) {
[super application:application didReceiveRemoteNotification:userInfo];
}
NSLog(@"AppboyAppDelegate called from application:didReceiveRemoteNotification:. UIApplicationState is %ld", (long)[[UIApplication sharedApplication] applicationState]);

// Pass notification to Appboy
Expand All @@ -49,7 +53,9 @@ - (void)application:(UIApplication *)application didReceiveRemoteNotification:(N
}

- (void)application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)userInfo fetchCompletionHandler:(void (^)(UIBackgroundFetchResult result))handler {
[super application:application didReceiveRemoteNotification:userInfo fetchCompletionHandler:handler];
if ([UnityAppController instancesRespondToSelector:@selector(application:didReceiveRemoteNotification:fetchCompletionHandler:)]) {
[super application:application didReceiveRemoteNotification:userInfo fetchCompletionHandler:handler];
}
NSLog(@"AppboyAppDelegate called from application:didReceiveRemoteNotification:fetchCompletionHandler:. UIApplicationState is %ld", (long)[[UIApplication sharedApplication] applicationState]);

// Pass notification to Appboy
Expand Down
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
## 1.8.2
* Updates the SDK to be compatible with unity 5.4+. In 5.4.0 Unity stopped implementing push delegates in UnityAppController in certain conditions, causing a crash when the Appboy SDK tried to call them.

## 1.8.1
* Updates SDK to modify delegate usage to fix an issue with push-click handling introduced in iOS 10 - see https://github.com/Appboy/appboy-ios-sdk/blob/master/CHANGELOG.md for details.

Expand Down

0 comments on commit 51c417f

Please sign in to comment.