ben-xD / push

Push notifications in Flutter without firebase_messaging.
https://pub.dev/packages/push
36 stars 22 forks source link

Returning false prevents Flutter deep links to function at app cold start #49

Closed olivierbrand closed 2 months ago

olivierbrand commented 5 months ago

The plugin should never return false as it prevents the functioning of any deep link libraries (go router, uni_links,...) to function when the iOS application is not running. If returning false is mandatory for the push functionality to work, the push solution needs to be re-architected on that piece of code

ben-xD commented 5 months ago

I'm a bit confused since the plugin is only saying it (itself, FlutterPlugin) doesn't handle the URL resource (it's true, it doesn't).

Other plugins that do handle would return true. Is this not a bug in Flutter itself, in not managing the plugins handling the URL resource? For example, if there are 5 plugins, all say false except for 1.

obrand69 commented 4 months ago

That could be a flutter bug, but in your case, if you do not change that return statement, none of the deep link packages (including GoRouter, ..) work on iOS when the app is started from a killed state. In order to handle this case, you should not return blindly a value but rather add more code inside this appdelegate to see if the current state is a deep link or not

ben-xD commented 2 months ago

Cool. Sorry for the late reply.

I will reproduce the error and test this in all the scenarios and if there are no issues I'll release it.

ben-xD commented 2 months ago

There were merge conflicts with this PR so I just added the 1 line change separately. I also upgraded pigeon to the latest version too. I've released the fix in push_ios 0.5.1. I believe you could just flutter pub upgrade push push_ios to update to this version.