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): update notification event logic #301

Draft
wants to merge 1 commit into
base: feat/use-cdvappdelegate
Choose a base branch
from

Conversation

erisu
Copy link

@erisu erisu commented Nov 12, 2024

Requires #300 to be merged first

Description

Updated didReceiveNotificationResponse:

  • Removed setting of actionCallback to response.actionIdentifier.
  • Removed logic in the UIApplicationStateInactive state that decided whether to set the launch notification to the modified or unmodified userInfo containing the response.actionIdentifier on actionCallback.
  • Added applicationState to userInfo, which is later used to decide whether actionCallback will be removed from the payload sent to the front end. See notificationReceived for reference.
  • Since applicationState is now appended to userInfo, we can pass it up to the front on the notification event.
    • Note: I am currently removing it from the payload before returning, as we should confirm whether we can match this behavior on Android.

Updated notificationReceived method:

  • Removed actionCallback from the payload when the application state is inactive or background. Removing it in these states aligns the behavior with Android.

Related Issue

Resolves #296
Closes #186
Resolves #67

Motivation and Context

Try to match the same behavior with Android

How Has This Been Tested?

Pushed two types of APNs payloads:

  1. Payload without actionCallback
  2. Payload with actionCallback

Tested the following cases:

  • App in active (foreground) state.
  • App in background state.
  • App in inactive (closed) state.

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 marked this pull request as draft November 12, 2024 17:00
@erisu erisu added this to the 5.0.0 milestone Nov 13, 2024
@erisu erisu added the ios iOS Platform label Nov 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ios iOS Platform
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant