How do we test expo push notifications with detox?

Please provide the following:

  1. SDK Version: 47.0.13
  2. Platforms(Android/iOS/web/all): Android

Is it possible to test expo push notifications with detox end-to-end tests?

As far as I understand the detox documentation it is possible to simulate push notifications by simply sending an Android intent. I also understood, that push notifications don’t work on an emulator, but I would guess it can still receive android intents. However, when I try to follow the detox docs I always receive following error

Test Failed: No Activity found to handle Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x24000000 pkg=com.campusmeet (has extras) }

Therefore I am confused, if I fundamentally misunderstood something, or what I’m doing wrong here.

My test code looks like this:

const notification = {
  payload: {
    event: "newMessage",
    content: {
      id: "new-message-id",
      chatId: id,
      from: "test-chat@mail.com",
      message: "ping pong ping pong",
      date: Date.now(),
    },
  },
};
await device.sendUserNotification(notification);

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.