すでに自己解決されているかもしれませんが、プッシュ通知については
PushNotification.hasPermission(successHandler)
1.5.0になって追加されたようですね。
phonegap/phonegap-plugin-push
src/ios/AppDelegate+notification.m
より
objectivec
1- (BOOL)userHasRemoteNotificationsEnabled {
2 UIApplication *application = [UIApplication sharedApplication];
3 if ([[UIApplication sharedApplication] respondsToSelector:@selector(registerUserNotificationSettings:)]) {
4 return application.currentUserNotificationSettings.types != UIUserNotificationTypeNone;
5 } else {
6#pragma GCC diagnostic push
7#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
8 return application.enabledRemoteNotificationTypes != UIRemoteNotificationTypeNone;
9#pragma GCC diagnostic pop
10 }
11}
12
src/ios/PushPlugin.m
より
objectivec
1- (void)hasPermission:(CDVInvokedUrlCommand *)command
2{
3 BOOL enabled = NO;
4 id<UIApplicationDelegate> appDelegate = [UIApplication sharedApplication].delegate;
5 if ([appDelegate respondsToSelector:@selector(userHasRemoteNotificationsEnabled)]) {
6 enabled = [appDelegate performSelector:@selector(userHasRemoteNotificationsEnabled)];
7 }
8
9 CDVPluginResult *commandResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageAsBool:enabled];
10 [self.commandDelegate sendPluginResult:commandResult callbackId:command.callbackId];
11}
12
PhoneGap/Cordovaは専門外なので、これにて。
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2016/01/28 10:17