ios – 如何使用Urban AirShip(Swift)获得appDelegate

在整合Urban Airship后,我打电话
let appDelegate = UIApplication.sharedApplication().delegate as? AppDelegate

我总是没事.当我试图获得UIApplication.sharedApplication().委托类时,它告诉我,它现在是UAAppDelegateProxy.

let appDelegate = UIApplication.sharedApplication().delegate as? UAAppDelegateProxy

也返回零.

我怎样才能获得appDelegate?

编辑

我想,只有当UAConfig参数automaticSetupEnabled设置为true时才会发生这种情况.当automaticSetupEnabled为false时,我像往常一样得到appDelegate,但我失去了城市飞艇自动配置的优势.

解决方法

这是他们承诺在下一个SDK版本中修复的Urban Airship SDK中的一个错误.

从他们的支持

We are aware of this issue and are looking to have it resolved in our next SDK release. In the meantime,as a workaround,manually setting up our SDK will allow you to work with the AppDelegate successfully.

相关文章

当我们远离最新的 iOS 16 更新版本时,我们听到了困扰 Apple...
欧版/美版 特别说一下,美版选错了 可能会永久丧失4G,不过只...
一般在接外包的时候, 通常第三方需要安装你的app进行测...
前言为了让更多的人永远记住12月13日,各大厂都在这一天将应...