Search code examples
iosmacostoday-extension

communicate between today widget and application


I have a today widget and an application. The need is to communicate between them so that information can be passed any any point of time when both are running.

I can achieve communicating tow application on Mac application using NSProxy, setting one process as server.

Regards,


Solution

  • Communication between Host App and Today Extension:

    1. To share data: use AppGroups

    2. To share code: use Frameworks

    Refer to: https://developer.apple.com/library/content/documentation/General/Conceptual/ExtensibilityPG/ExtensionScenarios.html#//apple_ref/doc/uid/TP40014214-CH21-SW1

    For more on how to implement Today Extension: https://github.com/pgpt10/Today-Widget