如何为 Urban Airship SDK 最新版本注册设备令牌?

How to register device token for Urban Airship SDK latest versions?

在旧版本的 SDK 中,我们可以使用以下 SDK 委托方法注册设备令牌。

- (void)application:(UIApplication *)application 
      didRegisterForRemoteNotificationsWithDeviceToken:(NSData *)deviceToken {
    UALOG(@"APN device token: %@", deviceToken);
   // Updates the device token and registers the token with UA
   [[UAirship shared] registerDeviceToken:deviceToken];
}

但在最新版本中删除了上述委托方法,因此如何在最新版本的 SDK 中注册设备令牌(例如:UrbanAirship-iOS-SDK - 9.0)。

提前致谢..

如果您不使用 Airship SDK 的自动集成,您将需要向 SDK 传递一些东西,例如您提到的设备令牌。这些转发详情的方法移到了SDK的v8.0.0中。您现在可以像这样使用 UAAppIntegration class 访问它们:

[UAAppIntegration application:application didRegisterForRemoteNotificationsWithDeviceToken:deviceToken];

此文档应该是最新的,包含更多详细信息:https://docs.airship.com/platform/ios/advanced/advanced-configuration/?obj-c#automatic-integration