簡體   English   中英

Phonegap本地通知不執行任何操作

[英]Phonegap Local notification doesn't do anything

我目前正在嘗試使用此插件

我的問題是我做了所有從Google獲得的分步說明,但沒有一個起作用。

此步驟有問題嗎:

  • 使用CLI安裝插件
  • 嘗試過將它放在index.html里面的最簡單的示例之一

碼:

function onDeviceReady() {
    window.plugin.notification.local.add({ message: 'Great app!' });
}

我正在使用相同的插件,最后我檢查了是否沒有“ .add”方法。 嘗試“ .schedule”

嘗試:

cordova.plugins.notification.local.schedule({
title: "New Message",
message: "Hi, are you ready? We are waiting.",
sound: "file://sounds/message.mp3",
icon: "http://my.domain.de/avatar/user#id=123"
});

https://github.com/katzer/cordova-plugin-local-notifications/wiki/04.-Scheduling

我正在使用此插件,它工作正常。 您可以嘗試:

cordova.plugins.notification.local.schedule({
    id: 1,
    title: "Customer Calling",
    icon: "http://b2bvn.nsbg.foxconn.com:8080/taxi/call.png",
    text: "You have a registration from customer"
});

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM