I am trying to open a mock local notification using detox, but getting an error.
My code:
it('Notif', async () => {
const localNotification = {
trigger: {
type: 'push',
},
title: 'From push',
body: 'Body',
action: 'IDEAS',
payload: {
title: 'From push',
body: 'Body',
action: 'PROFILE',
},
};
await device.sendUserNotification(localNotification);
// await device.launchApp({
// newInstance: true,
// userNotification: localNotification,
// });
});
The test fails with the following error:
Test Failed: No Activity found to handle Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x24000000 pkg=com.detoxproj2 (has extras) }
detox[17158] ERROR: [cli.js] Error: Command failed: jest --config e2e/config.json --testNamePattern '^((?!:ios:).)*$' --maxWorkers 1 e2e
The commented part in the code also doesn't work as expected, It should open the app through the notification parameters, but it doesn't happen here. Also i don't know if the issue is due to some native android error or so..?
Anyone help...!