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

Fix sending tags when rejecting the push permission prompt #1037

Merged
merged 1 commit into from
Jan 13, 2022

Conversation

emawby
Copy link
Contributor

@emawby emawby commented Jan 3, 2022

Description

One Line Summary

Checking for a playerId before trying to sendTagsOnBackground

Details

When the push prompt is displayed the application background lifecycle method is called. This results in trying to sendTagsOnBackground but we may not have a playerId yet. This adds a check for playerId so that we don't erroneously try to send tags without a playerId

Motivation

This PR fixes a customer reported issue regarding sending tags when the push prompt is declined

Testing

Manual testing

I have tested on multiple example apps on my iPhone

Affected code checklist

  • Notifications
    • Display
    • Open
    • Push Processing
    • Confirm Deliveries
  • Outcomes
  • Sessions
  • In-App Messaging
  • REST API requests
  • Public API changes
  • Distribution
  • Tags

Checklist

Overview

  • I have filled out all REQUIRED sections above
  • PR does one thing
  • Any Public API changes are explained in the PR details and conform to existing APIs

Testing

  • I have included test coverage for these changes, or explained why they are not needed
  • All automated tests pass, or I explained why that is not possible
  • I have personally tested this on my device, or explained why that is not possible

Final pass

  • Code is as readable as possible.
  • I have reviewed this PR myself, ensuring it meets each checklist item

This change is Reviewable

When the push prompt is displayed the application background lifecycle method is called. This results in trying to sendTagsOnBackground but we may not have a playerId yet. This adds a check for playerId so that we don't erroneously try to send tags without a playerId
@emawby emawby requested review from jkasten2 and nan-li January 3, 2022 17:51
@nan-li
Copy link
Contributor

nan-li commented Jan 4, 2022

How do the tags end up being sent for users who decline push permission?

@emawby
Copy link
Contributor Author

emawby commented Jan 10, 2022

How do the tags end up being sent for users who decline push permission?

Previously we were trying to send the tag before the user responded to the prompt and it wouldn't try to send it when the player is created. Now it won't try to send it before the user responds to the prompt so the tags will be sent when the player is created after the prompt is responded to. We create the player regardless of the whether or not the user accepts or denies the prompt

Copy link
Member

@jkasten2 jkasten2 left a comment

Choose a reason for hiding this comment

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

:lgtm:

Reviewed 1 of 1 files at r1, all commit messages.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on @emawby)

@emawby emawby merged commit 08df561 into main Jan 13, 2022
@emawby emawby deleted the fix/sendTags_With_Rejected_PushPermission branch January 13, 2022 20:32
@emawby emawby mentioned this pull request Feb 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants