Huawei not sending push token to third party in production

118 views Asked by At

and thanks in advance for the help.

I have an android application created in java and kotlin, I made an override to the huawei push notification service where I send the token generated by the device to a third party, the problem is that when I generate the application locally it works and sends the token, but when I download the application from AppGallery the token is not being generated by the application.

Don't know what the issue might be :(

This is the code I have at the moment:

AndroidManifest.xml and the CustomHmsService.kt

        <service
            android:name=".CustomHmsService"
            android:exported="false">
            <intent-filter>
                <action android:name="com.huawei.push.action.MESSAGING_EVENT" />
            </intent-filter>

        </service>


import com.huawei.hms.push.RemoteMessage
import com.huawei.hms.rn.push.remote.HmsPushMessageService

class CustomHmsService: HmsPushMessageService() {


    override fun onNewToken(token: String?) {
    super.onNewToken(token)
    //Call to a third user , sending the token
  }

  override fun onMessageReceived(hmsRemoteMessage: RemoteMessage?) {
    //Custom methods
  }
}
0

There are 0 answers