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(ios): forceShow to display toast but trigger event until tapped #332

Merged
merged 2 commits into from
Dec 17, 2024

Conversation

erisu
Copy link

@erisu erisu commented Dec 17, 2024

Motivation and Context

I believe the purpose of implementing forceShow on iOS was to provide the same feature and functionality that already exists on Android. The behavior of the feature should have been identical.

The goal of this PR is to correct the behavior of forceShow so that it aligns with Android.

Original ticket and PR references: #107, #276

While the changes might seem breaking, the original intent of the implementation was not fulfilled. This update will be included in the next patch release, as the current behavior is unintended and buggy.

Description

When the app is in the foreground and forceShow is true, the notification toast should appear in the notification drawer. The on('notification') event should be triggered only when the user taps or clicks on the notification toast.

The iOS documentation has been updated to align with Android's behavior. A comment stating that the UNNotificationDefaultActionIdentifier event is called when the notification is clicked has been removed as this does not follow Android's behavior.

Related Issue

n/a

How Has This Been Tested?

  • Set forceShow as true
  • Built app
  • Pushed payload in all three states (Foreground, Background, Inactive)
  • Confirmed that toast appears in all three states.
  • Confirmed that the notification event was triggered after the toast was tapped.

Screenshots (if appropriate):

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

@erisu erisu force-pushed the fix/ios-forceShow branch from 10868b2 to 4cef25a Compare December 17, 2024 03:16
@erisu erisu added bug Something isn't working ios Related to the iOS platform labels Dec 17, 2024
@erisu erisu added this to the 5.0.3 milestone Dec 17, 2024
@erisu erisu merged commit a1bcaf1 into master Dec 17, 2024
7 checks passed
@erisu erisu deleted the fix/ios-forceShow branch December 17, 2024 12:50
Copy link

github-actions bot commented Jan 8, 2025

This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jan 8, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working ios Related to the iOS platform
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant