相关疑难解决方法(0)

在ios 9中没有调用didRegisterForRemoteNotificationsWithDeviceToken

我必须在我的项目中实现APNS,我在开发人员门户中创建了APNS SSL,并使用此我为此创建了新的配置文件.使用SSL证书我创建了P12文件,然后将其合并到PEM文件.我得到一个应用程序想要发送通知的弹出窗口.....我接受但仍然没有得到设备令牌!!

didfinishLaunching我使用这部分

float ver = [[[UIDevice currentDevice] systemVersion] floatValue];

   if(ver >= 8 && ver<9)
    {
        if ([[UIApplication sharedApplication] respondsToSelector:@selector(registerUserNotificationSettings:)])
        {
           [[UIApplication sharedApplication] registerUserNotificationSettings:[UIUserNotificationSettings settingsForTypes:(UIUserNotificationTypeSound | UIUserNotificationTypeAlert | UIUserNotificationTypeBadge) categories:nil]];

            [[UIApplication sharedApplication] registerForRemoteNotifications];

            //[[UIApplication sharedApplication] registerUserNotificationSettings:settings];

        }
    }else if (ver >=9){

        [[UIApplication sharedApplication] registerUserNotificationSettings:[UIUserNotificationSettings settingsForTypes:(UIUserNotificationTypeSound | UIUserNotificationTypeAlert | UIUserNotificationTypeBadge) categories:nil]];

        [[UIApplication sharedApplication] registerForRemoteNotifications];

    }
    else{
        //iOS6 and iOS7 specific code
        [[UIApplication sharedApplication] registerForRemoteNotificationTypes:UIRemoteNotificationTypeBadge|UIRemoteNotificationTypeAlert];
    }


I have used delegate method of …
Run Code Online (Sandbox Code Playgroud)

iphone objective-c ios objective-c-blocks

4
推荐指数
1
解决办法
5406
查看次数

标签 统计

ios ×1

iphone ×1

objective-c ×1

objective-c-blocks ×1