uniapp 基于个推接收推送处理

2,223次阅读
没有评论

共计 651 个字符,预计需要花费 2 分钟才能阅读完成。

// #ifdef APP-PLUS
			const _handlePush = function(message) {
				let payload = message.payload;
				if ('string' === typeof payload) {
					payload = JSON.parse(payload)
				}
				try {
					// 处理 刷新
					if (payload.type) {
						chuliRefresh(_self, payload.type);
					}
					// 处理 跳转
					if (payload.action) {
						// 跳转
						chuliRoute(_self,payload.action,payload.data);
					}
				} catch (e) {
					//TODO handle the exception
					console.log(e);
				}
			};
			plus.push.addEventListener('click', function(message) {
				// plus.nativeUI.toast('push click');
				// 清除系统通知栏
				plus.push.clear();
				// 清空数量角标
				claerBadge();
				
				_handlePush(message);
			});
			plus.push.addEventListener('receive', function(message) {
				// plus.nativeUI.toast('push receive');
				_handlePush(message);
			});
			// 检测通知栏是否开放
			nativeCheck.checkNotification();
			// #endif
正文完
 0
Eric chan
版权声明:本站原创文章,由 Eric chan 于2019-06-18发表,共计651字。
转载说明:除特殊说明外本站文章皆由CC-4.0协议发布,转载请注明出处。