|
var myDate = new Date();
var tencentPush = api.require('tencentPush');
var params = {
title : "title", // 标题
content : "test content", // 内容
date : "20150807", // 日期
hour : myDate.getHours(), // 时间
min : myDate.getMinutes() + 1, // 分钟
customContent : "{\"key\":\"value\"}", // 自定义key-value
activity : "", // 打开的activity
ring : 1, // 是否响铃
vibrate : 1 // 是否振动
};
alert(JSON.stringify(params));
var resultCallback = function(ret, err) {
alert("添加本地通知: " + JSON.stringify(ret) + "\nerr: " + JSON.stringify(err));
if (ret.status) {
alert("添加通知成功,通知id:" + ret.notiId);
} else {
alert("添加本地通知失败,错误码:" + err.code + ",错误信息:" + err.msg);
}
};
tencentPush.addlocalNotification(params, resultCallback);
|
|