How to add some of App Extensions to Unity ios build

Really, how to do it?

I want to use, for example, Today Extension for my ios app made in unity. When open my app in Xcode and try to do it with File → New → Target → Application Extension → Today Extension, I get an error about some missing file.

Do I need some special way of adding these app extensions or I am doing something fundamentally wrong.
Is it still not compatible even though unity did made ios 8.1 build available?
Can this be done, or not?

Please, give me some answers, because I am wasting my second week on this.

Did anyone even tried this? Any kind of experiences? Anything???

What is the error you are getting concerning the missing file?

You are adding the Today Extension to your project correctly. Make you you switch to the extension’s target when building if you want to test the Today Extension’s functionality.

I was getting an error that .appex file is missing, but later I figured the file was built on the other location. At the end, I somehow managed to make it all work.

Also, by using simulator and trying to run either of targets, xcode would just exit. That is still a problem to me.

Just to add, after I put watchKit extension to unity ios project, successfully build all that, select watchKit extension as target and try to run it, I get an error saying “Installation failed, Invalid arguments”.
And that ONLY happens with watchKit extension added to UNITY ios apps. running WatchKit extension with NATIVE iOS apps works and running APP extensions with Unity works too, but watchKit + Unity ios doesn’t work.

I really don’t know where to look. I found this link iphone - Installation Failed: Invalid Argument -iOS Extension - Stack Overflow talking about that error, but that doesn’t help me.

Any ideas are welcome!

ps. I know watchKit is made for iOS 8.2 and Unity can build iOS 8.1 max, but I am trying to find some workaround, and so far, it was possible.

I am trying to the same thing and am having this exact same issue. Were you ever able to find a work around MarsaPalas?

Bump! Having the same issue with Unity5 b22.

Anyone having any luck with this?

I have been trying to get Watchkit App to work with Unity for the last few days. Here is my current progress

  • Create an Unity iOS project, set the build option to Simulator SDK and build the xcode project.
  • Following Apple’s instructions, add the WatchKit extension and WatchKit app build targets to the xcode project.
  • Change the Unity target’s build location to build/Debug-iphones instead of build/Debug-iphonesimulator to fix a file copy failed error.(or the appex files can be copied from the iphoneos folder to the iphonesimulator folder)
  • Fix the embedded binary code signing not consistent with the parent app issue by setting all the tree target’s identiity team to the same team.(have to chage the build settings’ targted device family to iOS8 also)

But when it’s running on the simulator, I got another error message below
SPErrorGizmoInstallNeverFinishedErrorMessage
Looks like the app failed to install on the watch simulator and I cannot find a way to make it work.
I will keep posting my progress, please also share your progress with the community. Thanks

I have been able to create and add the extension, however I am just getting a blank (black) screen on the secondary watch display.

Sean

Hi,

I have written a step by step tutorial on implementing the WatchKit api in Unity - you will also find a WatchKitUnity package which includes the iOS plugin and a WatchKitUnityManager prefab to setup the communication and listeners required

http://devgallery.com/unity/watchkit-unity

Please let me know how you get on!

The furthest I got just caused the apple watch to be stuck on loading . No errors or logs at all. Just stuck

Hi @Nik0s ,

Is it possible to do all these things with postbuild scripts ?

Regards

Not yet at the moment, but we’re working on improving the Xcode API so that adding extensions automatically is as painless as possible.

Is there an estimate on when this is coming?
Will we be able to use an in-editor tool for this, or will it simply be code documentation?

The latter.

Is there any way to script this with the existing Xcode API? I’ve tried using reflection to access the existing PBXProject.AddAppExtension() method, but it fails in an AddFile() call. We have a Today Extension and would really like to avoid adding it to the project by hand.

1 Like

Hi, this is a bit “bitrotten” API which was not exposed precisely because it was not fully tested. We will fix it some day in the future, but for now it’s early to say when. We’ll get back to this thread once the functionality is released.

Hello Povilas. I wanted to know if there has been any advance on this area. Creating extensions is very significant to iOS 10 and allowing you to set them up through the Xcode API makes it viable, especially when using continuous integration systems like cloud build.

Thanks,

Alejandro.

…I agree with brainz. I’m struggling to devise a re-usable (automatable) workflow that involves a Unity-built XCode project and an XCode Sticker Pack Extension.