Skip to content

[question]: Run OneSignal in parallel with expo-notificationsΒ #177

@dgsunesen

Description

@dgsunesen

How can we help?

So I'm experiencing some issues with OneSignal (onesignal-expo-plugin) and expo-notifications running in parallel. Ever since I installed and enabled OneSignal in my app, all listeners for handling user interactions on push notifications are not working anymore. For instance, a user sents another user a message, we send a push notification (using expo-server-sdk), the recipient taps the notification and is send directly to the chat.

To achieve this, I would do something like Notifications.addNotificationResponseReceivedListener(listener) with expo-notifications. Unfortunately, ever since OneSignal was enabled, this is not working. Stuff like requesting permission is working just as before, only listeners seems to be broken.

On the other hand, if I listen for push notifications send with OneSignal, I'm able to react to those using the below example:

OneSignal.setNotificationOpenedHandler(openedEvent => {
  console.log("OneSignal: notification opened:", openedEvent);
  const { action, notification } = openedEvent;
});

Isn't it possible to have both running at the same time?

OneSignal Expo SDK version

1.3.1

Platform

No response

Relevant log output

No response

Code of Conduct

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions