-
Notifications
You must be signed in to change notification settings - Fork 149
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 missing onBackgroundPushReceived method #426
Closed
MaximBelov
wants to merge
3
commits into
urbanairship:main
from
MaximBelov:handle-notification-from-cold-start
Closed
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is only different on Android because on the other frameworks you have to do some special hoops to get background push working. On cordova I am not sure I see a point of separating them. What if we have both
airship.event.background_push_received
andairship.event.push_received
go to the same listener?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
depending on the state of the application in the background only one will work
I added listeners for events
airship.event.push_received
- foreground, ios and androidairship.event.notification_response
- background, ios onlyairship.event.background_push_received
- background android only - background or cold startmy initial testing with positive results
it works correctly without any problems
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But do you need it separated? The event map, I think we can just map the background event to airship.event.push_received on Android to have a single onPushReceived. I am not sure if there is a reason to have it broken out on Android.
I might need to modify the proxy to put them all under the same event queue that way the events stay in order https://github.com/urbanairship/airship-mobile-framework-proxy/blob/main/android/airship-framework-proxy/src/main/java/com/urbanairship/android/framework/proxy/events/EventEmitter.kt#L21
I am thinking ill add a config flag to the proxy to treat all push received as the same thing on Android then we can ignore the
background_push_received
events.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we can combine this into one event listener, but we must add new properties to the response to understand exactly what type of event received and where it came from
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You need this exposed in the app?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like you will get a foreground on the response but not currently the push received event. We could add it though
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Adds isForeground and orders events - urbanairship/airship-mobile-framework-proxy#39
Going to open a new PR that combines pushReceived and notificationResponses into the same listener