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

[notifications][android] Add sticky property to notifications #9351

Merged
merged 4 commits into from
Jul 24, 2020
Merged

[notifications][android] Add sticky property to notifications #9351

merged 4 commits into from
Jul 24, 2020

Conversation

barthap
Copy link
Contributor

@barthap barthap commented Jul 22, 2020

Why

Implements changes proposed in #9302.

Current Notifications API provides autoDismiss property, which directly corresponds to autoCancel on Android - it specifies if notification can be dismissed by tapping it, however it can be dismissed by swipe. Android API can also set notification as ongoing - it can be dismissed by tapping, but not by swiping.

Expo legacy notification API had this property available, but it was replaced with autoDismiss in the new API.

How

Added sticky property to NotificationContentInput interface, used by local notifications. On native side - added it to NotificationContent.Builder where needed and connected it with Android's setOngoing().

Test Plan

  • Test local notifications
  • Test FCM push notifications*

* Note: Push notifications JSON payload doesn't contain sticky and autoDismiss properties, however JSONNotificationContentBuilder is handling them correctly - default values are set.

Copy link
Contributor

@lukmccall lukmccall left a comment

Choose a reason for hiding this comment

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

LGTM 🎉🎉🎉

@barthap barthap marked this pull request as ready for review July 24, 2020 06:00
Copy link
Contributor

@mczernek mczernek left a comment

Choose a reason for hiding this comment

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

Solid work!

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