getui sdk
lib为官方的原版目录 具体api需要参考官方 http://docs.getui.com/server/nodejs/start/
Install
npm install --save sun-getui-sdk
Examples
const getui = const getuiConfig = "appId": "O6Yu3JHjV98ZskTkzcHhQ" "appKey": "alhTZbRL7m9LW1aEXqsoP4" "appSecret": "cKnTp73lQx6cKxkPjuOu48" "masterSecret": "yRYxy2nNr3AU7t67QfqZLA" "host": "https://api.getui.com/apiex.htm"const getuiDemo = getuiConfighost getuiConfigappKey getuiConfigmasterSecretconst template = appId: getuiConfigappId appKey: getuiConfigappKey title: '个推' text: '个推最新版点击下载' logoUrl: 'http://wwww.igetui.com/logo.png' isRing: true isVibrate: true isClearable: false url: 'http://www.igetui.com'; const message = isOffline: true offlineExpireTime: '123123' data: template; const target = appId: getuiConfigappId clientId: '0b4cad197eaef79fd8225d236542fc8f';getuiDemo ;
tip: 没有使用5+sdk就不用看下面代码了
// 针对在5+sdk使用了透传消息的,建议消息内容使用标准目标,才可以进入消息中心 但是ios在线的时候消息时不进入消息中心的,需要在页面监听receive事件var template = appId: getuiConfigappId appKey: getuiConfigappKey transmissionType: 1 transmissionContent: "{\"title\":\"您有新的通知\",\"content\":\"请查阅:XXX批发公司已经审核了您的订单!\",\"payload\":{\"type\":1,\"refnumber\" :\"1000263\" ,\"total_count\":5}}";