Ios 推送通知无法正常工作

Ios 推送通知无法正常工作,ios,ios7,ios8,push-notification,apple-push-notifications,Ios,Ios7,Ios8,Push Notification,Apple Push Notifications,我和我的团队因为这个问题遭受了一个月的痛苦,问题是苹果推送通知在所有安装的设备上都工作了一段时间,但在那之后,即使一台设备也没有收到任何通知,这种情况持续发生,请解决这个问题。这个问题在哪里,如何解决这个问题,请帮助我。我已经在AppDelegate的didFinishLaunchingWithOptions方法中编写了以下代码 如果要注册iOS 8和iOS 7,需要在didFinishLaunchingWithOptions中注册: if ([[UIApplication sharedAppl

我和我的团队因为这个问题遭受了一个月的痛苦,问题是苹果推送通知在所有安装的设备上都工作了一段时间,但在那之后,即使一台设备也没有收到任何通知,这种情况持续发生,请解决这个问题。这个问题在哪里,如何解决这个问题,请帮助我。我已经在AppDelegate的didFinishLaunchingWithOptions方法中编写了以下代码


如果要注册iOS 8和iOS 7,需要在didFinishLaunchingWithOptions中注册:

if ([[UIApplication sharedApplication] respondsToSelector:@selector(registerUserNotificationSettings:)])
{
    // iOS 8 Notifications
    // use registerUserNotificationSettings
    [[UIApplication sharedApplication] registerUserNotificationSettings:[UIUserNotificationSettings settingsForTypes:(UIUserNotificationTypeSound | UIUserNotificationTypeAlert | UIUserNotificationTypeBadge) categories:nil]];
    [[UIApplication sharedApplication] registerForRemoteNotifications];
} else {
    // iOS < 8 Notifications
    // use registerForRemoteNotifications
    [[UIApplication sharedApplication] registerForRemoteNotificationTypes: UIRemoteNotificationTypeBadge | UIRemoteNotificationTypeSound | UIRemoteNotificationTypeAlert];
}

确保服务器端生成的p12与我在服务器端发布的配置、相关证书相对应,但仍然是这样工作的
if ([[UIApplication sharedApplication] respondsToSelector:@selector(registerUserNotificationSettings:)])
{
    // iOS 8 Notifications
    // use registerUserNotificationSettings
    [[UIApplication sharedApplication] registerUserNotificationSettings:[UIUserNotificationSettings settingsForTypes:(UIUserNotificationTypeSound | UIUserNotificationTypeAlert | UIUserNotificationTypeBadge) categories:nil]];
    [[UIApplication sharedApplication] registerForRemoteNotifications];
} else {
    // iOS < 8 Notifications
    // use registerForRemoteNotifications
    [[UIApplication sharedApplication] registerForRemoteNotificationTypes: UIRemoteNotificationTypeBadge | UIRemoteNotificationTypeSound | UIRemoteNotificationTypeAlert];
}