Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-20099] iOS: Ti.WatchSession.updateApplicationContext should check if app is installed

GitHub Issuen/a
TypeImprovement
PriorityNone
StatusOpen
ResolutionUnresolved
Affected Version/sRelease 5.1.1
Fix Version/sn/a
ComponentsiOS
Labelsn/a
ReporterFokke Zandbergen
AssigneeUnknown
Created2015-12-04T09:25:39.000+0000
Updated2018-02-28T19:55:05.000+0000

Description

If you call Ti.WatchSession.updateApplicationContext() when WatchSession is not supported or no Apple Watch is paired to the iOS device we log a silent error here: https://github.com/appcelerator/titanium_mobile/blob/bc85170157d3bebc5de1d61a9fe6e34bce84a8c9/iphone/Classes/WatchSessionModule.m#L174-L181 However when the Watch App is not installed the call to \[self watchSession\] updateApplicationContext will fail and we throw an exception like:
[ERROR] Script Error {
[ERROR]     column = 368;
[ERROR]     line = 1;
[ERROR]     message = "Unable to update Application Context: Watch app is not installed.";
[ERROR]     sourceURL = "file:///var/mobile/Containers/Bundle/Application/75BC3D23-AF58-4AA4-ACBB-23667D7F7D27/Weather%20Watch.app/watchsession.js";
[ERROR]     stack = "[native code]\nsendWeather@file:///var/mobile/Containers/Bundle/Application/75BC3D23-AF58-4AA4-ACBB-23667D7F7D27/Weather%20Watch.app/watchsession.js:1:368\nfile:///var/mobile/Containers/Bundle/Application/75BC3D23-AF58-4AA4-ACBB-23667D7F7D27/Weather%20Watch.app/alloy/controllers/index.js:1:1600\nonload@file:///var/mobile/Containers/Bundle/Application/75BC3D23-AF58-4AA4-ACBB-23667D7F7D27/Weather%20Watch.app/api.js:1:1279";
[ERROR] }
We should check if the app is installed and just like when we check for support and paired, fail with a silent error in the console.

Comments

No comments

JSON Source