使用离子电容器和Framework7设置本地通知

问题描述 投票:0回答:1

我正在为应用程序使用Ionic Capacitor和Framework7。我想使用电容器本地通知插件来实现本地通知。但是,它给了我未捕获的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
        }]
    });

未捕获的ReferenceError:未定义LocalNotifications

javascript html-framework-7 capacitor
1个回答
0
投票

尝试像Plugins一样导入import { Plugins } from '@capacitor/core';

© www.soinside.com 2019 - 2024. All rights reserved.