When NSUserDefaults is shared (via group) with a widget for instance it can lead to JSON.parse error when value stored by widget is a JS primitive: string or number.
Fix here userDefaults.get and userDefaults.set for
string
number
// in swift, your widget could store :
let userDefaults = NSUserDefaults(suiteName: "SUITE_NAME")
userDefaults?.setObject("a string for this key", forKey:"KEY_NAME")
userDefaults?.synchronize()
this fix insure string and number won't throw errors.
When
NSUserDefaults
is shared (via group) with a widget for instance it can lead to JSON.parse error when value stored by widget is a JS primitive: string or number.Fix here
userDefaults.get
anduserDefaults.set
for