简体   繁体   中英

Phonegap Local notification doesn't do anything

I'm currently trying to use this plugin

My problem was I did all the step by step instructions I got from Google but none of them works.

Is there something wrong with this steps:

  • install plugin using CLI
  • tried the one of the simplest sample I placed it on index.html inside

code:

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

I am using the same plugin, last I checked there was no ".add" method. Try ".schedule"

Try:

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

I am using this plugin and it works fine. You could try:

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"
});

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM