With following changes we extended the plugin by supporting also MacOS platform.
What we have done so far:
Migrated the push_ios to Darwin. This allows to use pigeon for iOS and MacOS and also sharing the code between the both platforms.
MacOS FlutterPlugin is more restricted then the iOS on, there for it is not possible to get the delegates from the plugin and the devs need to forward NSApplicationDelegate to the Plugin. Added this info to Readme.
With "Conditional compilation" we separated the Platform specific code.
Since the push_ios is migrated to Darwin it would make sense to rename the dir (also remove push_macos). Will this introduce breaking changes?
MacOS push notification does not support background handling. This means the onPushNotificationReceived will be called only when the app is running. onBackground notification won't be called at all.
TODOs
[ ] The MacOS push notifications will be always displayed by the OS. So checking for alert like for iOS in PushHostHandler.didReceiveRemoteNotification will ignore most notifications. At the moment we skipped the check and forward all notifications.
With following changes we extended the plugin by supporting also MacOS platform. What we have done so far:
Needs discussion:
TODOs
alert
like for iOS inPushHostHandler.didReceiveRemoteNotification
will ignore most notifications. At the moment we skipped the check and forward all notifications.