Push notification iphone6没有';无法接收推送通知

Push notification iphone6没有';无法接收推送通知,push-notification,apple-push-notifications,Push Notification,Apple Push Notifications,我正在尝试向在iOS 8上运行的应用程序发送推送通知 我有两个装置;一款是带iOS 8的iPad2,另一款是iPhone6+ 两台设备上运行的完全相同的应用程序,我使用相同的php脚本发送推送通知 if ([application respondsToSelector:@selector(isRegisteredForRemoteNotifications)]) { UIUserNotificationSettings *settings = [UIUserNotificatio

我正在尝试向在iOS 8上运行的应用程序发送推送通知

我有两个装置;一款是带iOS 8的iPad2,另一款是iPhone6+

两台设备上运行的完全相同的应用程序,我使用相同的php脚本发送推送通知

if ([application respondsToSelector:@selector(isRegisteredForRemoteNotifications)])
{
    UIUserNotificationSettings *settings =
    [UIUserNotificationSettings settingsForTypes:UIUserNotificationTypeAlert |
     UIUserNotificationTypeBadge |
     UIUserNotificationTypeSound
                                      categories:nil];
    [[UIApplication sharedApplication] registerUserNotificationSettings:settings];
    [[UIApplication sharedApplication] registerForRemoteNotifications];
}
else
{
    // iOS < 8 Notifications
    [application registerForRemoteNotificationTypes:
     (UIUserNotificationTypeBadge | UIUserNotificationTypeSound | UIUserNotificationTypeAlert)];
}
我使用下面的objective c代码来允许推送通知

if ([application respondsToSelector:@selector(isRegisteredForRemoteNotifications)])
{
    UIUserNotificationSettings *settings =
    [UIUserNotificationSettings settingsForTypes:UIUserNotificationTypeAlert |
     UIUserNotificationTypeBadge |
     UIUserNotificationTypeSound
                                      categories:nil];
    [[UIApplication sharedApplication] registerUserNotificationSettings:settings];
    [[UIApplication sharedApplication] registerForRemoteNotifications];
}
else
{
    // iOS < 8 Notifications
    [application registerForRemoteNotificationTypes:
     (UIUserNotificationTypeBadge | UIUserNotificationTypeSound | UIUserNotificationTypeAlert)];
}

问题是在iPad2(iOS 8)上运行的应用程序会收到推送通知,但iPhone6+不会

问题是什么


任何建议都将不胜感激。

您是否已将新的iPhone6添加到您的开发配置文件中?然后再次下载并安装配置文件。这为我解决了问题。

不确定这是否可能,但我在接收通知时也遇到了奇怪的问题,然后我从苹果的文档中阅读了以下内容:

值为1的content available属性允许远程通知充当静默通知。 对于无声通知,请注意确保aps字典中没有警报、声音或徽章负载

我注意到你的aps字典里有全部3个(警告音和徽章) 医生们接着说,如果是这样的话,苹果可能不会传递这条信息

去掉那些对我有用

谢谢
Wayne

您授权应用程序显示iOS 8中更改的通知的方式。我打赌你的iPad在iOS 7上安装了你的应用程序,然后你升级了iPad。通知首选项将在该设备上被记住。但是,您的iPhone 6将始终具有iOS 8,并且可能从未要求显示推送通知,因为API是不同的。看看,你在这方面运气好吗?我有一个非常类似的问题,除了在我的例子中,相同的应用程序在iPhone5iOS8上接收,但在iPadAir或iPadMini上接收不到。这三款手机今晚都安装了新的应用程序,因此与之前的评论无关。这三个都使用相同的wifi,因此它与3G和wifi无关。@adeltahir,你是如何解决这个问题的?你得到解决方案了吗?如果设备未添加到配置文件中,他如何安装build但无法接收推送通知,