cordova如何删除iOS上的“推送通知”
我使用Apache Cordova将应用程序提交给Apple Store,并从苹果公司获得了“Missing Notification Entitlement”的警告。
但似乎我从来没有在我的应用程序中使用“推送通知”。 我怎样才能从我的应用程序中删除它? 在Apache Cordova中是默认的吗?
如何做到这一点CORDOVA APPS'正确':
我也有这个问题。 由@michaelb提出的解决scheme工作,但我很沮丧,看到整个事情被包裹在条件编译(即#ifndef DISABLE_PUSH_NOTIFICATIONS
),我决定学习如何添加一个“预处理器macros”,它基本上告诉XCode编译你的应用程序这一点代码遗漏了。
您可以通过UI以graphics方式定义DISABLE_PUSH_NOTIFICATIONS
预编译符号(请注意,这是在XCode 6.1中完成的方式):
希望这可以帮助其他人在相同的情况下。
在AppDelegate.m中,删除didRegisterForRemoteNotificationsWithDeviceToken和didFailToRegisterForRemoteNotificationsWithError。 在PhoneGap 3.5上工作
继上面和其他地方的build议,这是我在cordova5.0.0做的
结果警告消失了,我没有注意到应用程序的任何问题。
- 打开平台/ ios / InfoganGardenAdmin / Classes / AppDelegate.m
- 将第116行注释到第137行
例:
/* - Removed to disable push notification and Apple warning message #ifndef DISABLE_PUSH_NOTIFICATIONS - (void) application:(UIApplication*)application didRegisterForRemoteNotificationsWithDeviceToken:(NSData*)deviceToken { // re-post ( broadcast ) NSString* token = [[[[deviceToken description] stringByReplacingOccurrencesOfString:@"<" withString:@""] stringByReplacingOccurrencesOfString:@">" withString:@""] stringByReplacingOccurrencesOfString:@" " withString:@""]; [[NSNotificationCenter defaultCenter] postNotificationName:CDVRemoteNotification object:token]; } - (void) application:(UIApplication*)application didFailToRegisterForRemoteNotificationsWithError:(NSError*)error { // re-post ( broadcast ) [[NSNotificationCenter defaultCenter] postNotificationName:CDVRemoteNotificationError object:error]; } #endif */
PhoneGap 3.5具有相同的问题(PhoneGapbuild立在Cordova上),您可以在这里查看讨论主题
目前的解决scheme似乎是“使用旧版本”
这封电子邮件非常模糊,可以采取多种方式,如果你是一个新的开发者,你可能不知道苹果商店应用程序评论的等待时间。 请参阅AppReviewTimes 。
澄清:它只是一个警告,你可以忽略它,如果你不使用推送通知。
不要试图解决什么是坏的。 再加上我所能find的所有解决scheme都不起作用。