Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-19412] WatchOS2 template should demonstrate use of WatchConnectivity

GitHub Issuen/a
TypeImprovement
PriorityMedium
StatusClosed
ResolutionFixed
Resolution Date2015-08-31T20:20:29.000+0000
Affected Version/sRelease 5.0.0
Fix Version/sRelease 5.0.0
ComponentsiOS
LabelswatchOS2
ReporterFokke Zandbergen
AssigneeLee Morris
Created2015-08-26T12:47:01.000+0000
Updated2017-03-16T22:45:33.000+0000

Description

Out of the box the WatchOS2 template does not connect with the Titanium app it is bundled with. The storyboard should have some buttons and the InterfaceController.m and .h some basic code to demonstrate how to import and use WatchConnectivity/WatchConnectivity.h. Current template InterfaceController: https://github.com/appcelerator/titanium_mobile/blob/master/templates/applewatch/watchos2/template/%7B%7BExtName%7D%7D%20WatchApp%20Extension/InterfaceController.m.ejs Kiat's sample app with basic UI and logic: https://github.com/cheekiatng/Titanium-WatchOS2-Sample-App/blob/master/extensions/SGDemoWatchOS2/SGDemoWatchOS2%20WatchApp%20Extension/InterfaceController.m

Comments

  1. Chris Barber 2015-08-26

    Can't we just do this via the docs?
  2. Fokke Zandbergen 2015-08-27

    It's just a few lines and improves the dev experience. At least import the header and start the session so that when they add the watchsession code in the app it can find the watch app.
  3. Chris Barber 2015-08-27

    Submit a PR and assign me as the reviewer and it'll get merged.
  4. Fokke Zandbergen 2015-08-27

    [~cng] The [5.0 sample app](https://github.com/appcelerator-developer-relations/appc-sample-ti500) based on yours is still in progress and since my Obj-C is not fluent, would you be able to do a PR for this?
  5. Chee Kiat Ng 2015-08-27

    Ok. I was trying to get complication working as an example though. But i'll just submit a PR of the first version first.
  6. Fokke Zandbergen 2015-08-28

    Complications? O yes please: https://github.com/appcelerator-developer-relations/appc-sample-ti500/blob/master/README.md#todo ;)
  7. Hans Knöchel 2015-08-28

    [~fokkezb] are complications yet implemented? I will work on this ticket on monday as discussed with [~cng]
  8. Fokke Zandbergen 2015-08-28

    The WatchSession part of 5.0 sample is done, except for complications. You can maybe use some of it for the template: https://github.com/appcelerator-developer-relations/appc-sample-ti500
  9. Hans Knöchel 2015-08-30

    Pending PR (reflecting the code used in [~cng]'s demo): https://github.com/appcelerator/titanium_mobile/pull/7093
  10. Chee Kiat Ng 2015-08-31

    I was thinking if we should also implement a default code sample in the titanium app as well, otherwise the code in the Xcode extension project is meaningless. And also whether to have an option flag for developers to either choose empty project or with this sample code. [~cbarber], [~ingo], [~fokkezb], thoughts?
  11. Chee Kiat Ng 2015-08-31

    Bleh. Just realised that it's not that straight forward, because in studio, we are generating the ti watch Xcode project at the tiapp.xml GUI when we press 'enable watch'. That implies that there's already the default alloy template implemented on the titanium app. Have to think through this a bit.
  12. Fokke Zandbergen 2015-08-31

    Apart from generating a watch controller (if that doesn't already exist) with the sample code I don't see good way to also generate Titanium app sample code. But since our users are JS devs and its the Obj-C part they will need guidance with most, I think it's OK to only have that part in the template. Then at least as soon as you use an API in the Titanium app, the Watch app will respond out of the box. Updated PR based on https://github.com/appcelerator-developer-relations/appc-sample-ti500/tree/master/extensions/appc-sample-ti500 https://github.com/appcelerator/titanium_mobile/pull/7095
  13. Chee Kiat Ng 2015-08-31

    [~cbarber], can you review and see if we can get this out with 5.0.0? Thanks [~fokkezb]!
  14. Lee Morris 2017-03-16

    Closing ticket as fixed.

JSON Source