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

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

问题描述

我的应用程序实现了新的iOS 10丰富推送Push 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.

我无法正式找到苹果公司的任何东西,说明您添加了服务扩展后,您的应用程序只能在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天全站免登陆