增加unipush2.0 云服务器,暂时无用之后集成到java中,只是配置需要
This commit is contained in:
32
uniCloud-aliyun/cloudfunctions/testUnipush2/index.js
Normal file
32
uniCloud-aliyun/cloudfunctions/testUnipush2/index.js
Normal file
@@ -0,0 +1,32 @@
|
||||
// 'use strict';
|
||||
// exports.main = async (event, context) => {
|
||||
// //event为客户端上传的参数
|
||||
// console.log('event : ', event)
|
||||
|
||||
// //返回数据给客户端
|
||||
// return event
|
||||
// };
|
||||
|
||||
|
||||
// 简单的使用示例
|
||||
'use strict';
|
||||
const uniPush = uniCloud.getPushManager({appId:"__UNI__4C459F4"}) //注意这里需要传入你的应用appId
|
||||
exports.main = async (event, context) => {
|
||||
//event为客户端上传的参数
|
||||
console.log('event : ', event)
|
||||
return await uniPush.sendMessage({
|
||||
"push_clientid": "xxx", //填写上一步在uni-app客户端获取到的客户端推送标识push_clientid
|
||||
"force_notification":true, //填写true,客户端就会对在线消息自动创建“通知栏消息”。
|
||||
"title": "通知栏显示的标题",
|
||||
"content": "通知栏显示的内容",
|
||||
"payload": {
|
||||
"text":"体验一下uni-push2.0"
|
||||
}
|
||||
"options":{
|
||||
"HW": {
|
||||
// 1 表示华为测试消息,华为每个应用每日可发送该测试消息500条,此target_user_type 参数请勿发布至线上。
|
||||
"/message/android/target_user_type":1
|
||||
}
|
||||
}
|
||||
})
|
||||
};
|
||||
7
uniCloud-aliyun/cloudfunctions/testUnipush2/package.json
Normal file
7
uniCloud-aliyun/cloudfunctions/testUnipush2/package.json
Normal file
@@ -0,0 +1,7 @@
|
||||
{
|
||||
"name": "testUnipush2",
|
||||
"dependencies": {},
|
||||
"extensions": {
|
||||
"uni-cloud-push": {}
|
||||
}
|
||||
}
|
||||
12
uniCloud-aliyun/database/JQL查询.jql
Normal file
12
uniCloud-aliyun/database/JQL查询.jql
Normal file
@@ -0,0 +1,12 @@
|
||||
// 本文件用于,使用JQL语法操作项目关联的uniCloud空间的数据库,方便开发调试和远程数据库管理
|
||||
// 编写clientDB的js API(也支持常规js语法,比如var),可以对云数据库进行增删改查操作。不支持uniCloud-db组件写法
|
||||
// 可以全部运行,也可以选中部分代码运行。点击工具栏上的运行按钮或者按下【F5】键运行代码
|
||||
// 如果文档中存在多条JQL语句,只有最后一条语句生效
|
||||
// 如果混写了普通js,最后一条语句需是数据库操作语句
|
||||
// 此处代码运行不受DB Schema的权限控制,移植代码到实际业务中注意在schema中配好permission
|
||||
// 不支持clientDB的action
|
||||
// 数据库查询有最大返回条数限制,详见:https://uniapp.dcloud.net.cn/uniCloud/cf-database.html#limit
|
||||
// 详细JQL语法,请参考:https://uniapp.dcloud.net.cn/uniCloud/jql.html
|
||||
|
||||
// 下面示例查询uni-id-users表的所有数据
|
||||
db.collection('uni-id-users').get();
|
||||
Reference in New Issue
Block a user