hbuilder代码
// 添加app push监听事件(需注册到app onLaunch中)
export function addAppPushEventListener() {
//#ifdef APP-PLUS
console.log("注册app push event listener");
uni.onPushMessage(async (res) => {
console.log("uni.onPushMessage 接收到消息事件", res); //监听推送消息
const {
type,
data
} = res;
if (type === "click") {
console.log("uni.onPushMessage 点击消息回调,唤端成功");
pushMessageClickCallBack(data);
}
});
//#endif
}
安卓离线工程配置
因要上架google play, 所以按照google最新要求, 升级targetSdkVersion到了34
defaultConfig {
applicationId "com.cafe24.ec.pluslooxloo24"
minSdkVersion 26
targetSdkVersion 34
versionCode 2410284
versionName "2.4.10284"
multiDexEnabled true
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
ndk {
// 注意!上架Google Play市场对CPU类型的要求不能包含"x86"
abiFilters "armeabi-v7a", "arm64-v8a"
}
}
安卓离线工程debug日志
当在三星手机app上debug, 点击消息通知后, 日志中出现了如下报错, 然后就无法唤起app
2024-10-28 21:06:01.674 2266-4989 NotificationService system_server E Indirect notification activity start (trampoline) from com.cafe24.ec.pluslooxloo24 blocked
2024-10-28 21:06:01.674 2266-4989 NotificationService system_server E Indirect notification activity start (trampoline) from com.cafe24.ec.pluslooxloo24 blocked
1***@qq.com
扫码安装官网最新版本的 hello uni-app x 测试推送,还是无法唤起APP。APP版本1.6.16;手机机型 三星Galaxy S23Ultra,Android 13
2024-12-02 16:44