a***@163.com
a***@163.com
  • 发布:2022-03-30 21:16
  • 更新:2022-04-06 10:58
  • 阅读:1015

请升级Unipush的厂商SDK版本,兼容Android 12

分类:uni-app

我使用离线打包在Android端集成unipush,因为有些比较新的出来的包,所以要求目标版本31。
测试透传消息在红米K40游戏版上可以收到通知,但点击通知没反应。
从logcat中抓取到点击通知时的一个报错:
E/NotificationService: Indirect notification activity start (trampoline) from com.xxx.xxx blocked。
查了Android文档,说是从Android 12开始,禁用了点击通知先打开Service/BroadCast,在从里面启动Activity这种方式,必须是直接启动Activity。
我用的Android SDK@3.3.13.81245_20220315,我看了下里面的xmp-3.0.3.aar使用的是MiPush_SDK_Client_4_8_1.jar,刚好还没兼容Android 12,小米推送SDK日志里面显示4.8.2是兼容了的。小米push SDK更新日志

什么时候unipush可以升级下厂商推送SDK版本?现在Android 13都出来了,12还没兼容,太说不过去了吧

intent://io.dcloud.unipush/?#Intent;scheme=unipush;launchFlags=0x4000000;component=com.xxx.xxx/com.xxx.xxx.MainPandora;S.UP-OL-SU=true;S.title=出行攻略;S.content=十大景点推荐;S.payload=clickhere;end

完整logcat日志:

2022-03-30 19:42:14.597 3751-3751/? W/PushService: [Tid:2] group auto not get notifications  
2022-03-30 19:42:14.600 829-829/? W/android.hardware.memtrack-service.mediatek: [memtrack] error to open /proc/ion/clients/clients_summary or /proc/dma_heap/stats  
2022-03-30 19:42:14.600 1407-3454/? W/MiuiFreeFormGesturePointerEventListener: setMiuiFreeFormTouchExcludeRegion mTouchExcludeRegion = SkRegion((0,0,1080,2400))  
2022-03-30 19:42:14.617 3751-4839/? W/PushService: [Tid:50] try send mi push message. packagename:com.miaoing.zhizidoc action:Notification  
2022-03-30 19:42:14.642 893-893/? I/BufferQueueProducer: [com.miui.home/com.miui.home.launcher.Launcher#0](this:0xb400007d70c588d8,id:-1,api:0,p:-1,c:893) queueBuffer: fps=1.26 dur=9516.67 max=9425.19 min=8.16  
2022-03-30 19:42:14.650 3751-3751/? W/PushService: [Tid:2] onStart() with intent.Action = com.xiaomi.mipush.SEND_MESSAGE, chid = null, pkg = null|com.miaoing.zhizidoc  
2022-03-30 19:42:14.653 3751-4839/? W/PushService: [Tid:50] [Job] Handle intent action = com.xiaomi.mipush.SEND_MESSAGE  
2022-03-30 19:42:14.655 3751-4839/? W/PushService: [Tid:50] try send mi push message. packagename:com.miaoing.zhizidoc action:Notification  
2022-03-30 19:42:14.668 1407-1429/? I/ActivityTaskManager: START u0 {act=android.intent.action.VIEW dat=unipush://io.dcloud.unipush/? flg=0x14000000 pkg=com.miaoing.zhizidoc cmp=com.miaoing.zhizidoc/.MainPandora (has extras)} from uid 10549  
2022-03-30 19:42:14.671 1407-1429/? E/NotificationService: Indirect notification activity start (trampoline) from com.miaoing.zhizidoc blocked  
2022-03-30 19:42:14.672 1407-1429/? W/ActivityTaskManager: Background activity start [callingPackage: com.miaoing.zhizidoc; callingUid: 10549; appSwitchAllowed: true; isCallingUidForeground: false; callingUidHasAnyVisibleWindow: false; callingUidProcState: SERVICE; isCallingUidPersistentSystemProcess: false; realCallingUid: 10549; isRealCallingUidForeground: false; realCallingUidHasAnyVisibleWindow: false; realCallingUidProcState: SERVICE; isRealCallingUidPersistentSystemProcess: false; originatingPendingIntent: null; allowBackgroundActivityStart: false; intent: Intent { act=android.intent.action.VIEW dat=unipush://io.dcloud.unipush/? flg=0x14000000 pkg=com.miaoing.zhizidoc cmp=com.miaoing.zhizidoc/.MainPandora (has extras) }; callerApp: ProcessRecord{2691c21 11335:com.miaoing.zhizidoc:pushservice/u0a549}; inVisibleTask: false]  
2022-03-30 19:42:14.675 1407-1429/? E/ActivityTaskManager: Abort background activity starts from 10549  
2022-03-30 19:42:14.688 3751-3751/? W/PushService: [Tid:2] onStart() with intent.Action = com.xiaomi.mipush.SEND_MESSAGE, chid = null, pkg = null|com.miaoing.zhizidoc  
2022-03-30 19:42:14.689 3751-4839/? W/PushService: [Tid:50] [Job] Handle intent action = com.xiaomi.mipush.SEND_MESSAGE  
2022-03-30 19:42:14.691 3751-4839/? W/PushService: [Tid:50] try send mi push message. packagename:com.miaoing.zhizidoc action:Notification
2022-03-30 21:16 负责人:DCloud_Android_THB 分享
已邀请:

最佳回复

DCloud_Android_THB

DCloud_Android_THB

小米厂商推送已升级,请更新到3.4.4-alpha版本。

  • MrMa

    想问下FCM推送的是否也有升级呢

    2023-11-03 13:18

a***@163.com

a***@163.com (作者)

https://dev.mi.com/console/doc/detail?pId=41

由于Android 12通知 trampoline 限制的原因(详见google文档),对于targetSdkVersion >= 31的应用,需要接入SDK 4.9.1及以上版本,否则会出现点击通知无法正常跳转的情况。

a***@163.com

a***@163.com (作者)

把MiPush_SDK_Client_4_9_1.jar打包进xmp-3.0.3.aar,编译了个新的aar,有相同问题的可以应应急。

该问题目前已经被锁定, 无法添加新回复