Skip to content

[Bug]: Onesignal does not show notification when app in foreground android #1670

Description

@AFDHAL2009

What happened?

Hello, i have issue when app in foreground the notif come by silienty , i have installed latest version 5.1.0,but in background works fine .notif come with sound ,
I dont know if this feature is deleted from this version or no,Note that 4.5.2 works fine .(foreground et backaground)
image

 OneSignal.Notifications.requestPermission(true);
  // Method for listening for notification clicks
  OneSignal.Notifications.addEventListener('click', event => {
    console.log('OneSignal: notification clicked:', event);
  });
  OneSignal.Notifications.addEventListener('foregroundWillDisplay', event => {
    console.log('OneSignal: notification foreground:', event);
  });

Steps to reproduce?

1.Install version 5.1.0

What did you expect to happen?

there is no information as notification coming only bye console

React Native OneSignal SDK version

0.70.6

Which platform(s) are affected?

  • iOS
  • Android

Relevant log output

OneSignal: notification foreground: {"notification": {"actionButtons": undefined, "additionalData": undefined, "androidNotificationId": 1751867923, "bigPicture": undefined, "body": "jhjh", "collapseId": undefined, "fromProjectNumber": "799121433974", "groupKey": undefined, "groupMessage": undefined, "largeIcon": undefined, "launchURL": undefined, "ledColor": undefined, "lockScreenVisibility": 1, "notificationId": "1801dfec-3583-4000-a290-586f0cc26613", "priority": 5, "rawPayload": "{\"google.delivered_priority\":\"normal\",\"google.sent_time\":1711023883965,\"google.ttl\":259200,\"google.original_priority\":\"normal\",\"custom\":\"{\\\"a\\\":{},\\\"i\\\":\\\"1801dfec-3583-4000-a290-586f0cc26613\\\"}\",\"pri\":\"5\",\"vis\":\"1\",\"from\":\"799121433974\",\"alert\":\"jhjh\",\"title\":\"vh\",\"google.message_id\":\"0:1711023884002345%6cef8906f9fd7ecd\",\"google.c.sender.id\":\"799121433974\"}", "smallIcon": undefined, "smallIconAccentColor": undefined, "sound": undefined, "title": "vh"}}

Code of Conduct

  • I agree to follow this project's Code of Conduct

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions