Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add getInitialMessage method for handling push notification in Terminated App State #1028

Merged
merged 7 commits into from
Dec 7, 2023

Conversation

vinothvino42
Copy link
Collaborator

@vinothvino42 vinothvino42 commented Nov 30, 2023

Ticket: #1027

…terminated app state and update screen widget to handle it
@vinothvino42 vinothvino42 added the bug Something isn't working label Nov 30, 2023
@vinothvino42 vinothvino42 requested a review from vusters November 30, 2023 14:26
@vinothvino42 vinothvino42 self-assigned this Nov 30, 2023
Copy link
Contributor

@vusters vusters left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

are you missing some files? You are removing the logic to execute callbacks but added somewhere else?

@vusters
Copy link
Contributor

vusters commented Dec 1, 2023

Here's how you can resolve the race condition:

  • in NotificationManager, have init() returns the initial message.
  • in main, await for the NotificationManager's init() and retreieve this initial message.
  • if the messge has screenId/screenName, pass them into EnsembleApp.

This will ensure the 1st scren you load will be the screenId/screenName you have.

@vinothvino42
Copy link
Collaborator Author

are you missing some files? You are removing the logic to execute callbacks but added somewhere else?

I added it in the screen widget, it's because the ensemble_app fetches the definition and then only it renders the widget. So I just added it in the screen widget, here the material app is already initialized with the definition.

@vinothvino42
Copy link
Collaborator Author

vinothvino42 commented Dec 4, 2023

Here's how you can resolve the race condition:

  • in NotificationManager, have init() returns the initial message.
  • in main, await for the NotificationManager's init() and retreieve this initial message.
  • if the messge has screenId/screenName, pass them into EnsembleApp.

This will ensure the 1st scren you load will be the screenId/screenName you have.

I updated the Firebase getInitialMessage and updated the client's main.dart to initialize the app with screen id or name when the app launched from the push notification in the terminated state

@vusters vusters self-requested a review December 7, 2023 05:32
@vinothvino42
Copy link
Collaborator Author

@vusters I'll merge this PR

@vinothvino42 vinothvino42 changed the title WIP: Add getInitialMessage method for handling push notification in Terminated App State Add getInitialMessage method for handling push notification in Terminated App State Dec 7, 2023
@vinothvino42 vinothvino42 merged commit 038e9a7 into main Dec 7, 2023
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants