-
Notifications
You must be signed in to change notification settings - Fork 105
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Apple Watch app integration #77
Comments
cordova-lib makes extensive use of node-xcode so maybe you can find examples there ? https://github.com/apache/cordova-lib/blob/ba30bfda5860f672f5e2901e9d15c7daab566b71/cordova-lib/src/cordova/metadata/ios_parser.js |
I did that, that's even how I found out about this node module. The thing is the lack of documentation here isn't the main problem, my lack of XCode knowledge is 😄. And a Google search doesn't really bring anything up on the Cordova+Apple Watch app automation topic. I can't believe I'm the only one who need to do such a thing. |
Sometimes, code is documentation and that is hopefully the case with this node-xcode project. The method signatures in pbxProject.js are pretty self-explanatory.
Step 3) is the hardest. You might find some helper methods in pbxProject.js that add references to the right sections or you might have to write your own (pull requests welcome!). If you need assistance with this process, we can talk some more. May the source be with you! |
Thanks @imhotep ! |
@imhotep Thanks. Agreed sometimes code is documentation and method signatures here are self-explanatory but still I think some things should be documented. For example, one can add a resource file to a given target (pbxProject.js#L231), trying to do that I passed the name of my target and it didn't work, then I figured that the Now, your 3-steps process is exactly what I did before crying for help 😄. Diffing the two .pbxproj files show more than 40 differencies, mostly stuff that I don't understand due to my lack of XCode knowledge. I mean, what are So yeah, step 3) is the hardest, it feels like |
@sebastien-p Hit me up on Cordova Slack or #cordova on irc.freenode.net and we can chat some more about this. |
@sebastien-p Were you ever successful with this? I would like to do the same and I'm wondering if this approach is too fragile right now for app extensions. Thanks. |
@patniemeyer The Apple Watch integration has been put on hold while we refactor our whole application. I sadly have no news from @imhotep on the topic but hopefully I could talk to him next week at PGDEU. |
Hi,
I use to write Cordova applications which, I figured, make use of node-xcode under the hood to help automating stuff.
Now the problem is I'm not used to XCode and I need to automate the integration of an Apple Watch application. I plan on packaging the watch application as a Cordova plugin and use the provided hooks feature to get around some limitations of such plugins by editing some parts of the XCode configuration myself.
So I wrote some NodeJS code based on node-xcode. Parsing and writing to .pbxproj files was easy but - to me - adding stuff to them is not, node-xcode not being documented sadly isn't helping.
I found some occurrences of watch related code (pbxProject.js#L1418-L1419, pbxProject.js#L1541-L1542, pbxProject.js#L1559-L1560) so I guess what I want to achieve should be possible, maybe even fairly easily. But I'm stuck as I don't know what I need to add to the project file so that XCode would be aware my Cordova app contains an Apple Watch app. The only thing I believe I did right was to add new target like this
config.addTarget('watch app', 'watch_app');
and clearly this is far from enough.So, to all the Obiwan Kenobis out there: you are my only hope. Could you guys point me to the right direction please? Do you know of any resources I can read to help me understand the XCode project file better in this case (besides this one)? Do you know someone that already automated the integration of an Apple Watch app in a Cordova app? Anything you can share I'd take at this point.
Many thanks!
The text was updated successfully, but these errors were encountered: