2

I have a Safari App Extension that injects a button over images into a specific website and when tapping that button I want to trigger a function with some parameters in the application that contains the safari app extension (NOT from .js to extension handler)

How can I communicate from the Safari App Extension with the main app in real time? NSUserDefaults trough app groups does not seems a good idea

Silviu St
  • 1,810
  • 3
  • 33
  • 42

1 Answers1

0

If you don't (can't) listen to updates of "shared user defaults" (using a group SuiteName). Then you may try with Distributed Notifications: https://developer.apple.com/documentation/foundation/distributednotificationcenter

It's quite simple and similar to messaging between Content Scripts and Safari App Extension.

Emmanuel Sellier
  • 526
  • 1
  • 5
  • 13