Open shannah opened 3 years ago
Just trying to understand if this applies to my use case. When you say extension, you mean things like Share Extensions, Notification Extensions, right?
I currently use a notification and a share extension. However, I also include a UserDefault reference in each of these (not sure if this will cause any issue)
Anyway, hope a blog post will be written on this so that the process can be easily understood
Thanks
How are you currently building your app with a share extension? Do you build with sources then add the extension afterward using Xcode?
Yes, every time I build with sources, then open with xcode, then add the extensions (file -> new target, etc).
Then I add the UserDefaults capability to each extension (I use that to talk between app and extensions), change the extension's version to match the main app's version, and select compatibility with iOS 10
In the case of the Notification Extension, I replace the .m file with my own
In the case of the Share Extension, I replace the .m file with my own, and then also modify the plist file to filter the appropriate shared types
I see. So after I implement what I'm proposing, you would only need to go through your process once. Then you would save your Xcode extension directory inside your Codename One app project under the ios/app_extensions directory, and the build server would link it into the project automatically.
That sounds awesome! Thanks a lot for this
There is another use case that might be useful in the future. I also happen to replace the app delegate's .m code with my own after each time I build. This is useful because I implement my own notification extension so I need to modify the code in a few places. It would be amazing to be able to overwrite the app delegate's code as well, but I know it's not the focus of this, just sharing
App extensions are like separate apps embedded within the main app bundle on iOS. They have their own App ID and need their own provisioning profile and entitlements. I plan to add support for adding app extensions by using the the following process:
In maven build:
On build server
In Maven "Generate Xcode Project" build target
It will perform same steps as build server to inject the share extension into the project. It may not do anything with provisioning profiles, and rather let Xcode take care of this, like it does with the main project.
In Certificate wizard
If the user chooses to generate provisioning profile, then it will look in the ios/app_extensions/ directory to find any app extensions that need provisioning profiles, and it will generate profiles for them also, and save them in the common/iosCerts directory.