我阅读了许多有关状态栏通知的博客和 Stackoverflow 线程,并且大多数博客都使用插件 https://github.com/phonegap/phonegap-plugins/tree/master/Android/StatusBarNotification
但这会产生 404 错误。我没有找到任何其他有效的插件来执行此操作。
我需要让以下代码正常工作。我需要使用什么插件?
window.plugins.statusBarNotification.notify("Notification", "Registered with Server");
谢谢
最佳答案
我使用以下插件和代码 fragment 解决了我的问题。
de.appplant.cordova.plugin.local-notification
cordova.plugins.notification.local.schedule({
id: 1,
title: "Production Jour fixe",
text: "Duration 1h",
firstAt: monday_9_am,
every: "week",
sound: "file://sounds/reminder.mp3",
icon: "http://icons.com/?cal_id=1",
data: { meetingId:"123#fg8" }
});
cordova.plugins.notification.local.on("click", function (notification) {
joinMeeting(notification.data.meetingId);
});
谢谢。
关于android - 如何使用 Cordova 显示状态栏通知 - Android 和 IOS,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40606071/