TLDR: Is it possible to send realtime messages or notifications between iOS App and it's Extension?
I'm writing an iOS App with an extension that are part of the same App Group
and share the same CoreData (SQLite database). I can read and write to the database using CoreData from the App and from the extension, they both share the same content.
My Question is: Is it possible to send messages or notifications between the App and the extension to notify the other to update if necessary?
I tried sending notifications through NSNotificationCenter
but that does not go "out" of the App/Extension, same issue if I try to write to the group shared NSUserDefaults
and listen to NSUserDefaultsDidChangeNotification
. This works inside the App but the extension does not receive anything (when I know that it is launched and it share the same NSUserDefaults
). Any idea how to keep things in sync?