zoukankan      html  css  js  c++  java
  • cordova local notification plugin

    cordova plugin add org.apache.cordova.device
    cordova plugin add https://github.com/katzer/cordova-plugin-local-notifications.git && cordova prepare

    1.

    需要上面的两个插件 安装插件
    在deviceready 设备准备好了调用插件的方法:
    notification.local.add
    notification.local.cancel
    notification.local.cancelAll
    notification.local.isScheduled
    notification.local.getScheduledIds
    notification.local.isTriggered
    notification.local.getDefaults
    notification.local.setDefaults
    notification.local.onadd
    notification.local.ontrigger
    notification.local.onclick
    notification.local.oncancel
    2.具体如下:

    document.addEventListener('deviceready', function () {
        // window.plugin.notification.local is now available
            var now = new Date().getTime();
        _60_seconds_from_now = new Date(now + 60 * 1000);
        window.plugin.notification.local.add({
            id: 1,
            title: 'Reminder',
            message: 'Dont forget to buy some flowers.',
            badge: 1,
            autoCancel: true,
            date: _60_seconds_from_now
        });
           window.plugin.notification.local.onclick = function(id, state, json) {
    
            window.plugin.notification.local.cancelAll();
    
        };
    }, false);
    

      

  • 相关阅读:
    [hdu4436 str2int]后缀自动机SAM(或后缀数组SA)
    bytedance专题
    LSTM+CRF维特比解码过程
    spark core类梳理
    spark源码阅读---Utils.getCallSite
    python2.7官方文档阅读笔记
    cs224d---词向量表示
    cs231n---强化学习
    cs231n---生成模型
    Spring 2017 Assignments3
  • 原文地址:https://www.cnblogs.com/xieyier/p/4090240.html
Copyright © 2011-2022 走看看