[TIMOB-19427] Use name method/event names on Titanium and Watch side of session
GitHub Issue | n/a |
---|---|
Type | Improvement |
Priority | High |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2015-08-30T03:37:10.000+0000 |
Affected Version/s | Release 5.0.0 |
Fix Version/s | Release 5.0.0 |
Components | iOS |
Labels | watchOS2 |
Reporter | Fokke Zandbergen |
Assignee | Eric Merriman |
Created | 2015-08-28T12:42:51.000+0000 |
Updated | 2017-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
.
PR here: https://github.com/appcelerator/titanium_mobile/pull/7091
(y) (I guess I'll have to update the sample app now..)
PR Approved and merged. Yes [~fokkezb], time to update.
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 bewill
events with the same name, just likewillResume
anddidResume
which we translated toresume
andresumed
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 offinishfiletransfer
) but probably after 5.0Closing ticket as fixed.