gpt4 book ai didi

android - HMS+GMS 设备上的 HMS 推送通知问题

转载 作者:行者123 更新时间:2023-12-03 16:19:07 27 4
gpt4 key购买 nike

我在也有 GMS 的三星设备上遇到了有关 HMS 的问题。
华为通知分为两种:

  • 数据信息 (DM)
  • 通知消息 (NM)

  • 华为设备(仅限HMS)
    近乎如果我们发送 NM,那么推送会以任何状态(关闭、后台和前台)到达 App,但它们不会被自动处理……它必须是 tappet,我想被 App 处理。这似乎是 HMS 施加的限制。现在这可能没问题。
    私信如果我们发送 DM,那么推送可以由 App 自动处理,但只有 App 的状态是前台(自动处理)或后台时才会到达 App。如果应用程序处于关闭状态,则不会收到它们(没有声音,没有气泡,...)。但这暂时不是错误问题。
    非华为设备(HMS + GMS),例如三星A10
    近乎仅与上面的 HMS 相同,只是它们不以任何方式处理。这是一个大问题……我们需要将 NM 的有效载荷传递给 App。 ⚠️
    私信如果我们发送 DM,糟糕...推送通知 甚至没有处理只有当应用程序的状态是前台或后台时,它们才会到达应用程序。如果应用程序处于关闭状态,则不会收到它们(没有声音,没有气泡,...)。这个问题可能是 HMS Core 配置错误的问题……但没有说。 ⚠️
    我们已经注册了广告日志(如下,由 HMSSDK 过滤):
    05-05 15:38:19.130  4452  4688 D SDHMS:s : SIOP:: AP:270(293,30) BAT:261(261,0) CHG:0(0,0) USB:0(0,0) 
    05-05 15:38:24.045 551 16859 I PushLog3203_HMS: [SocketRead_15:36:31-2319]process cmdid to receive from pushSrv:44(:277)
    05-05 15:38:24.050 551 16859 I PushLog3203_HMS: [SocketRead_15:36:31-2319]dispatchIntent over(:277)
    05-05 15:38:24.051 551 16857 I PushLog3203_HMS: [ReceiverDispatcher-2317]enter ConnectReceiver:onReceive(:277)
    05-05 15:38:24.052 551 16857 I PushLog3203_HMS: [ReceiverDispatcher-2317]enter CommandReceiver:onReceive,Intent { act=com.huawei.android.push.intent.MSG_RECEIVED (has extras) }(:277)
    05-05 15:38:24.059 551 16857 I PushLog3203_HMS: [ReceiverDispatcher-2317]Device type is :2 [1:NOT_GDPR, 2:GDPR](:277)
    05-05 15:38:24.060 551 16857 I PushLog3203_HMS: [ReceiverDispatcher-2317]msgType: 2 [0:PassBy msg, 1:System notification, 2:normal notification](:277)
    05-05 15:38:24.076 551 16857 I PushLog3203_HMS: [ReceiverDispatcher-2317]send selfshow msg to [my.appid](:277)
    05-05 15:38:24.076 551 16857 I PushLog3203_HMS: [ReceiverDispatcher-2317]send msg(:277)
    05-05 15:38:24.076 551 16857 I PushLog3203_HMS: [ReceiverDispatcher-2317]bindservice(:277)
    05-05 15:38:24.083 551 16857 I PushLog3203_HMS: [ReceiverDispatcher-2317]startService: actioncom.huawei.push.msg.NOTIFY_MSG(:277)
    05-05 15:38:24.084 551 16857 I PushLog3203_HMS: [ReceiverDispatcher-2317]process cmdid to send to pushSrv:45(:277)
    05-05 15:38:24.086 551 16857 I PushLog3203_HMS: [ReceiverDispatcher-2317]send msg to remote srv success(:277)
    05-05 15:38:24.086 551 16857 I PushLog3203_HMS: [ReceiverDispatcher-2317]rspPushMessage the response msg is :45,msgId:08415B32F5B0813B,flag:00(:277)
    05-05 15:38:24.094 16862 16862 I HMSSDK_HmsMsgService: onBind
    05-05 15:38:24.102 551 551 I PushLog3203_HMS: [main-2]on service connected(:277)
    05-05 15:38:24.118 16862 16862 I HMSSDK_HmsMsgService: chose push type
    05-05 15:38:24.123 16862 16862 I HMSSDK_HmsMsgService: invokeSelfShow
    05-05 15:38:24.130 16862 16862 I HMSSDK_PushSelfShowLog: get notifyId:0
    05-05 15:38:24.140 16862 16862 I HMSSDK_PushSelfShowLog: onReceive the msg id = -1979310593,and cmd iscosa,and the eventId is null
    05-05 15:38:24.143 16862 16862 I HMSSDK_PushSelfShowLog: receive a selfshow message ,the type iscosa
    05-05 15:38:24.147 16862 16862 I HMSSDK_PushSelfShowLog: startIndex is 31,ap is:,length is:0
    05-05 15:38:24.151 16862 16862 I HMSSDK_HmsMsgService: invokeSelfShow done
    05-05 15:38:24.151 16862 17852 I HMSSDK_PushSelfShowLog: enter run()
    05-05 15:38:24.163 16862 17852 I HMSSDK_PushSelfShowLog: exportedFlag:true
    05-05 15:38:24.166 16862 17852 I HMSSDK_PushSelfShowLog: need permission:null
    05-05 15:38:24.171 16862 17852 I HMSSDK_PushSelfShowLog: get left bitmap from my.appid
    05-05 15:38:24.205 16862 17852 I HMSSDK_PushSelfShowLog: setAutoClear time is: 0
    05-05 15:38:24.209 16862 17852 I HMSSDK_PushAnalyticsUtils: Not support report BI
    05-05 15:38:28.603 16803 16803 I HMSSDK_PushMsgReceiver: push receive broadcast message, Intent:com.huawei.intent.action.PUSH_DELAY_NOTIFY pkgName:my.appid
    05-05 15:38:28.610 16803 16803 I HMSSDK_PushSelfShowLog: get notifyId:-542625601
    05-05 15:38:28.618 16803 16803 I HMSSDK_PushSelfShowLog: onReceive the msg id = -1979310593,and cmd iscosa,and the eventId is 1
    05-05 15:38:28.624 16803 16803 I HMSSDK_PushSelfShowLog: run into launchCosaApp
    05-05 15:38:28.627 16803 16803 I HMSSDK_PushSelfShowLog: enter launchExistApp cosa, appPackageName =my.appid,and msg.intentUri is strongauth
    05-05 15:38:28.634 16803 16803 I HMSSDK_PushSelfShowLog: Intent.parseUri(msg.intentUri, 0),android.intent.action.VIEW
    05-05 15:38:28.640 16803 16803 I HMSSDK_PushSelfShowLog: exportedFlag:true
    05-05 15:38:28.642 16803 16803 I HMSSDK_PushSelfShowLog: need permission:null
    05-05 15:38:28.646 16803 16803 I HMSSDK_PushSelfShowLog: start #Intent;action=android.intent.action.MAIN;category=android.intent.category.LAUNCHER;launchFlags=0x30020000;package=my.appid;component=my.appid/.MainActivity;end
    05-05 15:38:28.668 16803 16803 I HMSSDK_PushAnalyticsUtils: Not support report BI
    05-05 15:38:29.180 4452 4688 D SDHMS:s : SIOP:: AP:272(297,30) BAT:261(261,0) CHG:0(0,0) USB:0(0,0)
    但我根本不清楚发生了什么......为什么在使用华为设备时通知有效负载正确传递给应用程序并且使用三星设备时无法正常工作?

    最佳答案

    我相信你已经安装了 HMS Core 来接收推送通知。但在非华为设备上,HMS Core 不被视为系统应用。操作系统/电池优化器可能会杀死 HMS Core 进程并导致接收推送消息出现问题。
    即使 HMS Core 在后台存活并不是根本原因,请注意在非华为设备上没有官方支持此用例。当您在三星设备上进行测试时,建议您改为使用 GMS 实现推送。

    关于android - HMS+GMS 设备上的 HMS 推送通知问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/67415875/

    27 4 0
    Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
    广告合作:1813099741@qq.com 6ren.com