如何在 iOS 10 之前的版本上使用 UNNotificationServiceExtension 运行应用程序? [英] How to run app with UNNotificationServiceExtension on pre iOS 10?

查看:18
本文介绍了如何在 iOS 10 之前的版本上使用 UNNotificationServiceExtension 运行应用程序?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

My app implements the new iOS 10 rich push NotificationService extension.

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

Everything works as expected on iOS 10, but I also want to support pre iOS 10 devices - of course not rich push, but just regular push. When lowering the deployment target in Xcode to e.g. 8.0 or 9.0 and trying to run on an older simulator or device i get the following errors:

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.

我找不到 Apple 官方声明的任何内容,说明您的应用程序只能在添加服务扩展后在 iOS 10+ 上运行 - 有人可以确认吗?

I couldn't find anything officially by Apple stating that your app will only run on iOS 10+ once you add a Service Extension - can someone confirm that?

推荐答案

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

Bhavuk Jain is talking about how to support notification on older ios but doesn't solve the LaunchServicesError. To solve this you need to go to your extension target -> General -> Set Deployment Target (10.0 for this case) under Deployment Info.

这篇关于如何在 iOS 10 之前的版本上使用 UNNotificationServiceExtension 运行应用程序?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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