我正在将 ionic 电容器和 Framework7 用于应用程序。我想使用电容器本地通知插件来实现本地通知。但是它给了我 Uncaught ReferenceError :LocalNotifications未定义
//Importing plugin
import {Plugins} from '../node_modules/@capacitor/core';
const {LocalNotifications} = Plugins;
//Schedule Local Notifcations
LocalNotifications.schedule({
notifications: [{
title: "Title",
body: "Body",
id: 1,
schedule: {
at: new Date(Date.now() + 1000 * 5)
},
sound: 'res://audio/android/iphone_6.mp3',
attachments: null,
actionTypeId: "",
extra: null
}]
});
Uncaught ReferenceError :LocalNotifications 未定义
最佳答案
尝试导入 Plugins
,例如 import { Plugins } from '@capacitor/core';
关于javascript - 使用 ionic 电容器和 Framework7 设置本地通知,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57704584/