Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-19427] Use name method/event names on Titanium and Watch side of session

GitHub Issuen/a
TypeImprovement
PriorityHigh
StatusClosed
ResolutionFixed
Resolution Date2015-08-30T03:37:10.000+0000
Affected Version/sRelease 5.0.0
Fix Version/sRelease 5.0.0
ComponentsiOS
LabelswatchOS2
ReporterFokke Zandbergen
AssigneeEric Merriman
Created2015-08-28T12:42:51.000+0000
Updated2017-03-16T22:13:26.000+0000

Description

Most methods, properties and events of Ti.WatchSession share their names with the Apple Watch side of the session. However, some are not and this could easily lead to mistakes so the more we can align them the better. * Ti.WatchSession.active() ** On Apple Watch: activateSession * Ti.WatchSession.updateAppContext() ** On Apple Watch: updateApplicationContext ** Then also rename Ti.WatchSession.recentAppContext to Ti.WatchSession.recentApplicationContext * Ti.WatchSession:watchSessionReceivedMessage ** On Apple Watch: (did)ReceiveMessage * Ti.WatchSession:watchSessionReceivedUserInfo ** On Apple Watch: (did)ReceiveUserInfo * Ti.WatchSession:watchSessionReceivedFile ** On Apple Watch: (did)didReceiveFile * Ti.WatchSession:watchSessionReceivedAppContext ** On Apple Watch: (did)didReceiveApplicationContext * Ti.WatchSession:watchSessionFinishedUserInfoTransfer ** On Apple Watch: (did)FinishUserInfoTransfer * Ti.WatchSession:watchSessionFinishedFileTransfer ** On Apple Watch: (did)FinishFileTransfer The watchSession prefix for the Ti.WatchSession events is a bit redundant anyway and since did* is more Obj-C/delegate style then JS, we could use finishFileTransfer for didFinishFileTransfer.

Comments

  1. Chee Kiat Ng 2015-08-29

    PR here: https://github.com/appcelerator/titanium_mobile/pull/7091
  2. Fokke Zandbergen 2015-08-29

    (y) (I guess I'll have to update the sample app now..)
  3. Chee Kiat Ng 2015-08-30

    PR Approved and merged. Yes [~fokkezb], time to update.
  4. Fokke Zandbergen 2015-08-31

    As we discussed on Flow, we may get in trouble with using present tense for events that start with did in iOS as there could also be will events with the same name, just like willResume and didResume which we translated to resume and resumed for that reason. We should have conventions for that in http://docs.appcelerator.com/platform/latest/#!/guide/Style_and_Conventions or some other guide and maybe change the WatchSession events to past tense (finishedfiletransfer instead of finishfiletransfer) but probably after 5.0
  5. Lee Morris 2017-03-16

    Closing ticket as fixed.

JSON Source