Skip to content
This repository has been archived by the owner on Sep 4, 2020. It is now read-only.

Remove unnecessary didRegisterUserNotificationSettings implementation, which did break cordova-local-notifications-plugin as a side effect #215

Merged
merged 2 commits into from
Oct 10, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion src/ios/AppDelegate+notification.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
- (void)application:(UIApplication *)application didFailToRegisterForRemoteNotificationsWithError:(NSError *)error;
- (void)application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)userInfo;
- (void)applicationDidBecomeActive:(UIApplication *)application;
- (void)application:(UIApplication *)application didRegisterUserNotificationSettings:(UIUserNotificationSettings *)notificationSettings;
- (void)application:(UIApplication *)application handleActionWithIdentifier:(NSString *)identifier forRemoteNotification:(NSDictionary *)userInfo completionHandler:(void(^)())completionHandler;
- (id) getCommandInstance:(NSString*)className;

Expand Down
6 changes: 0 additions & 6 deletions src/ios/AppDelegate+notification.m
Original file line number Diff line number Diff line change
Expand Up @@ -98,12 +98,6 @@ - (void)applicationDidBecomeActive:(UIApplication *)application {
}
}

- (void)application:(UIApplication *)application didRegisterUserNotificationSettings:(UIUserNotificationSettings *)notificationSettings
{
//register to receive notifications
[application registerForRemoteNotifications];
}

//For interactive notification only
- (void)application:(UIApplication *)application handleActionWithIdentifier:(NSString *)identifier forRemoteNotification:(NSDictionary *)userInfo completionHandler:(void(^)())completionHandler
{
Expand Down
8 changes: 8 additions & 0 deletions src/ios/PushPlugin.m
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,10 @@ - (void)init:(CDVInvokedUrlCommand*)command;
}

- (void)didRegisterForRemoteNotificationsWithDeviceToken:(NSData *)deviceToken {
if (self.callbackId == nil) {
NSLog(@"Unexpected call to didRegisterForRemoteNotificationsWithDeviceToken, ignoring: %@", deviceToken);
return;
}
NSLog(@"Push Plugin register success: %@", deviceToken);

NSMutableDictionary *results = [NSMutableDictionary dictionary];
Expand Down Expand Up @@ -180,6 +184,10 @@ - (void)didRegisterForRemoteNotificationsWithDeviceToken:(NSData *)deviceToken {

- (void)didFailToRegisterForRemoteNotificationsWithError:(NSError *)error
{
if (self.callbackId == nil) {
NSLog(@"Unexpected call to didFailToRegisterForRemoteNotificationsWithError, ignoring: %@", error);
return;
}
NSLog(@"Push Plugin register failed");
[self failWithMessage:@"" withError:error];
}
Expand Down