Revert "Revert "✨ feat(消息): 添加推送消息sdk""
This reverts commit 918cc3415f.
This commit is contained in:
24
shared/pubUtils/dictionary/DicPushMessage.ts
Normal file
24
shared/pubUtils/dictionary/DicPushMessage.ts
Normal file
@@ -0,0 +1,24 @@
|
||||
import { readFileAndParse } from '../util'
|
||||
import { FILENAME } from '../../consts'
|
||||
|
||||
export interface DicPushMessage {
|
||||
id: number;
|
||||
pushMsgType: string; // 推送类型标签,PUSH_MSG_TYPE
|
||||
title: string; // 推送标题,30字以内
|
||||
description: string; // 推送正文,100字以内,其他同上
|
||||
playerType: number; // 推送玩家的类型,PLAYER_TYPE
|
||||
clickType: string; // 点击通知之后的后续动作
|
||||
url: string; // 玩家点击通知之后,如果clickType选了url填写网址,长度<=1024
|
||||
intent: string; // 玩家点击通知之后,如果clickType选了intent填写应用特定页面,需要找客户端定制,长度<=1024
|
||||
}
|
||||
|
||||
export const dicPushMessage = new Map<string, DicPushMessage>();
|
||||
export function loadPushMessage() {
|
||||
dicPushMessage.clear();
|
||||
let arr = readFileAndParse(FILENAME.DIC_PUSH_MESSAGE);
|
||||
|
||||
arr.forEach(o => {
|
||||
dicPushMessage.set(o.pushMsgType, o);
|
||||
});
|
||||
arr = undefined;
|
||||
}
|
||||
Reference in New Issue
Block a user