Skip to content
This repository was archived by the owner on Feb 22, 2023. It is now read-only.

Conversation

jherencia
Copy link
Contributor

@jherencia jherencia commented Jun 5, 2019

Separate onLaunch to an specific method to be able to retrieve launch message in a synchronous way

Description

When an application is closed an a user opens it by clicking a push notification we can retrieve the message in a synchronous way but the current architecture expects this to be asynchronous which may conflict with other processes run in parallel. This behaviour forces programmers to synchronize those processes and with the added problem that on of the async calls (onLaunch) is not called when the user opens the app in a normal way, so it is needed to add timeouts to limit the time we wait the callback.

Android and iOS let programmers access how the app has been opened in a synchronous way for Dynamic Links, Push notifications, etc. So this PR (and #1687) fixes this and handles this two situations in a consistent way.

Checklist

Before you create this PR confirm that it meets all requirements listed below by checking the relevant checkboxes ([x]). This will ensure a smooth and quick review process.

  • I read the Contributor Guide and followed the process outlined there for submitting PRs.
  • My PR includes unit or integration tests for all changed/updated/fixed behaviors (See Contributor Guide).
  • All existing and new tests are passing.
  • I updated/added relevant documentation (doc comments with ///).
  • The analyzer (flutter analyze) does not report any problems on my PR.
  • I read and followed the Flutter Style Guide.
  • The title of the PR starts with the name of the plugin surrounded by square brackets, e.g. [shared_preferences]
  • I updated pubspec.yaml with an appropriate new version according to the pub versioning philosophy.
  • I updated CHANGELOG.md to add a description of the change.
  • I signed the CLA.
  • [ x I am willing to follow-up on review comments in a timely manner.

Breaking Change

Does your PR require plugin users to manually update their apps to accommodate your change?

  • Yes, this is a breaking change (please indicate a breaking change in CHANGELOG.md and increment major revision).
  • No, this is not a breaking change.

@jherencia jherencia force-pushed the firebase_messaging branch 10 times, most recently from 62eff88 to f2b631b Compare June 9, 2019 19:07
@jherencia jherencia force-pushed the firebase_messaging branch from c021f0e to 0c0d7df Compare June 15, 2019 14:11
…le to retrieve launch message in a synchronous way
@jherencia jherencia force-pushed the firebase_messaging branch from 0c0d7df to a878631 Compare June 20, 2019 19:28
@jherencia jherencia changed the title [firebase_messaging] Separate onLaunch to an specific method to be able to retrieve launch message in a synchronous way [firebase_messaging] Separate onLaunch to a future to be able to retrieve launch message in a synchronous way Jul 15, 2019
@jherencia
Copy link
Contributor Author

jherencia commented Nov 22, 2019

Migrated to firebase/flutterfire#1481

@jherencia jherencia closed this Nov 22, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants