registerForRemoteNotificationType
全部标签 在将我们的应用程序升级为适用于iOS8后,我遇到了一个问题,其中registerForRemoteNotificationTypes似乎无法在运行iOS7的手机上运行,因为didRegisterForRemoteNotificationsWithDeviceToken没有被调用并且“允许推送通知”对话框没有出现在应用程序。这是我正在使用的代码//Addregistrationforremotenotificationsif([applicationrespondsToSelector:@selector(registerUserNotificationSettings:)]){NS
我正在尝试实现解析推送通知。我已经为我的其他应用程序进行了所有设置,并且效果很好。但是,我正在尝试在我现在正在开发的应用程序中实现它。问题是,我就是无法让它工作。我在applicationDidFinishLaunching方法中这样做:[applicationregisterForRemoteNotificationTypes:(UIRemoteNotificationType)(UIRemoteNotificationTypeBadge|UIRemoteNotificationTypeSound|UIRemoteNotificationTypeAlert)];我还更新了我的配置文件
在applicationDidBecomeActive中调用registerForRemoteNotificationTypes是不好的做法吗?我在applicationDidFinishLoading中调用它,但在多任务处理中,一些用户在几天到几周内都没有注册。我想更频繁地调用注册,但如果这是不好的做法,我不想经常调用它。 最佳答案 这不是坏习惯。事实上Apple文档是这样说的:AppledocumentationIfyourapplicationhaspreviouslyregistered,callingregisterFor
在applicationDidBecomeActive中调用registerForRemoteNotificationTypes是不好的做法吗?我在applicationDidFinishLoading中调用它,但在多任务处理中,一些用户在几天到几周内都没有注册。我想更频繁地调用注册,但如果这是不好的做法,我不想经常调用它。 最佳答案 这不是坏习惯。事实上Apple文档是这样说的:AppledocumentationIfyourapplicationhaspreviouslyregistered,callingregisterFor
我可以成功注册我的应用以获取推送通知:UIApplication.SharedApplication.RegisterForRemoteNotificationTypes(UIRemoteNotificationType.Alert|UIRemoteNotificationType.Badge|UIRemoteNotificationType.Sound);但每当我执行此操作时,我的UI通常会挂起2-3秒。即使我按照建议在应用程序生命周期的早期使用它(例如,甚至WillFinishLaunching),我的UI仍然会在我的第一个ViewController加载后挂起。我的第一个想法是在
如果设备注册通知的方式发生重大变化,我们不能再使用registerForRemoteNotificationTypes:,如果我们不能使用Xcode6beta,我们如何构建新版本的应用程序以支持iOS8?我们是否必须在Xcode6GM版本发布当天构建并提交,以便我们的用户继续接收推送通知? 最佳答案 iOS8更改了通知注册。所以你需要检查设备版本然后你需要注册通知设置。(请检查this链接。)我在Xcode6上试用了这段代码,它对我有用。-(BOOL)application:(UIApplication*)applicationdi
在iOS8.x下尝试注册推送通知时:application.registerForRemoteNotificationTypes(UIRemoteNotificationType.Alert|UIRemoteNotificationType.Badge|UIRemoteNotificationType.Sound)我收到以下错误:registerForRemoteNotificationTypes:isnotsupportediniOS8.0andlater.任何想法什么是做它的新方法?当我在iOS7.x上运行这个Swift应用程序时,它确实有效。编辑在iOS7.x上,当我包含我得到的
在iOS8.x下尝试注册推送通知时:application.registerForRemoteNotificationTypes(UIRemoteNotificationType.Alert|UIRemoteNotificationType.Badge|UIRemoteNotificationType.Sound)我收到以下错误:registerForRemoteNotificationTypes:isnotsupportediniOS8.0andlater.任何想法什么是做它的新方法?当我在iOS7.x上运行这个Swift应用程序时,它确实有效。编辑在iOS7.x上,当我包含我得到的