UNNotificationServiceExtension 不适用于 iPhone 5 (iOS 10) [英] UNNotificationServiceExtension not working on iPhone 5 (iOS 10)

查看:29
本文介绍了UNNotificationServiceExtension 不适用于 iPhone 5 (iOS 10)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我无法在运行 iOS 10 的 iPhone 5 上通过 UNNotificationServiceExtension 拦截推送通知.

I am not able to intercept push notification via UNNotificationServiceExtension on iPhone 5 running on iOS 10.

mutable-content 标志在有效载荷的 aps 内设置为 1.同样的通知在 iPhone 6S 的扩展程序中被拦截.

The mutable-content flag is set as 1 inside the aps in payload. The same notification is getting intercepted in the extension for iPhone 6S.

iPhone5 是否不支持通知服务应用程序扩展(因为 32 位)?

Is Notification Service app extension not supported on iPhone5(because of 32-bit maybe)?

我查看了文档,但没有提到它会仅适用于特定设备.

I have looked at the documentation and it is no where mentioned that it will work only on specific devices.

也在 Apple 开发者论坛中询问了相同的问题.

Asked the same question in Apple Developer forum as well.

推荐答案

检查扩展的部署目标.测试设备和部署目标应该是一样的.将部署目标更改为 10.0 后,UNNotificationServiceExtension 实例完美调用.可能是您的 iPhone 6S 设备使用 10.1 并与您的 UNNotificationServiceExtension 部署目标和使用较低版本部署目标的 iPhone 5 匹配.所以不适用于 iPhone 5.

Check your deployment target for the extension. it should be same for test device and deployment target. After altering the deployment target to 10.0 the UNNotificationServiceExtension instance called perfectly. May be your iPhone 6S device using 10.1 and match with your UNNotificationServiceExtension deployment target and iPhone 5 using lower version of deployment target. So will not work on iPhone 5.

这篇关于UNNotificationServiceExtension 不适用于 iPhone 5 (iOS 10)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆