feat:修改push通知配置
This commit is contained in:
parent
b2c044a282
commit
347f39c570
334
frontend/App.vue
334
frontend/App.vue
@ -1,117 +1,255 @@
|
|||||||
<script>
|
<script>
|
||||||
import { getGlobalSocket } from '@/utils/socket'
|
import { getGlobalSocket } from "@/utils/socket";
|
||||||
import { emitAppReturnFromBackground } from '@/utils/backgroundRefreshBus.js'
|
import { emitAppReturnFromBackground } from "@/utils/backgroundRefreshBus.js";
|
||||||
|
|
||||||
// 记录上次隐藏时间的 storage key
|
// 记录上次隐藏时间的 storage key
|
||||||
const HIDE_TIME_KEY = 'app_last_hide_time'
|
const HIDE_TIME_KEY = "app_last_hide_time";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
onLaunch: function() {
|
onLaunch: function () {
|
||||||
console.log('App Launch')
|
console.log("App Launch");
|
||||||
// 不在这里初始化 AI Chat 连接,由各页面自行管理
|
// 不在这里初始化 AI Chat 连接,由各页面自行管理
|
||||||
},
|
this.setPermissions();
|
||||||
onShow: function() {
|
},
|
||||||
console.log('App Show')
|
onShow: function () {
|
||||||
this.handleBackgroundReturn()
|
console.log("App Show");
|
||||||
},
|
this.handleBackgroundReturn();
|
||||||
onHide: function() {
|
|
||||||
console.log('App Hide')
|
this.getAllNotice();
|
||||||
// 关闭所有 WebSocket 连接
|
},
|
||||||
this.closeWebSocket()
|
onHide: function () {
|
||||||
// 记录切到后台的时间,用于 onShow 时判断是否"从后台返回"
|
console.log("App Hide");
|
||||||
uni.setStorageSync(HIDE_TIME_KEY, Date.now())
|
// 关闭所有 WebSocket 连接
|
||||||
},
|
this.closeWebSocket();
|
||||||
methods: {
|
// 记录切到后台的时间,用于 onShow 时判断是否"从后台返回"
|
||||||
initWebSocket() {
|
uni.setStorageSync(HIDE_TIME_KEY, Date.now());
|
||||||
const token = uni.getStorageSync('access_token')
|
|
||||||
if (token) {
|
// 应用进入后台时创建本地通知
|
||||||
console.log('初始化全局 WebSocket 连接')
|
this.getAllNotice();
|
||||||
const globalSocket = getGlobalSocket()
|
},
|
||||||
globalSocket.init(token)
|
methods: {
|
||||||
}
|
initWebSocket() {
|
||||||
},
|
const token = uni.getStorageSync("access_token");
|
||||||
closeWebSocket() {
|
if (token) {
|
||||||
console.log('关闭全局 WebSocket 连接')
|
console.log("初始化全局 WebSocket 连接");
|
||||||
const globalSocket = getGlobalSocket()
|
const globalSocket = getGlobalSocket();
|
||||||
globalSocket.closeAll()
|
globalSocket.init(token);
|
||||||
},
|
}
|
||||||
/**
|
},
|
||||||
* 处理"从后台切回前台"事件
|
closeWebSocket() {
|
||||||
* 通过 storage 中的上次隐藏时间判断本次 onShow 是否由后台返回触发
|
console.log("关闭全局 WebSocket 连接");
|
||||||
* 若是,则通知所有订阅了 useBackgroundRefresh 的页面执行刷新
|
const globalSocket = getGlobalSocket();
|
||||||
*/
|
globalSocket.closeAll();
|
||||||
handleBackgroundReturn() {
|
},
|
||||||
const lastHide = uni.getStorageSync(HIDE_TIME_KEY) || 0
|
/**
|
||||||
if (!lastHide) return
|
* 处理"从后台切回前台"事件
|
||||||
// 清理标记,避免下次普通 onShow(如首次启动)误触发
|
* 通过 storage 中的上次隐藏时间判断本次 onShow 是否由后台返回触发
|
||||||
uni.removeStorageSync(HIDE_TIME_KEY)
|
* 若是,则通知所有订阅了 useBackgroundRefresh 的页面执行刷新
|
||||||
// 时间异常保护
|
*/
|
||||||
if (Date.now() - lastHide < 0) return
|
handleBackgroundReturn() {
|
||||||
emitAppReturnFromBackground()
|
const lastHide = uni.getStorageSync(HIDE_TIME_KEY) || 0;
|
||||||
}
|
if (!lastHide) return;
|
||||||
}
|
// 清理标记,避免下次普通 onShow(如首次启动)误触发
|
||||||
}
|
uni.removeStorageSync(HIDE_TIME_KEY);
|
||||||
|
// 时间异常保护
|
||||||
|
if (Date.now() - lastHide < 0) return;
|
||||||
|
emitAppReturnFromBackground();
|
||||||
|
},
|
||||||
|
// 获取消息列表,刚进页面时,在钩子内触发
|
||||||
|
getAllNotice() {
|
||||||
|
// 1 获取客户端推送标识信息 cid , 必须要获取到cid后才能接收推送信息
|
||||||
|
uni.getPushClientId({
|
||||||
|
success: (res) => {
|
||||||
|
// 将获取到的cid存起来,方便其它页面从缓存中获取
|
||||||
|
uni.setStorageSync("cid", res.cid);
|
||||||
|
console.log("客户端推送标识:", res.cid);
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
// 2 启动监听推送消息事件
|
||||||
|
uni.onPushMessage((res) => {
|
||||||
|
const { type, data } = res;
|
||||||
|
if (type == "click") {
|
||||||
|
console.log('"click"-从系统推送服务点击消息启动应用事件;', res);
|
||||||
|
if (!data?.payload?.url) {
|
||||||
|
console.log(data)
|
||||||
|
uni.reLaunch({
|
||||||
|
// url: "/pagesA/index/index",
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
setTimeout(() => {
|
||||||
|
uni.navigateTo({
|
||||||
|
url: data.payload.url,
|
||||||
|
});
|
||||||
|
}, 1000);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (type == "receive") {
|
||||||
|
console.log('"receive"-应用从推送服务器接收到推送消息事件', res);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
|
||||||
|
setPermissions() {
|
||||||
|
// #ifdef APP-PLUS
|
||||||
|
if (plus.os.name == "Android") {
|
||||||
|
// 判断是Android
|
||||||
|
var main = plus.android.runtimeMainActivity();
|
||||||
|
var pkName = main.getPackageName();
|
||||||
|
var uid = main.getApplicationInfo().plusGetAttribute("uid");
|
||||||
|
var NotificationManagerCompat = plus.android.importClass(
|
||||||
|
"android.support.v4.app.NotificationManagerCompat",
|
||||||
|
);
|
||||||
|
//android.support.v4升级为androidx
|
||||||
|
if (NotificationManagerCompat == null) {
|
||||||
|
NotificationManagerCompat = plus.android.importClass(
|
||||||
|
"androidx.core.app.NotificationManagerCompat",
|
||||||
|
);
|
||||||
|
}
|
||||||
|
var areNotificationsEnabled =
|
||||||
|
NotificationManagerCompat.from(main).areNotificationsEnabled();
|
||||||
|
// 未开通‘允许通知’权限,则弹窗提醒开通,并点击确认后,跳转到系统设置页面进行设置
|
||||||
|
if (!areNotificationsEnabled) {
|
||||||
|
uni.showModal({
|
||||||
|
title: "通知权限开启提醒",
|
||||||
|
content: "您还没有开启通知权限,无法接受到消息通知,请前往设置!",
|
||||||
|
showCancel: false,
|
||||||
|
confirmText: "去设置",
|
||||||
|
success: function (res) {
|
||||||
|
if (res.confirm) {
|
||||||
|
var Intent = plus.android.importClass("android.content.Intent");
|
||||||
|
var Build = plus.android.importClass("android.os.Build");
|
||||||
|
//android 8.0引导
|
||||||
|
if (Build.VERSION.SDK_INT >= 26) {
|
||||||
|
var intent = new Intent(
|
||||||
|
"android.settings.APP_NOTIFICATION_SETTINGS",
|
||||||
|
);
|
||||||
|
intent.putExtra("android.provider.extra.APP_PACKAGE", pkName);
|
||||||
|
} else if (Build.VERSION.SDK_INT >= 21) {
|
||||||
|
//android 5.0-7.0
|
||||||
|
var intent = new Intent(
|
||||||
|
"android.settings.APP_NOTIFICATION_SETTINGS",
|
||||||
|
);
|
||||||
|
intent.putExtra("app_package", pkName);
|
||||||
|
intent.putExtra("app_uid", uid);
|
||||||
|
} else {
|
||||||
|
//(<21)其他--跳转到该应用管理的详情页
|
||||||
|
intent.setAction(
|
||||||
|
Settings.ACTION_APPLICATION_DETAILS_SETTINGS,
|
||||||
|
);
|
||||||
|
var uri = Uri.fromParts(
|
||||||
|
"package",
|
||||||
|
mainActivity.getPackageName(),
|
||||||
|
null,
|
||||||
|
);
|
||||||
|
intent.setData(uri);
|
||||||
|
}
|
||||||
|
// 跳转到该应用的系统通知设置页
|
||||||
|
main.startActivity(intent);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
});
|
||||||
|
}
|
||||||
|
} else if (plus.os.name == "iOS") {
|
||||||
|
// 判断是ISO
|
||||||
|
var isOn = undefined;
|
||||||
|
var types = 0;
|
||||||
|
var app = plus.ios.invoke("UIApplication", "sharedApplication");
|
||||||
|
var settings = plus.ios.invoke(app, "currentUserNotificationSettings");
|
||||||
|
if (settings) {
|
||||||
|
types = settings.plusGetAttribute("types");
|
||||||
|
plus.ios.deleteObject(settings);
|
||||||
|
} else {
|
||||||
|
types = plus.ios.invoke(app, "enabledRemoteNotificationTypes");
|
||||||
|
}
|
||||||
|
plus.ios.deleteObject(app);
|
||||||
|
isOn = 0 != types;
|
||||||
|
if (isOn == false) {
|
||||||
|
uni.showModal({
|
||||||
|
title: "通知权限开启提醒",
|
||||||
|
content: "您还没有开启通知权限,无法接受到消息通知,请前往设置!",
|
||||||
|
showCancel: false,
|
||||||
|
confirmText: "去设置",
|
||||||
|
success: function (res) {
|
||||||
|
if (res.confirm) {
|
||||||
|
var app = plus.ios.invoke("UIApplication", "sharedApplication");
|
||||||
|
var setting = plus.ios.invoke(
|
||||||
|
"NSURL",
|
||||||
|
"URLWithString:",
|
||||||
|
"app-settings:",
|
||||||
|
);
|
||||||
|
plus.ios.invoke(app, "openURL:", setting);
|
||||||
|
plus.ios.deleteObject(setting);
|
||||||
|
plus.ios.deleteObject(app);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// #endif
|
||||||
|
},
|
||||||
|
},
|
||||||
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<view class="app-container">
|
<view class="app-container"> </view>
|
||||||
</view>
|
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<style>
|
<style>
|
||||||
/*每个页面公共css */
|
/*每个页面公共css */
|
||||||
|
|
||||||
/* 引入 TheMiladiatorRegular 字体 */
|
/* 引入 TheMiladiatorRegular 字体 */
|
||||||
@font-face {
|
@font-face {
|
||||||
font-family: 'TheMiladiatorRegular';
|
font-family: "TheMiladiatorRegular";
|
||||||
src: url('/static/fonts/The Miladiator Regular.ttf') format('truetype');
|
src: url("/static/fonts/The Miladiator Regular.ttf") format("truetype");
|
||||||
font-weight: normal;
|
font-weight: normal;
|
||||||
font-style: normal;
|
font-style: normal;
|
||||||
font-display: swap;
|
font-display: swap;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* 引入 ZaoZiGongFangJianHei-1 字体 */
|
/* 引入 ZaoZiGongFangJianHei-1 字体 */
|
||||||
@font-face {
|
@font-face {
|
||||||
font-family: 'ZaoZiGongFangJianHei-1';
|
font-family: "ZaoZiGongFangJianHei-1";
|
||||||
src: url('/static/fonts/ZaoZiGongFangJianHei-1.ttf') format('truetype');
|
src: url("/static/fonts/ZaoZiGongFangJianHei-1.ttf") format("truetype");
|
||||||
font-weight: normal;
|
font-weight: normal;
|
||||||
font-style: normal;
|
font-style: normal;
|
||||||
font-display: swap;
|
font-display: swap;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* 引入 ZaoZiGongFangJianHei-1 字体 */
|
/* 引入 ZaoZiGongFangJianHei-1 字体 */
|
||||||
@font-face {
|
@font-face {
|
||||||
font-family: 'JDLTYuanTiJian';
|
font-family: "JDLTYuanTiJian";
|
||||||
src: url('/static/fonts/JDLTYuanTiJian.ttf') format('truetype');
|
src: url("/static/fonts/JDLTYuanTiJian.ttf") format("truetype");
|
||||||
font-weight: normal;
|
font-weight: normal;
|
||||||
font-style: normal;
|
font-style: normal;
|
||||||
font-display: swap;
|
font-display: swap;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* 圆体 JDLTYuanTiJian.ttf 在部分 Android WebView 上报 OTS/cmap 解析失败,暂不 @font-face 加载,避免控制台告警与渲染异常 */
|
/* 圆体 JDLTYuanTiJian.ttf 在部分 Android WebView 上报 OTS/cmap 解析失败,暂不 @font-face 加载,避免控制台告警与渲染异常 */
|
||||||
|
|
||||||
/* 全局字体设置 */
|
/* 全局字体设置 */
|
||||||
body {
|
body {
|
||||||
font-family:
|
font-family:
|
||||||
'JDLTYuanTiJian',
|
"JDLTYuanTiJian",
|
||||||
-apple-system,
|
-apple-system,
|
||||||
BlinkMacSystemFont,
|
BlinkMacSystemFont,
|
||||||
'PingFang SC',
|
"PingFang SC",
|
||||||
'Hiragino Sans GB',
|
"Hiragino Sans GB",
|
||||||
'Microsoft YaHei',
|
"Microsoft YaHei",
|
||||||
'Noto Sans SC',
|
"Noto Sans SC",
|
||||||
sans-serif;
|
sans-serif;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* App 容器 */
|
/* App 容器 */
|
||||||
.app-container {
|
.app-container {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
min-height: 100vh;
|
min-height: 100vh;
|
||||||
position: relative;
|
position: relative;
|
||||||
}
|
}
|
||||||
|
|
||||||
.page-content {
|
.page-content {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
min-height: 100vh;
|
min-height: 100vh;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@ -1,217 +1,217 @@
|
|||||||
{
|
{
|
||||||
"name" : "TopFans",
|
"name": "TopFans",
|
||||||
"appid" : "__UNI__F199FF4",
|
"appid": "__UNI__F199FF4",
|
||||||
"description" : "",
|
"description": "",
|
||||||
"versionName" : "1.0.5",
|
"versionName": "1.0.5",
|
||||||
"versionCode" : 114,
|
"versionCode": 114,
|
||||||
"transformPx" : false,
|
"transformPx": false,
|
||||||
/* 5+App特有相关 */
|
/* 5+App特有相关 */
|
||||||
"app-plus" : {
|
"app-plus": {
|
||||||
"usingComponents" : true,
|
"usingComponents": true,
|
||||||
"nvueStyleCompiler" : "uni-app",
|
"nvueStyleCompiler": "uni-app",
|
||||||
"compilerVersion" : 3,
|
"compilerVersion": 3,
|
||||||
"statusbar" : {
|
"statusbar": {
|
||||||
"immersed" : true
|
"immersed": true
|
||||||
},
|
},
|
||||||
"splashscreen" : {
|
"splashscreen": {
|
||||||
"alwaysShowBeforeRender" : true,
|
"alwaysShowBeforeRender": true,
|
||||||
"waiting" : true,
|
"waiting": true,
|
||||||
"autoclose" : true,
|
"autoclose": true,
|
||||||
"delay" : 0
|
"delay": 0
|
||||||
},
|
},
|
||||||
/* 模块配置 */
|
/* 模块配置 */
|
||||||
"modules" : {
|
"modules": {
|
||||||
"VideoPlayer" : {},
|
"VideoPlayer": {},
|
||||||
"Camera" : {},
|
"Camera": {},
|
||||||
"Speech" : {},
|
"Speech": {},
|
||||||
"Push" : {}
|
"Push": {}
|
||||||
},
|
},
|
||||||
"nativePlugins" : {
|
"nativePlugins": {
|
||||||
"imengyu-UniAndroidGyro" : {
|
"imengyu-UniAndroidGyro": {
|
||||||
"__plugin_info__" : {
|
"__plugin_info__": {
|
||||||
"name" : "imengyu-UniAndroidGyro",
|
"name": "imengyu-UniAndroidGyro",
|
||||||
"description" : "APP端陀螺仪数据采集",
|
"description": "APP端陀螺仪数据采集",
|
||||||
"platforms" : "Android,iOS",
|
"platforms": "Android,iOS",
|
||||||
"url" : "",
|
"url": "",
|
||||||
"android_package_name" : "",
|
"android_package_name": "",
|
||||||
"ios_bundle_id" : "",
|
"ios_bundle_id": "",
|
||||||
"isCloud" : false,
|
"isCloud": false,
|
||||||
"bought" : -1,
|
"bought": -1,
|
||||||
"pid" : "",
|
"pid": "",
|
||||||
"parameters" : {}
|
"parameters": {}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
/* 应用发布信息 */
|
/* 应用发布信息 */
|
||||||
"distribute" : {
|
"distribute": {
|
||||||
/* android打包配置 */
|
/* android打包配置 */
|
||||||
"android" : {
|
"android": {
|
||||||
"permissions" : [
|
"permissions": [
|
||||||
"<uses-permission android:name=\"android.permission.CHANGE_NETWORK_STATE\"/>",
|
"<uses-permission android:name=\"android.permission.CHANGE_NETWORK_STATE\"/>",
|
||||||
"<uses-permission android:name=\"android.permission.MOUNT_UNMOUNT_FILESYSTEMS\"/>",
|
"<uses-permission android:name=\"android.permission.MOUNT_UNMOUNT_FILESYSTEMS\"/>",
|
||||||
"<uses-permission android:name=\"android.permission.VIBRATE\"/>",
|
"<uses-permission android:name=\"android.permission.VIBRATE\"/>",
|
||||||
"<uses-permission android:name=\"android.permission.READ_LOGS\"/>",
|
"<uses-permission android:name=\"android.permission.READ_LOGS\"/>",
|
||||||
"<uses-permission android:name=\"android.permission.ACCESS_WIFI_STATE\"/>",
|
"<uses-permission android:name=\"android.permission.ACCESS_WIFI_STATE\"/>",
|
||||||
"<uses-feature android:name=\"android.hardware.camera.autofocus\"/>",
|
"<uses-feature android:name=\"android.hardware.camera.autofocus\"/>",
|
||||||
"<uses-permission android:name=\"android.permission.ACCESS_NETWORK_STATE\"/>",
|
"<uses-permission android:name=\"android.permission.ACCESS_NETWORK_STATE\"/>",
|
||||||
"<uses-permission android:name=\"android.permission.CAMERA\"/>",
|
"<uses-permission android:name=\"android.permission.CAMERA\"/>",
|
||||||
"<uses-permission android:name=\"android.permission.GET_ACCOUNTS\"/>",
|
"<uses-permission android:name=\"android.permission.GET_ACCOUNTS\"/>",
|
||||||
"<uses-permission android:name=\"android.permission.READ_PHONE_STATE\"/>",
|
"<uses-permission android:name=\"android.permission.READ_PHONE_STATE\"/>",
|
||||||
"<uses-permission android:name=\"android.permission.CHANGE_WIFI_STATE\"/>",
|
"<uses-permission android:name=\"android.permission.CHANGE_WIFI_STATE\"/>",
|
||||||
"<uses-permission android:name=\"android.permission.WAKE_LOCK\"/>",
|
"<uses-permission android:name=\"android.permission.WAKE_LOCK\"/>",
|
||||||
"<uses-permission android:name=\"android.permission.FLASHLIGHT\"/>",
|
"<uses-permission android:name=\"android.permission.FLASHLIGHT\"/>",
|
||||||
"<uses-feature android:name=\"android.hardware.camera\"/>",
|
"<uses-feature android:name=\"android.hardware.camera\"/>",
|
||||||
"<uses-permission android:name=\"android.permission.WRITE_SETTINGS\"/>",
|
"<uses-permission android:name=\"android.permission.WRITE_SETTINGS\"/>",
|
||||||
"<uses-permission android:name=\"android.permission.RECORD_AUDIO\"/>",
|
"<uses-permission android:name=\"android.permission.RECORD_AUDIO\"/>",
|
||||||
"<uses-permission android:name=\"android.permission.MODIFY_AUDIO_SETTINGS\"/>",
|
"<uses-permission android:name=\"android.permission.MODIFY_AUDIO_SETTINGS\"/>",
|
||||||
"<uses-permission android:name=\"android.permission.INTERNET\"/>"
|
"<uses-permission android:name=\"android.permission.INTERNET\"/>"
|
||||||
],
|
],
|
||||||
"abiFilters" : [ "armeabi-v7a", "arm64-v8a" ]
|
"abiFilters": ["armeabi-v7a", "arm64-v8a"]
|
||||||
},
|
},
|
||||||
/* ios打包配置 */
|
/* ios打包配置 */
|
||||||
"ios" : {
|
"ios": {
|
||||||
"dSYMs" : false,
|
"dSYMs": false,
|
||||||
"privacyDescription" : {
|
"privacyDescription": {
|
||||||
"NSCameraUsageDescription" : "我们需要访问相机以便您拍摄头像",
|
"NSCameraUsageDescription": "我们需要访问相机以便您拍摄头像",
|
||||||
"NSPhotoLibraryUsageDescription" : "我们需要访问相册以便您选择图片",
|
"NSPhotoLibraryUsageDescription": "我们需要访问相册以便您选择图片",
|
||||||
"NSMicrophoneUsageDescription" : "我们需要访问麦克风以便您使用语音输入功能",
|
"NSMicrophoneUsageDescription": "我们需要访问麦克风以便您使用语音输入功能",
|
||||||
"NSSpeechRecognitionUsageDescription" : "我们需要使用语音识别以便将您的语音转换为文字"
|
"NSSpeechRecognitionUsageDescription": "我们需要使用语音识别以便将您的语音转换为文字"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
/* SDK配置 */
|
/* SDK配置 */
|
||||||
"sdkConfigs" : {
|
"sdkConfigs": {
|
||||||
"speech" : {
|
"speech": {
|
||||||
"baidu" : {
|
"baidu": {
|
||||||
"appid" : "122745637",
|
"appid": "122745637",
|
||||||
"apikey" : "l2FgEjJBl96gUsAEQ6nf0asA",
|
"apikey": "l2FgEjJBl96gUsAEQ6nf0asA",
|
||||||
"secretkey" : "1i5Aj8FwL3i11LYPeXMRwRWycictWq2X"
|
"secretkey": "1i5Aj8FwL3i11LYPeXMRwRWycictWq2X"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"push" : {},
|
"push": {},
|
||||||
"statics" : {},
|
"statics": {},
|
||||||
"ad" : {}
|
"ad": {}
|
||||||
},
|
},
|
||||||
"icons" : {
|
"icons": {
|
||||||
"android" : {
|
"android": {
|
||||||
"hdpi" : "unpackage/res/icons/72x72.png",
|
"hdpi": "unpackage/res/icons/72x72.png",
|
||||||
"xhdpi" : "unpackage/res/icons/96x96.png",
|
"xhdpi": "unpackage/res/icons/96x96.png",
|
||||||
"xxhdpi" : "unpackage/res/icons/144x144.png",
|
"xxhdpi": "unpackage/res/icons/144x144.png",
|
||||||
"xxxhdpi" : "unpackage/res/icons/192x192.png"
|
"xxxhdpi": "unpackage/res/icons/192x192.png"
|
||||||
},
|
},
|
||||||
"ios" : {
|
"ios": {
|
||||||
"appstore" : "unpackage/res/icons/1024x1024.png",
|
"appstore": "unpackage/res/icons/1024x1024.png",
|
||||||
"ipad" : {
|
"ipad": {
|
||||||
"app" : "unpackage/res/icons/76x76.png",
|
"app": "unpackage/res/icons/76x76.png",
|
||||||
"app@2x" : "unpackage/res/icons/152x152.png",
|
"app@2x": "unpackage/res/icons/152x152.png",
|
||||||
"notification" : "unpackage/res/icons/20x20.png",
|
"notification": "unpackage/res/icons/20x20.png",
|
||||||
"notification@2x" : "unpackage/res/icons/40x40.png",
|
"notification@2x": "unpackage/res/icons/40x40.png",
|
||||||
"proapp@2x" : "unpackage/res/icons/167x167.png",
|
"proapp@2x": "unpackage/res/icons/167x167.png",
|
||||||
"settings" : "unpackage/res/icons/29x29.png",
|
"settings": "unpackage/res/icons/29x29.png",
|
||||||
"settings@2x" : "unpackage/res/icons/58x58.png",
|
"settings@2x": "unpackage/res/icons/58x58.png",
|
||||||
"spotlight" : "unpackage/res/icons/40x40.png",
|
"spotlight": "unpackage/res/icons/40x40.png",
|
||||||
"spotlight@2x" : "unpackage/res/icons/80x80.png"
|
"spotlight@2x": "unpackage/res/icons/80x80.png"
|
||||||
},
|
},
|
||||||
"iphone" : {
|
"iphone": {
|
||||||
"app@2x" : "unpackage/res/icons/120x120.png",
|
"app@2x": "unpackage/res/icons/120x120.png",
|
||||||
"app@3x" : "unpackage/res/icons/180x180.png",
|
"app@3x": "unpackage/res/icons/180x180.png",
|
||||||
"notification@2x" : "unpackage/res/icons/40x40.png",
|
"notification@2x": "unpackage/res/icons/40x40.png",
|
||||||
"notification@3x" : "unpackage/res/icons/60x60.png",
|
"notification@3x": "unpackage/res/icons/60x60.png",
|
||||||
"settings@2x" : "unpackage/res/icons/58x58.png",
|
"settings@2x": "unpackage/res/icons/58x58.png",
|
||||||
"settings@3x" : "unpackage/res/icons/87x87.png",
|
"settings@3x": "unpackage/res/icons/87x87.png",
|
||||||
"spotlight@2x" : "unpackage/res/icons/80x80.png",
|
"spotlight@2x": "unpackage/res/icons/80x80.png",
|
||||||
"spotlight@3x" : "unpackage/res/icons/120x120.png"
|
"spotlight@3x": "unpackage/res/icons/120x120.png"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"uniStatistics" : {
|
"uniStatistics": {
|
||||||
"enable" : true
|
"enable": true
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
/* 快应用特有相关 */
|
/* 快应用特有相关 */
|
||||||
"quickapp" : {},
|
"quickapp": {},
|
||||||
/* 小程序特有相关 */
|
/* 小程序特有相关 */
|
||||||
"mp-weixin" : {
|
"mp-weixin": {
|
||||||
"appid" : "",
|
"appid": "",
|
||||||
"setting" : {
|
"setting": {
|
||||||
"urlCheck" : false
|
"urlCheck": false
|
||||||
},
|
},
|
||||||
"usingComponents" : true,
|
"usingComponents": true,
|
||||||
"uniStatistics" : {
|
"uniStatistics": {
|
||||||
"enable" : false
|
"enable": false
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"mp-alipay" : {
|
"mp-alipay": {
|
||||||
"usingComponents" : true,
|
"usingComponents": true,
|
||||||
"uniStatistics" : {
|
"uniStatistics": {
|
||||||
"enable" : false
|
"enable": false
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"mp-baidu" : {
|
"mp-baidu": {
|
||||||
"usingComponents" : true,
|
"usingComponents": true,
|
||||||
"uniStatistics" : {
|
"uniStatistics": {
|
||||||
"enable" : false
|
"enable": false
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"mp-toutiao" : {
|
"mp-toutiao": {
|
||||||
"usingComponents" : true,
|
"usingComponents": true,
|
||||||
"uniStatistics" : {
|
"uniStatistics": {
|
||||||
"enable" : false
|
"enable": false
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"uniStatistics" : {
|
"uniStatistics": {
|
||||||
"enable" : false,
|
"enable": false,
|
||||||
"version" : "2"
|
"version": "2"
|
||||||
},
|
},
|
||||||
"vueVersion" : "3",
|
"vueVersion": "3",
|
||||||
"app-harmony" : {
|
"app-harmony": {
|
||||||
"uniStatistics" : {
|
"uniStatistics": {
|
||||||
"enable" : false
|
"enable": false
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"h5" : {
|
"h5": {
|
||||||
"uniStatistics" : {
|
"uniStatistics": {
|
||||||
"enable" : true
|
"enable": true
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"mp-harmony" : {
|
"mp-harmony": {
|
||||||
"uniStatistics" : {
|
"uniStatistics": {
|
||||||
"enable" : false
|
"enable": false
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"mp-jd" : {
|
"mp-jd": {
|
||||||
"uniStatistics" : {
|
"uniStatistics": {
|
||||||
"enable" : false
|
"enable": false
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"mp-kuaishou" : {
|
"mp-kuaishou": {
|
||||||
"uniStatistics" : {
|
"uniStatistics": {
|
||||||
"enable" : false
|
"enable": false
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"mp-lark" : {
|
"mp-lark": {
|
||||||
"uniStatistics" : {
|
"uniStatistics": {
|
||||||
"enable" : false
|
"enable": false
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"mp-qq" : {
|
"mp-qq": {
|
||||||
"uniStatistics" : {
|
"uniStatistics": {
|
||||||
"enable" : false
|
"enable": false
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"mp-xhs" : {
|
"mp-xhs": {
|
||||||
"uniStatistics" : {
|
"uniStatistics": {
|
||||||
"enable" : false
|
"enable": false
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"quickapp-webview-huawei" : {
|
"quickapp-webview-huawei": {
|
||||||
"uniStatistics" : {
|
"uniStatistics": {
|
||||||
"enable" : false
|
"enable": false
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"quickapp-webview-union" : {
|
"quickapp-webview-union": {
|
||||||
"uniStatistics" : {
|
"uniStatistics": {
|
||||||
"enable" : false
|
"enable": false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1,7 +1,7 @@
|
|||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
const uniPush = uniCloud.getPushManager({
|
const uniPush = uniCloud.getPushManager({
|
||||||
appId: "__UNI__9B0F7C5" // 你的应用appId
|
appId: "__UNI__F199FF4" // 你的应用appId
|
||||||
})
|
})
|
||||||
exports.main = async (event) => {
|
exports.main = async (event) => {
|
||||||
console.log(event)
|
console.log(event)
|
||||||
Loading…
Reference in New Issue
Block a user