[Huawei Developers] Freemind R:
More information about the contest, you can visit HUAWEI Developer Forum.​

The AppsUP contest has already been launched more than two weeks. Many friends of mine have taken part in it already. And they unexpectedly meet many difficulties in the process of developing the apps. I believe many developers are the same. Today I want to share the frequently asked questions of Push Kit with you.

Q: How to configure the Huawei platform to receive notifications on all devices that have my application installed?

A: Please select All in Push Scope to send to all devices.

Q: PushKit take long time to be received on testing mode ?

A: These are the main issues of slowness. If you encounter the same problem, you can try to trace the issue according to the following list:

Sending time:

Receiving time:

SN number of the phone (dial *#06#):

appId:

name of apk:

Q: Test the ringtone of the customized notification channel on the Android client. But the message still the default marketing channel is used instead of the customized notification channel. Therefore, the customized ringtone is not played.

A: When creating a customized channel, you need to set the sound. Check whether the sound is set during channel creation. The ringtone file must be stored in the /res/raw directory of the application. Ensure that the file is stored in the correct location as required. For details, see the sound field description of https://developer.huawei.com/consumer/en/doc/development/HMS-References/push-sendapi

Ensure that the sound field is the same as the sound file name in the code,

The default sound field must be set to false. Finally, with regard to the level of messages sent, if the message level is judged to be average, the sound will be the default system sound.

Q: Failed to obtain the token ID after Huawei Push is integrated.

A: The APIClient object may be invalid. Check the code for initializing the APIClient object,

1. Choose Settings > Apps > App Manager, search for Huawei Mobile Services, clear the cache, check the update, and try to obtain the token again. For non-Huawei phones, install the latest version of Huawei Mobile Services (APK).

2. If the EMUI version is 10 or later, getToken is returned. If the EMUI version is earlier than 10, onNewToken is returned.

Q: Upgrading the Xamarin version from 3.2 to 4 is it going to affect the Integration of Push Kit?

A: Version upgrade should not affect the integrations, but if the upgrade causes compatibility version issues, Microsoft recommends remove all packages and re-add Xamarin.

This can be a reference: https://docs.microsoft.com/en-us/xamarin/xamarin-forms/troubleshooting/

And if the CP wants to upgrade, is better make a backup first

Q: I am trying to use push kit for sending notification to my app users. I want send notification using api method. But it shows "error_description": "missing required parameter: client_id".

A: Please check your client code. This error comes up when you have the client id missing.

Q: Why sometimes the app does not receive any new pushes

A: Firstly, collect the push logs:

1. Dial *#*#2846579#*#*

2. Background Setting-->Background Debug-->Open

3. Background Setting-->AP Log Setting-->Open

4. adb shell setprop log.tag.hwpush VERBOSE

5. adb logcat -v threadtime 1>d:\log.txt

6. Please try to reproduce the push problem

7. Ctrl+C to stop the step 5

Then, search "PushLog" from log.txt

1.If the result like "PushLog100101200", it means HMS push is the default system push channel

2.If the result like "PushLog40002310_HMS", it means HMS push is not the default system push channel. In this case, the push is not stable enough.

So, Check GMS available or not firstly, if GMS is available, then use GMS push, if not, if HMS is available, then use HMS push.

Note: For some Huawei Phone support both GMS and HMS, even if you unstall the GMS, HMS push will not automatically become the default system push channel.

Q: Huawei push SDK has been correctly integrated and can obtain the app ID from agconnect-servicesjson to obtain the token. 907135701:907135700 is displayed.

A: Check whether the debug and release versions of your app use different signature certificate

Q: The Message ”No manifest found” Is Displayed When the Push Demo Code Is Run.

A: This problem occurs when the agcp plug-in version is earlier than 1.2.1.301. You can solve this problem in the following ways.

Method 1: Upgrade the agcp plug-in to the latest version. Go to buildscript > dependencies and and change the agcp version.

Method 1: Add the following configuration to the end of the build.gradle file at the application level to disable the dependency of the agcp plug-in on the manifest file.

After the build.gradle file is modified, Sync Now is displayed in the upper right corner. Click Sync Now and wait until the synchronization is complete. Or details, see Integrating the HMS SDK in Preparations:

https://developer.huawei.com/consumer/en/doc/development/HMS-Guides/Preparations#h1-1575707420071

Q: Compilation Errors in React Native Version 0.59.8

A: Following is a sample build.gradle file that can successfully resolve the problematic modules in the description:

buildscript {
ext {
buildToolsVersion = "28.0.3"
minSdkVersion = 19
compileSdkVersion = 28
targetSdkVersion = 28
}
repositories {
google()
jcenter()
maven {url 'http://developer.huawei.com/repo/'}
}
dependencies {
classpath 'com.android.tools.build:gradle:3.6.1'
classpath 'com.huawei.agconnect:agcp:1.2.1.301'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}

allprojects {
repositories {
mavenLocal()
maven {
// All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
url("$rootDir/../node_modules/react-native/android")
}
maven {
// Android JSC is installed from npm
url("$rootDir/../node_modules/jsc-android/dist")
}

google()
jcenter()
maven { url 'https://www.jitpack.io' }
maven {url 'http://developer.huawei.com/repo/'}
}
}

I will supplement other frequently asked questions about this kit regularly.

If you also have other questions about this kit. Leave your comment below.