[TIMOB-20099] iOS: Ti.WatchSession.updateApplicationContext should check if app is installed
GitHub Issue | n/a |
---|---|
Type | Improvement |
Priority | None |
Status | Open |
Resolution | Unresolved |
Affected Version/s | Release 5.1.1 |
Fix Version/s | n/a |
Components | iOS |
Labels | n/a |
Reporter | Fokke Zandbergen |
Assignee | Unknown |
Created | 2015-12-04T09:25:39.000+0000 |
Updated | 2018-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.
No comments