2

我一直在研究使用模拟器测试远程通知,并且知道从 Xcode 11.4 beta 开始,我们应该能够做到这一点。

我试图测试的方式是:

  1. 在 didFinishLaunchingWithOptions 内启动的应用程序中,我正在执行以下操作:

[[UIApplication sharedApplication] registerForRemoteNotifications];

  1. 我添加了如下回调:
- (void)application:(UIApplication*)application didRegisterForRemoteNotificationsWithDeviceToken:(NSData *)deviceToken
{
    NSLog( @"Succeeded at registering for remote notifications" );
    return;
 }

- (void)application:(UIApplication *)application didFailToRegisterForRemoteNotificationsWithError:(NSError *)error
{
    NSLog( @"Failed to register for remote notifications" );
    return;

}

我在 didFailToRegisterForRemoteNotificationsWithError 中遇到断点,错误是: 模拟器不支持远程通知

有办法解决吗?我是否误解了 XCode 11.4 中支持的功能?

4

0 回答 0