iOs无法使用远程APN和ipv6注册

时间:2018-04-23 08:43:26

标签: ios objective-c iphone xcode applet

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];
}

提前感谢您的帮助

1 个答案:

答案 0 :(得分:0)

它可能与Reachibility有关,您是否测试了服务器的IPV6兼容性?