HMS+GMS设备上的HMS推送通知问题
我在也有 GMS 的三星设备上遇到了有关 HMS 的问题。
华为通知有两种类型:
- 数据消息 (DM)
- 通知消息 (NM)
华为设备(仅限HMS)
NM如果我们发送 NM,那么推送会以任何状态(关闭、后台和前台)到达应用程序,但它们不会被自动处理......它必须是推杆,我想由应用程序处理。这似乎是 HMS 强加的限制。现在这可能没问题。
DM如果我们发送 DM,那么推送可以由 App 自动处理,但只有当 App 的状态为前台(自动处理)或后台时,它们才会到达 App。如果应用程序处于关闭状态,则不会收到它们(没有声音,没有气泡,...)。但这暂时不是错误问题。
非华为设备(HMS + GMS),例如三星 A10
NM仅与上面的 HMS 相同,只是它们没有以任何方式进行处理。这是个大问题……我们需要把NM的payload传给App。??
DM如果我们发送 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)
但我完全不清楚发生了什么......为什么在使用华为设备和使用三星设备时通知有效负载正确传递给应用程序不起作用?