0
votes

I been trying to integrate OneSignal with PushKit via Ionic Cordova platform and I've been encountering some issue on sending / receiving notification. From the logs, i can see the following

  • OneSignal successfully registered the Device
  • PushKit successfully retrieve the Token

I've tried both v4.0.3 and the latest v5 of the Cordova PushKit plugin I've been testing this on the Huawei Cloud Testing devices as I don't have actual device

When i try to send the notification from OneSignal, it was mentioned that it's successful

In the device log, there's the following logs being recorded which i believe it has received the notification but failed to load it

  • I/PushLog110102300: [SocketRead_13:06:02-310]enter cancelAlarm(Action=com.huawei.android.push.intent.RESPONSE_FAIL
  • I/PushLog110102300: [SocketRead_13:06:02-310]process cmdid to receive from pushSrv:44, subCmdId:FF
  • I/PushLog110102300: [SocketRead_13:06:02-310]dispatchIntent over
  • I/PushLog110102300: [ReceiverDispatcher-291]process push message cmdid from pushSrv:44, subCmdId:FF
  • I/PushLog110102300: [ReceiverDispatcher-291]msgType: 2 [0:PassBy msg, 1:System notification, 2:normal notification, 3:HCM PassBy msg]
  • I/PushLog110102300: [ReceiverDispatcher-291] closeTokenCheck: false
  • I/PushLog110102300: [ReceiverDispatcher-291]custom channelId is empty
  • E/SecurityComp10105302: kj: content or algorithm is null.
  • I/PushLog110102300: [ReceiverDispatcher-291]accountVerify profileId is empty.
  • E/PushLog110102300: [ReceiverDispatcher-291]no permission to start activity, appPackageName:mypackage.name, isUri:true
  • E/PushLog110102300: [ReceiverDispatcher-291]no permission to start activity:mypackage.name,msgID:0D2314DF0541E133
  • E/PushLog110102300: [ReceiverDispatcher-291]NC message is invalid, can not display.
  • I/PushLog110102300: [ReceiverDispatcher-291]process cmdid to send to pushSrv:45, subCmdId:FF
  • I/PushLog110102300: [ReceiverDispatcher-291]send msg to remote srv success
  • I/PushLog110102300: [ReceiverDispatcher-291]handleMessageResponse the response msg is :45,msgId:0D2314DF0541E133,displayPkgName:mypackage.name,flag:94
  • I/PushLog110102300: [ReceiverDispatcher-291]enter AlarmTools:setInexactAlarm(intent:Intent { act=com.huawei.action.push.intent.CHECK_CHANNEL_CYCLE pkg=android } interval:1200000ms

Can anyone share what i can do next?

3
You are advised to check whether the page to be started has permission protection or whether exported=false is set.shirley
@shirley i have added this in the manifest, do i need to set other type of permission ? <service android:exported="true" android:enabled="true" android:name="MyHmsMessageService"> <intent-filter> <action android:name="com.huawei.push.action.MESSAGING_EVENT" /> </intent-filter> </service>rekony
hey@ rekony,i updated my answer,pls kindly refer.shirley

3 Answers

0
votes

You can refer to this document to check whether the permission of the activity to be opened through the action is set and whether the export function is set.

enter image description here

0
votes

This looks like that you are missing permissions, I'd advise you to look into the documentation for OneSignal amd HMS push and implement them into your code. You will need to request the permissions at runtime, follow the instructions here.

0
votes

make sure you have this in your androidManifist inside Application tag

 <meta-data
    android:name="push_kit_auto_init_enabled"
    android:value="true"/>