Having a log would be perfect but if everything fine in the logs, no exception and result code from HCM is success, then verify the EMUI version of your device.
If your device's EMUI version is earlier than 10.0, the code you have used will return empty push token. In such case, it is necessary to implement a custom service extending HmsMessageService.
In your AndroidManifest.xml add;
<service
android:name=".CustomPushService"
android:exported="false">
<intent-filter>
<action android:name="com.huawei.push.action.MESSAGING_EVENT" />
</intent-filter>
</service>
Then create following class;
public class CustomPushService extends HmsMessageService {
private static final String TAG = "PushTokenLog";
@Override
public void onNewToken(String token) {
super.onNewToken(token);
Log.i(TAG, "receive token:" + token);
}
}
Last but not least, make sure your device is Huawei :) Most of the features of HMS Core relies on EMUI. Without EMUI, functionality of the functions is not guaranteed for now.
Below is a nice reference to see HMS Core - EMUI relation.
https://developer.huawei.com/consumer/en/doc/development/HMS-Guides/emui_version_dependent_features
Update as per the comment of question owner
The return code 907135000 means that your SDK configurations are not correct. Take your time to check following points;
- Check whether the app_id and package_name parameters in the agconnect-services.json file are correct. The app_id and package name should match the app created on AGC. Also, consider re-downloading corresponding agconnect-service.json
- Check whether the certificate signature is configured in the build.gradle file.
- The fault may be caused by the cache of HMS Core (APK). Uninstall and then reinstall HMS Core (APK), disconnect and reconnect the phone with the Internet, and start the app again.