将APNS
与ipv4一起使用一切正常,但当我将iphone连接到无线网络IPV6(NAT64)时,设备不会收到通知,并且此方法永远不会被调用
didRegisterForRemoteNotificationsWithDeviceToken
didFailToRegisterForRemoteNotificationsWithError
我们的代码:
- (void)applicationDidFinishLaunching:(UIApplication *)app {
// Configure the user interactions first.
[self configureUserInteractions];
// Register for remote notifications.
[[UIApplication sharedApplication] registerForRemoteNotifications];
}
// Handle remote notification registration.
- (void)application:(UIApplication *)app
didRegisterForRemoteNotificationsWithDeviceToken:(NSData *)devToken {
// Forward the token to your provider, using a custom method.
[self enableRemoteNotificationFeatures];
[self forwardTokenToServer:devTokenBytes];
}
- (void)application:(UIApplication *)app
didFailToRegisterForRemoteNotificationsWithError:(NSError *)err {
// The token is not currently available.
NSLog(@"Remote notification support is unavailable due to error: %@", err);
[self disableRemoteNotificationFeatures];
}
提前感谢您的帮助
答案 0 :(得分:0)
它可能与Reachibility有关,您是否测试了服务器的IPV6兼容性?