作者热门文章
- android - RelativeLayout 背景可绘制重叠内容
- android - 如何链接 cpufeatures lib 以获取 native android 库?
- java - OnItemClickListener 不起作用,但 OnLongItemClickListener 在自定义 ListView 中起作用
- java - Android 文件转字符串
我想快速、平稳地从已弃用的推送通知常量过渡。我知道实现远程和本地通知的方法也发生了变化,但这超出了这个问题的范围。
以下是应考虑的一些因素/限制因素:
感谢您的帮助!
最佳答案
幸运的是,这是相当简单的。您需要做的就是使用编译器指令,最好是在推送通知中心的头文件中。在条件指令中,您可以使用定义将您自己的常量集映射到新集或已弃用的集,具体取决于您的 xCode 支持的最新 iOS 版本。
#ifdef __IPHONE_8_0
#define RemoteNotificationTypeAlert UIUserNotificationTypeAlert
#define RemoteNotificationTypeBadge UIUserNotificationTypeBadge
#define RemoteNotificationTypeSound UIUserNotificationTypeSound
#define RemoteNotificationTypeNone UIUserNotificationTypeNone
#else
#define RemoteNotificationTypeAlert UIRemoteNotificationTypeAlert
#define RemoteNotificationTypeBadge UIRemoteNotificationTypeBadge
#define RemoteNotificationTypeSound UIRemoteNotificationTypeSound
#define RemoteNotificationTypeNone UIRemoteNotificationTypeNone
#endif
关于ios - UIRemoteNotificationTypeAlert 已弃用 - 我如何在大型团队中过渡到 UIUserNotificationTypeAlert?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27936023/
我想快速、平稳地从已弃用的推送通知常量过渡。我知道实现远程和本地通知的方法也发生了变化,但这超出了这个问题的范围。 以下是应考虑的一些因素/限制因素: 我有一个相当庞大的 iOS 开发团队。 一些开发
我是一名优秀的程序员,十分优秀!