如何解决使用 detox 打开本地通知时出错
我正在尝试使用 detox 打开模拟本地通知,但出现错误。
我的代码:
it('Notif',async () => {
const localNotification = {
trigger: {
type: 'push',},title: 'From push',body: 'Body',action: 'IDEAS',payload: {
title: 'From push',action: 'PROFILE',};
await device.sendUserNotification(localNotification);
// await device.launchApp({
// newInstance: true,// userNotification: localNotification,// });
});
测试失败并出现以下错误:
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
代码中的注释部分也没有按预期工作,应该通过通知参数打开应用程序,但这里没有发生。另外我不知道这个问题是否是由于一些原生 android 错误引起的..?
任何人都可以帮助...!
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。