如何在iOS 10之前使用UNNotificationServiceExtension运行应用程序?

Ben*_*ten 1 iphone apple-push-notifications ios richpush serviceextension

我的应用程序实现了新的iOS 10富推送NotificationService扩展.

一切都按预期在iOS 10上运行,但我也想支持iOS 10之前的设备 - 当然不是丰富的推送,而只是常规推送.将Xcode中的部署目标降低到例如8.0或9.0并尝试在较旧的模拟器或设备上运行时,会出现以下错误:

Simulator: The operation couldn’t be completed. (LaunchServicesError error 0.)
Device: This app contains an app extension that specifies an extension point identifier that is not supported on this version of iOS for the value of the NSExtensionPointIdentifier key in its Info.plist.
Run Code Online (Sandbox Code Playgroud)

Apple没有正式发现任何东西,说明你的应用程序只能在iOS 10+上运行一旦添加服务扩展 - 有人可以确认吗?

Ale*_*s O 5

Bhavuk Jain正在谈论如何支持旧版ios的通知,但没有解决LaunchServicesError.要解决此问题,您需要转到部署信息下的扩展目标 - >常规 - >设置部署目标(本案例为10.0).