0
突然我的应用程序无法生成设备令牌。 我创建了一个应用程序来接收远程推送通知,应用程序运行良好,但今天我的应用程序不生成设备令牌,我在xcode上运行代码并且不生成令牌。没有委托方法调用。 我不改变任何东西,不工作更多。函数didRegisterForRemoteNotificationsWithDeviceToken不工作。看:我的应用程序无法生成设备令牌
func application(application: UIApplication, didRegisterForRemoteNotificationsWithDeviceToken deviceToken: NSData) {
print(deviceToken)
}
不打印什么
这个函数什么也不做:
func application(application: UIApplication, didFailToRegisterForRemoteNotificationsWithError error: NSError) {
print(error)
}
func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool
{
// Override point for customization after application launch.
let types:UIUserNotificationType = [UIUserNotificationType.Alert, UIUserNotificationType.Badge, UIUserNotificationType.Sound]
application.registerUserNotificationSettings(UIUserNotificationSettings(forTypes: types, categories: [newsCategory]))
return true
}
为什么这个问题呢?我该如何解决它?