dpa99c / cordova-plugin-firebasex

Cordova plugin for Google Firebase
MIT License
572 stars 463 forks source link

[FEATURE] Implement non-blocking mechanism for consuming iOS app delegate events #443

Open ajberasategui opened 4 years ago

ajberasategui commented 4 years ago

Feature request

I'm trying to integrate my application with Airship by using https://github.com/urbanairship/urbanairship-cordova

It happens that AppDelegate+FirebasePlugin.m is registering itself as Notifications delegate which produces this plugin to get the notifications instead of the Airship one.

I've been looking around for a way to disable it and couldn't find any in the current implementation. So, this is both a feature request but also, if currently there's a way that I did not see to do the disabling, I'm asking for help to figure it out.

Also, a very big thank you to @dpa99c for the awesome work on this plugin.

dpa99c commented 4 years ago

Since only one instance of a delegate method can be registered, this is not an issue specific to this plugin but more generally to how Cordova handles app delegates on iOS.

There is no easy way of "disabling" the app delegate class that this plugin registers - without it, the plugin will not work properly.

The ideal solution would be an intermediate app delegate class which rebroadcast app delegate events, allowing multiple plugins to register for and receive the same app delegate events.

Cordova does not currently have a built-in mechanism for this, however there now exists cordova-plugin-app-event which provides a 3rd party solution for this.

If this plugin were adapted to use that plugin's broadcast mechanism instead of directly registering its own app delegate methods, that would theoretically enable other plugins to receive the same app delegate events, but only if they also conform to the same approach and use cordova-plugin-app-event to receive their app delegate events.

So it's something that could definitely be added to this plugin but would require other plugins (e.g. in this case Urban Airship) to be updated likewise to use the same mechanism.

ajberasategui commented 4 years ago

Thank you very much @dpa99c!

stale[bot] commented 3 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

dpa99c commented 3 years ago

Reopening as stalebot incorrectly closed it

Phoenix-Alpha commented 3 years ago

Hi @dpa99c, Thanks for opening this issue again. I recently found reason why iOS foreground notification not working on my app which I used both firebasex & local notification. It will be perfect if you can integrate local notification feature to this plugin to make both features work in harmony. I was a bit frustrated to see that local notification not compatible with this plugin. Could you add this feature to this plugin or recommend another plugin for local notification in the documentation? Thanks.

Maho38 commented 8 months ago

Hello @dpa99c, for me it would also be great if you could integrate local notifications into this plugin. That's why I'm also asking if you could add this feature to this plugin or recommend another plugin for local notifications in the documentation? Thanks