几天前我更新了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/