简体   繁体   中英

iOS - Share a Today Extension with multiple app targets?

I have a project with multiple app targets (about 25).

I'm going to make a Today Extension for those apps but I don't want to create about 25 extensions with the same code and configuration.

Is it possible to create only one Today Extension that I assign to the 25 apps ?

It is possible, but with some manipulations. To connect extension with a target you need:

  1. Add your extension to target's embedded binaries ("General" tab of project's settings)

在此处输入图片说明

  1. Add extension's target to target dependencies ("Build Phases" tab of project's settings)

在此处输入图片说明

  1. Prefix your extension's bundle identifier with the parent app's (your current target) bundle identifier or you will get an error:

在此处输入图片说明

So when you will build or distribute your target make this manipulations and fix provisioning profile's issues with Xcode (it can do this automatically).

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM