I have set up PushKit in my app and I want to send upstream message. On a device it fails with the following exception:
com.huawei.hms.push.SendException: device not in device group
at com.huawei.hms.push.HmsMessageService.b(HmsMessageService.java:299)
at com.huawei.hms.push.HmsMessageService.a(HmsMessageService.java:190)
at com.huawei.hms.push.HmsMessageService.a(HmsMessageService.java:39)
at com.huawei.hms.push.HmsMessageService$a.handleMessage(HmsMessageService.java:162)
at android.os.Handler.dispatchMessage(Handler.java:107)
at android.os.Looper.loop(Looper.java:237)
at android.app.ActivityThread.main(ActivityThread.java:7948)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1075)
- Length of message: 616
- Token gets generated
What is the meaning of this error?
Checking the docs about this error , you can see this:
ERROR_DEVICE_NOT_IN_GROUP
Constant value: 907122057
The device is not in the device group.
But no further details.
In my case there was a mistake passing
"push.hcm.upstream"
to theRemoteMessage.Builder
argeument.Code before:
Code that is correct:
Despite surprisingly success of sending message on a device, with this correction made, the uplinks will be sent with no issues.