iOS - APNS - 推送未接收

标签 ios apple-push-notifications

几天前我更新了apns证书。在应用程序商店中发布的应用程序似乎一切正常。 一天后,我创建了一个临时 IPA,但这次推送通知没有到达。这很奇怪,因为没有错误日志。 在我使用的服务器中 https://pypi.python.org/pypi/apns-client/0.2.1

我做错了什么?

更新

我正在使用工具来测试我的 pem 文件和设备 token ,根据此工具消息已成功发送。但是我的 iPhone 收不到推送通知。

最佳答案

我的问题没有完全解决,但我发现了 adhoc IPA 和 Debug模式的不同行为。

我做了一个token注册失败的测试代码。

- (void)application:(UIApplication*)application didFailToRegisterForRemoteNotificationsWithError:(NSError*)error
{
    NSLog(@"Failed to get token, error: %@", error);

    UIAlertView *alert = [[UIAlertView alloc]
                          initWithTitle:@"APNS Error"
                          message:[error localizedDescription]
                          delegate:self
                          cancelButtonTitle:@"Cancel"
                          otherButtonTitles:@"OK", nil];
    [alert show];
}

这让我知道我的项目设置存在问题。但正如我所说,即使我的项目设置错误,推送通知也能毫无问题地到达许多设备。

关于iOS - APNS - 推送未接收,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42590570/

相关文章:

firebase - 使用 FCM 在 Apple Safari 中推送通知

ios - 没有为应用商店上的应用程序找到有效的 'aps-environment' 权利字符串

ios - 是否可以通过单击 Xcode 5 中的构建和运行按钮在两个设备上运行应用程序?

ios - AVAudioPlayer 不播放长音?

ios - 使用 3rd 方服务的推送通知传递速度?

ios - userNotificationCenter 中的 completionHandler 实际上做了什么?

ios - Firebase iOS 推送通知在首次安装时不起作用

ios - 获取范围(含)之间的值的正确查询

ios - iOS 8 中 UIPopoverController 错误的 UITextField 高度

ios - Applescript 在 iOS 设备上自动构建和运行