Post

Replies

Boosts

Views

Activity

Notification on NSUserDefaults Change When App Is In Background
I have two applications that share an app group @"group.edu.tds.poc.shared"Using NSUserDefaults of this app group, I am able to exchange data between the reader app and the writer app.The Writer App writes data to the NSUserDefaultNSUserDefaults *sharedDefaults = [[NSUserDefaults alloc] initWithSuiteName:@"group.edu.tds.poc.shared"]; [share dDefaults setObject:stringToStore forKey:key]; [sharedDefaults synchronize];The Reader App reads the data from the NSUserDefaultNSUserDefaults *sharedDefaults = [[NSUserDefaults alloc] initWithSuiteName:@"group.edu.tds.poc.shared"]; return [sharedDefaults stringForKey:@"key"];I now want the reader app to be notified as soon as the writer app modifies the value for the key. I.e. Can I notify the reader app when the writer app is running in the foreground (Reader app is either running in the background or is not running).I have implemented the marked solution but with no luck:Cocoa - Notification on NSUserDefaults value change?NSUserDefaults and KVO issuesCall back only when the Reader App is in foreground state. (Wrote to the Shared Defaults using Reader app)Any idea if this can be achieved?
6
1
2.8k
Aug ’17
[iOS] Shared Resources for two Apps from the same developer
Is it possible that AppA and AppB which are from the same developer share some local resources on a given device.For instance:Can the data written by App A, be read by App B (through Shared Defaults or any other mechanism)?The following link is to a similar question raised on stackoverlfow. I wanted to be certain thus, raising this question on Apple Dev Forums.https://stackoverflow.com/questions/9079378/shared-resources-for-two-apps-from-the-same-developer
11
0
8.2k
Aug ’17