将iOS本机推送通知与WorkLight集成时,iOS 9设备没有设备令牌

将iOS本机推送通知与WorkLight集成时,iOS 9设备没有设备令牌,ios,apple-push-notifications,worklight-server,Ios,Apple Push Notifications,Worklight Server,我正在尝试使用中提供的示例代码和步骤,通过Worklight在iOS设备上发送推送通知 当我在iOS 7设备上运行应用程序时,我会得到一个设备令牌,因此当我点击订阅按钮时,我会得到一个成功的响应。即使我们没有在DidFinishLaunching中使用注册或删除选项编写任何代码,这种方法也可以工作 但当我在iOS 8和iOS 9设备上运行相同的代码时,我在控制台上收到以下消息: iOS 8.0及更高版本不支持iOSNativePush[1119:372642]RegisterForRemotio

我正在尝试使用中提供的示例代码和步骤,通过Worklight在iOS设备上发送推送通知

当我在iOS 7设备上运行应用程序时,我会得到一个设备令牌,因此当我点击订阅按钮时,我会得到一个成功的响应。即使我们没有在DidFinishLaunching中使用注册或删除选项编写任何代码,这种方法也可以工作

但当我在iOS 8和iOS 9设备上运行相同的代码时,我在控制台上收到以下消息:

iOS 8.0及更高版本不支持iOSNativePush[1119:372642]RegisterForRemotionTificationTypes:注册表

为了使我的应用程序在iOS>=8设备上运行,我编写了以下代码:

  - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions 
 {
// Override point for customization after application launch.

if([[UIApplication sharedApplication] respondsToSelector:@selector(isRegisteredForRemoteNotifications)])
   {
    [[UIApplication sharedApplication] registerUserNotificationSettings:  [UIUserNotificationSettings settingsForTypes:(UIUserNotificationTypeAlert | UIUserNotificationTypeBadge | UIUserNotificationTypeSound) categories:nil]];

    [[UIApplication sharedApplication] registerForRemoteNotifications];
    }
else
   {
    [[UIApplication sharedApplication] registerForRemoteNotificationTypes:(UIUserNotificationTypeAlert | UIUserNotificationTypeBadge |    UIUserNotificationTypeSound)];
   }
return YES;
   }


- (void)application:(UIApplication *)application didRegisterUserNotificationSettings:(UIUserNotificationSettings *)notificationSettings
{
  [application registerForRemoteNotifications];
}
尽管如此,我仍在获取iOS NativePush[1119:372642]RegisterForRemotionTificationTypes:在iOS 8.0和更高版本的控制台消息中不受支持,但对于iOS 8设备,我正在获取设备令牌,设备正在订阅,但同样的事情对于iOS 9设备不起作用

我也参考了下面的链接,但没有运气


请帮助我获取iOS 9设备的设备令牌。

此问题已在MobileFirst 6.3及更高版本的IFIX中修复

解决:

1将您的MobileFirst studio更新为最新的iFix

2添加新的iOS本机环境

3用iFix新生成的文件夹替换样本的本机文件夹


4清理、构建和部署。

此问题已在MobileFirst 6.3及更高版本的后续iFixes中修复

if ([[[UIDevice currentDevice] systemVersion] floatValue] >= 8.0)
{
    [[UIApplication sharedApplication] registerUserNotificationSettings:[UIUserNotificationSettings settingsForTypes:(UIUserNotificationTypeSound | UIUserNotificationTypeAlert | UIUserNotificationTypeBadge) categories:nil]];
    [[UIApplication sharedApplication] registerForRemoteNotifications];
}
解决:

1将您的MobileFirst studio更新为最新的iFix

2添加新的iOS本机环境

3用iFix新生成的文件夹替换样本的本机文件夹

4清理、构建和部署

if ([[[UIDevice currentDevice] systemVersion] floatValue] >= 8.0)
{
    [[UIApplication sharedApplication] registerUserNotificationSettings:[UIUserNotificationSettings settingsForTypes:(UIUserNotificationTypeSound | UIUserNotificationTypeAlert | UIUserNotificationTypeBadge) categories:nil]];
    [[UIApplication sharedApplication] registerForRemoteNotifications];
}
使用上述代码

使用上述代码


谢谢,我会试试这个。谢谢,我会试试这个。谢谢回复,我不知道我的旧代码今天如何工作,我得到了iOS 9的设备令牌:谢谢回复,我不知道我的旧代码今天如何工作,我得到了iOS 9的设备令牌: