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): correctly set foreground flag when forceShow is enabled #338

Merged
merged 1 commit into from
Dec 26, 2024

Conversation

erisu
Copy link

@erisu erisu commented Dec 25, 2024

Motivation and Context

Fix an issue where the notification event payload's property additionalData.foreground is incorrectly set when the app is in the foreground and the forceShow option is enabled.

Description

  • Renamed the internal variable isInline to isForeground.
  • Corrected the setting of isForeground in didReceiveNotificationResponse when the application state was UIApplicationStateActive. This should have been and is now set to YES.
  • Explicitly define and set the isForeground to NO in the didReceiveNotificationResponse method when the application state is UIApplicationStateInactive.

Related Issue

n/a

How Has This Been Tested?

Built an application and tested the following:

foreShow = true Test Case:

  • AppState: Foreground
    • payload.additionalData.foreground = true
    • payload.additionalData.coldstart = false
  • AppState: Background
    • payload.additionalData.foreground = false
    • payload.additionalData.coldstart = true
  • AppState: Inactive
    • payload.additionalData.foreground = false
    • payload.additionalData.coldstart = true

foreShow = false Test Case:

  • AppState: Foreground
    • payload.additionalData.foreground = true
    • payload.additionalData.coldstart = false
  • AppState: Background
    • payload.additionalData.foreground = false
    • payload.additionalData.coldstart = true
  • AppState: Inactive
    • payload.additionalData.foreground = false
    • payload.additionalData.coldstart = true

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 merged commit 779fe06 into master Dec 26, 2024
7 checks passed
@erisu erisu deleted the fix/foreground-flag-on-force-show branch December 26, 2024 01:31
Copy link

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 17, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant