[TIMOB-18852] Ti.App.iOS.UserDefaults needs ability to set the suiteName in order for it to work with Apple Watch
GitHub Issue | n/a |
---|---|
Type | Improvement |
Priority | High |
Status | Closed |
Resolution | Invalid |
Resolution Date | 2015-04-25T01:13:08.000+0000 |
Affected Version/s | n/a |
Fix Version/s | Release 4.0.0 |
Components | TiAPI |
Labels | n/a |
Reporter | Rick Blalock |
Assignee | Ingo Muschenetz |
Created | 2015-04-24T21:19:55.000+0000 |
Updated | 2018-10-22T14:00:32.000+0000 |
Description
I was looking at the new UserDefaults API we have for sharing data between iOS extensions and it's missing the ability to specify a suiteName. Without this, this API cannot share data across extensions.
Example in a watch extension:
let sampleDefaults = NSUserDefaults(suiteName: "group.com.myapp.here")
Currently you can only do something like:
Ti.App.iOS.UserDefaults.setObject('myKey', {});
Which points to the standard user defaults...which the apple watch can't access. Maybe a 3rd param needs to be introduced in these methods where you can specify the suiteName.
Ref. http://stackoverflow.com/questions/27007288/watchkit-sdk-not-retrieving-data-from-nsuserdefaults
Apparently, setting the suiteName is possible (though I didn't see reference to it at all in the class). Ref. https://github.com/appcelerator/titanium_mobile/blob/19886c8797a808d5cc4f572e85c791ac757a2c47/apidoc/Titanium/App/iOS/UserDefaults.yml
how do you actually use it? I need to retrieve the value passed from an MDM like this: