没有收到ios 7.0.2推送通知

时间:2014-10-21 05:57:46

标签: ios iphone push-notification

我在iOS应用中实现了推送通知。它在iOS 8.0(in iPhone 5s)iOS 7.1.1(in iPhone 5)中工作正常,但无法在iOS 7.0.2(in iPhone 4s)中使用。

以下是代码:

    - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
    // Override point for customization after application launch.
    if ([application respondsToSelector:@selector(isRegisteredForRemoteNotifications)])
    {
        // iOS 8 Notifications
        [application registerUserNotificationSettings:[UIUserNotificationSettings settingsForTypes:(UIUserNotificationTypeSound | UIUserNotificationTypeAlert | UIUserNotificationTypeBadge) categories:nil]];

        [application registerForRemoteNotifications];
    }
    else
    {
        // iOS < 8 Notifications
        [application registerForRemoteNotificationTypes:
         (UIUserNotificationTypeBadge | UIUserNotificationTypeSound | UIUserNotificationTypeAlert)];
    }
    UIViewController *vc = [[UIStoryboard storyboardWithName:@"Main" bundle:nil] instantiateViewControllerWithIdentifier:@"idHome"];
    navController = [[UINavigationController alloc] initWithRootViewController:vc];
    self.window.rootViewController = navController;
    [self.window makeKeyAndVisible];
}

我甚至得到所有版本的device token id

让我知道我哪里出错了。我该如何解决这个问题?

0 个答案:

没有答案