Dear developer,
HMS Core SDKs have undergone some version updates recently. To further improve user experience, update the HMS Core SDK integrated into your app to the latest version.
HMS Core SDKVersionLinkKeyringcom.huawei.hms:keyring-credential:6.4.0.302LinkLocation Kitcom.huawei.hms:location:6.4.0.300LinkNearby Servicecom.huawei.hms:nearby:6.4.0.300LinkContact Shieldcom.huawei.hms:contactshield:6.4.0.300LinkVideo Kitcom.huawei.hms:videokit-player:1.0.12.300LinkWireless kitcom.huawei.hms:wireless:6.4.0.202LinkFIDOcom.huawei.hms:fido-fido2:6.3.0.304
com.huawei.hms:fido-bioauthn:6.3.0.304
com.huawei.hms:fido-bioauthn-androidx:6.3.0.304LinkPanorama Kitcom.huawei.hms: panorama:5.0.2.308LinkPush Kitcom.huawei.hms: push:6.5.0.300LinkAccount Kitcom.huawei.hms:hwid:6.4.0.301LinkIdentity Kitcom.huawei.hms:identity:6.4.0.301LinkSafety Detectcom.huawei.hms:safetydetect:6.4.0.301LinkHealth Kitcom.huawei.hms:health:6.5.0.300LinkIn-App Purchasescom.huawei.hms:iap:6.4.0.301LinkML Kitcom.huawei.hms:ml-computer-vision-ocr:3.6.0.300
com.huawei.hms:ml-computer-vision-cloud:3.5.0.301
com.huawei.hms:ml-computer-card-icr-cn:3.5.0.300
com.huawei.hms:ml-computer-card-icr-vn:3.5.0.300
com.huawei.hms:ml-computer-card-bcr:3.5.0.300
com.huawei.hms:ml-computer-vision-formrecognition:3.5.0.302
com.huawei.hms:ml-computer-translate:3.6.0.312
com.huawei.hms:ml-computer-language-detection:3.6.0.312
com.huawei.hms:ml-computer-voice-asr:3.5.0.301
com.huawei.hms:ml-computer-voice-tts:3.6.0.300
com.huawei.hms:ml-computer-voice-aft:3.5.0.300
com.huawei.hms:ml-computer-voice-realtimetranscription:3.5.0.303
com.huawei.hms:ml-speech-semantics-sounddect-sdk:3.5.0.302
com.huawei.hms:ml-computer-vision-classification:3.5.0.302
com.huawei.hms:ml-computer-vision-object:3.5.0.307
com.huawei.hms:ml-computer-vision-segmentation:3.5.0.303
com.huawei.hms:ml-computer-vision-imagesuperresolution:3.5.0.301
com.huawei.hms:ml-computer-vision-documentskew:3.5.0.301
com.huawei.hms:ml-computer-vision-textimagesuperresolution:3.5.0.300
com.huawei.hms:ml-computer-vision-scenedetection:3.6.0.300
com.huawei.hms:ml-computer-vision-face:3.5.0.302
com.huawei.hms:ml-computer-vision-skeleton:3.5.0.300
com.huawei.hms:ml-computer-vision-livenessdetection:3.6.0.300
com.huawei.hms:ml-computer-vision-interactive-livenessdetection:3.6.0.301
com.huawei.hms:ml-computer-vision-handkeypoint:3.5.0.301
com.huawei.hms:ml-computer-vision-faceverify:3.6.0.301
com.huawei.hms:ml-nlp-textembedding:3.5.0.300
com.huawei.hms:ml-computer-ner:3.5.0.301
com.huawei.hms:ml-computer-model-executor:3.5.0.301LinkAnalytics Kitcom.huawei.hms:hianalytics:6.5.0.300LinkDynamic Tag Managercom.huawei.hms:dtm-api:6.5.0.300LinkSite Kitcom.huawei.hms:site:6.4.0.304LinkHEM Kitcom.huawei.hms:hemsdk:1.0.4.303LinkMap Kitcom.huawei.hms:maps:6.5.0.301LinkWallet Kitcom.huawei.hms:wallet:4.0.5.300LinkAwareness Kitcom.huawei.hms:awareness:3.1.0.302LinkCrashcom.huawei.agconnect:agconnect-crash:1.7.0.300LinkAPMcom.huawei.agconnect:agconnect-apms:1.5.2.310LinkAds Kitcom.huawei.hms:ads-prime:3.4.55.300LinkPaid Appscom.huawei.hms:drm:2.5.8.301LinkBasecom.huawei.hms:base:6.4.0.303
Required versions for cross-platform app development:
Platform: React Native
Plugin NameVersionLinkreact-native-hms-analytics6.3.2-301Linkreact-native-hms-iap6.4.0-301Linkreact-native-hms-location6.4.0-300Linkreact-native-hms-map6.3.1-304Linkreact-native-hms-push6.3.0-304Linkreact-native-hms-site6.4.0-300Linkreact-native-hms-nearby6.2.0-301Linkreact-native-hms-account6.4.0-301Linkreact-native-hms-ads13.4.54-300Linkreact-native-hms-adsprime13.4.54-300Linkreact-native-hms-availability6.4.0-303Link
Platform: Cordova (Ionic-Cordova Ionic-Capacitor)
Plugin NameVersionLinkcordova-plugin-hms-analytics
ionic-native-hms-analytics6.3.2-301Linkcordova-plugin-hms-location
ionic-native-hms-location6.4.0-300Linkcordova-plugin-hms-nearby
ionic-native-hms-nearby6.2.0-301Linkcordova-plugin-hms-account
ionic-native-hms-account6.4.0-301Linkcordova-plugin-hms-push
ionic-native-hms-push6.3.0-304Linkcordova-plugin-hms-site
ionic-native-hms-site6.4.0-300Linkcordova-plugin-hms-iap
ionic-native-hms-iap6.4.0-301Linkcordova-plugin-hms-availability
ionic-native-hms-availability6.4.0-303Linkcordova-plugin-hms-ads
ionic-native-hms-ads13.4.54-300Linkcordova-plugin-hms-adsprime
ionic-native-hms-adsprime13.4.54-300Linkcordova-plugin-hms-map
ionic-native-hms-map6.0.1-305Linkcordova-plugin-hms-ml
ionic-native-hms-ml2.0.5-303Link
Platform: Flutter
huawei_safetydetect6.4.0+301Linkhuawei_iap6.2.0+301Linkhuawei_health6.3.0+302Linkhuawei_fido6.3.0+304Linkhuawei_push6.3.0+304Linkhuawei_account6.4.0+301Linkhuawei_ads13.4.55+300Linkhuawei_analytics6.5.0+300Linkhuawei_map6.5.0+301Linkhuawei_hmsavailability6.4.0+303Linkhuawei_location6.0.0+303Linkhuawei_adsprime13.4.55+300Linkhuawei_ml3.2.0+301Linkhuawei_site6.0.1+304Link
Platform: Xamarin
Huawei.Hms.Hianalytics6.4.1.302LinkHuawei.Hms.Location6.4.0.300LinkHuawei.Hms.Nearby6.2.0.301LinkHuawei.Hms.Push6.3.0.304LinkHuawei.Hms.Site6.4.0.300LinkHuawei.Hms.Fido6.3.0.304LinkHuawei.Hms.Iap6.4.0.301LinkHuawei.Hms.Hwid6.4.0.301LinkHuawei.Hms.Ads-prime3.4.54.302LinkHuawei.Hms.Ads3.4.54.302LinkHuawei.Hms.Maps6.5.0.301Link
If you have any further questions or encounter any issues integrating any of these kits, please feel free to contact us.
RegionEmailEurope[email protected]Asia Pacific[email protected]Latin America[email protected]Middle East & Africa[email protected]wei.comRussia[email protected]
Related
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:
Code:
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.
Introduction
This article is based on Multiple HMS services application. I have created Hotel Booking application using HMS Kits. We need mobile app for reservation hotels when we are traveling from one place to another place.
In this article, I have implemented Analytics kit and Site Kit.
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
Flutter setup
Refer this URL to setup Flutter.
Software Requirements
1. Android Studio 3.X
2. JDK 1.8 and later
3. SDK Platform 19 and later
4. Gradle 4.6 and later
Steps to integrate service
1. We need to register as a developer account in AppGallery Connect
2. Create an app by referring to Creating a Project and Creating an App in the Project
3. Set the data storage location based on current location.
4. Enabling Required Services: Analytics and Site Kit.
5. Generating a Signing Certificate Fingerprint.
6. Configuring the Signing Certificate Fingerprint.
7. Get your agconnect-services.json file to the app root directory.
Development Process
Create Application in Android Studio.
1. Create Flutter project.
2. App level gradle dependencies. Choose inside project Android > app > build.gradle.
Code:
apply plugin: 'com.android.application'
apply plugin: 'com.huawei.agconnect'
Root level gradle dependencies
Code:
maven {url 'https://developer.huawei.com/repo/'}
classpath 'com.huawei.agconnect:agcp:1.4.1.300'
Add the below permissions in Android Manifest file.
XML:
<manifest xlmns:android...>
...
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<application
...
</manifest>
3. Refer below URL for cross-platform plugins. Download required plugins.
https://developer.huawei.com/consum...y-V1/flutter-sdk-download-0000001051088628-V1
4. On your Flutter project directory find and open your pubspec.yaml file and add library to dependencies to download the package from pub.dev. Or if you downloaded the package from the HUAWEI Developer website, specify the library path on your local device. For both ways, after running pub get command, the plugin will be ready to use.
Code:
name: hotelbooking
description: A new Flutter application.
publish_to: 'none' # Remove this line if you wish to publish to pub.dev
version: 1.0.0+1
environment:
sdk: ">=2.7.0 <3.0.0"
dependencies:
flutter:
sdk: flutter
shared_preferences: ^0.5.12+4
bottom_navy_bar: ^5.6.0
cupertino_icons: ^1.0.0
provider: ^4.3.3
huawei_ads:
path: ../huawei_ads/
huawei_account:
path: ../huawei_account/
huawei_site:
path: ../huawei_site/
huawei_analytics:
path: ../huawei_analytics/
dev_dependencies:
flutter_test:
sdk: flutter
flutter:
uses-material-design: true
assets:
- assets/images/
5. We can check the plugins under External Libraries directory.
6. Open main.dart file to create UI and business logics.
Analytics kit
Account kit is valuable in terms of analysis and reporting that we use frequently in our application. Using analytics we can check user behavior custom events and predefined events.
Service Features
By integrating the HMS Core Analytics SDK, you can:
1. Collect and report custom events through coding.
2. Set a maximum of 25 user attributes.
3. Automate event collection and session calculation with predefined event IDs and parameters.
HUAWEI Analytics Kit identifies users and collects statistics on users by an anonymous application identifier (AAID). The AAID is reset in the following scenarios:
1. Uninstall or reinstall the app.
2. The user clears the app data.
After the AAID is reset, the user will be counted as a new user.
There are 3 types of events:
Automatically collected
Predefined
Custom
Automatically collected events are collected from the moment you enable the kit in your code. Event IDs are already reserved by HUAWEI Analytics Kit and cannot be reused.
Predefined events include their own Event IDs which are predefined by the HMS Core Analytics SDK based on common application scenarios. The ID of a custom event cannot be the same as a predefined event’s ID. If so, you will create a predefined event instead of a custom event.
Custom events are the events that you can create for your own requirements.
Integration
What is AAID?
Anonymous device ID opened to third-party apps. Each app is allocated with a unique AAID on the same device, so that statistics can be collected and analyzed for different apps.
Code:
void getAAID() async{
String aaid = await mAnalytics.getAAID();
print(aaid);
}
Custom Events
Such events can be used to meet personalized analysis requirements that cannot be met by automatically collected events and predefined events.
Note: The ID of a custom event cannot be the same as that of a predefined event. Otherwise, the custom event will be identified as a predefined event
Adding Custom Events
In AppGallery Connect from left side panel open Huawei Analytics > Management > Events
Code:
void customEvent() async {
String name = "Custom";
dynamic value = {'customEvent': "custom Event posted"};
await _hmsAnalytics.onEvent(name, value);
}
Predefined Events
Such events have been predefined by the HMS Core Analytics SDK based on common application scenarios. It is recommended you use predefined event IDs for event collection and analysis.
Code:
void logEvent() async{
String name = HAEventType.SUBMITSCORE;
dynamic value = {HAParamType.SCORE: 15};
await mAnalytics.onEvent(name, value);
}
Site kit
This kit basically provide users with easy and reliable access to related locations and places. With the HMS Site kit we can provide them below features.
1. We can take place suggestions according to the keywords that we have determined.
2. According to the location of the user’s device, we can search for nearby places.
3. We can get detailed information about a location.
4. We can learn the human readable address information of a coordinate point.
5. We can learn the time period where a coordinate point is found.
HMS Site kit – Nearby Search
We can search for many places such as tourist attractions, restaurants, schools and hotels by entering information such as keywords, coordinates. Using this kit we can restrict to specific types using poiType, we can easily access many different information about places such as name, address, coordinates, phone numbers, pictures, address details. Within the Address Detail model, we can easily access information about the address piece by piece through different variables and change the way the address’ notation as we wish.
We need to create a NearbySearchRequest object to perform searching by keyword. We will perform the related search criteria on this NearbySearchRequest object.
While performing this operation, we need set many different criteria as we see in the code snippet. Let us examine the duties of these criteria one by one
1. Query: Used to specify the keyword that we will use during the search process.
2. Location: It is used to specify latitude and longitude values with a Coordinate object to ensure that search results are searched as closely to the location that we want.
3. Radius: It is used to make the search results within in a radius determined in meters. It can take values between 1 and 50000, and its default value is 50000.
4. CountryCode: It is using to limit search results according to certain country borders.
5. Language: It is used to specify the language that search results have to be returned. If this parameter is not specified, the language of the query field we have specified in the query field is accepted by default. In example code snippet in above, the language of device has been added automatically in order to get a healthy result.
6. PageSize: Results return with the Pagination structure. This parameter is used to determine the number of Sites to be found in each page.
7. PageIndex: It is used to specify the number of the page to be returned with the Pagination structure.
Code:
void loadNearBy(String value) async {
SearchService service = new SearchService();
NearbySearchRequest searchRequest = NearbySearchRequest();
searchRequest.language = "en";
searchRequest.query = value;
searchRequest.poiType = LocationType.RESTAURANT;
searchRequest.location = Coordinate(lat: 12.976507, lng: 77.7356);
searchRequest.pageIndex = 1;
searchRequest.pageSize = 15;
searchRequest.radius = 5000;
NearbySearchResponse response = await service.nearbySearch(searchRequest);
if (response != null) {
setState(() {
mSitesList = response.sites;
});
}
}
Result
Tips & Tricks
1. Download latest HMS Flutter plugin.
2. Enable Auto refresh in AppGallery connect it will automatically update events in console
3. Whenever you updated plugins, click on pug get.
Conclusion
We implemented simple hotel booking application using Analytics kit and Site kit in this article. We have learned how to record events and monitor them in AppGallery Connect and also we have learned how to integrated site kit and how nearby search will work.
Thank you for reading and if you have enjoyed this article, I would suggest you to implement this and provide your experience.
Reference
Analytics Kit URL
Site Kit URL
Read full article.
A pop-up is repeatedly displayed to users when they sign in to the game, asking them to install or update to the latest version of HMS Core.
Log Analysis
Search for Failed to find HMS apk in the Logcat log file. Multiple results will be returned.
The following log indicates that HMS Core (APK) is not installed when the initialization API init is called to check for it:
XML:
Initializing JosAppsClient
I/HMSSDK_HuaweiApiManager: sendRequest
I/HMSSDK_BaseHmsClient: ====== HMSSDK version: 40000300 ======
I/HMSSDK_BaseHmsClient: Enter connect, Connection Status: 1
I/HMSSDK_BaseHmsClient: connect minVersion:30000000
E/HMSSDK_HMSPackageManager: skip package com.huawei.hwid for metadata is null
E/HMSSDK_HMSPackageManager: Failed to find HMS apk
The following log indicates that HMS Core (APK) is not installed when the sign-in API signIn is called to check for it:
I/HMSSDK_[HUAWEIIDSDK]HwIdSignInClientHub: onCreate
I/HMSSDK_HmsAPKVersionCheckUtil: ====== HMSSDK version: 40000300 ======
I/HMSSDK_HmsAPKVersionCheckUtil: check minVersion:30000000
E/HMSSDK_HMSPackageManager: skip package com.huawei.hwid for metadata is null
E/HMSSDK_HMSPackageManager: Failed to find HMS apk
I/HMSSDK_AvailableAdapter: main thread invokes resolution.
I/HMSSDK_AvailableAdapter: startResolution
According to the logs, both the init and signIn APIs find that HMS Core (APK) is not installed, and thus two pop-ups are displayed.
Solution
1. Update the integrated Game Service SDK to 5.0.1.301 or later. For more details, please refer to the official materials.
2. If you prefer not to update the SDK, you can also change the sequence for calling the sign-in and initialization APIs, so that the initialization API is called after the sign-in is successful.
This will ensure that the pop-up displays only once.
SymptomWhen I submitted my game, which has HMS Core capabilities integrated, for review, it was rejected due to incorrect provider name during HMS Core (APK) update.
I use Android Studio and I can’t find any solutions for this problem in the official documentation, so I contacted Huawei technical support instead.
SolutionI was told that the provider name does not need to be manually configured for HMS Core (APK) updates for version 4.0 and later. The provider name is automatically configured in the manifest file after game packaging. To check whether the configuration exists, I would need to decompile the game package and check whether the following configurations exist under the application element in the manifest file:
Code:
<provider
android:name=”com.huawei.hms.update.provider.UpdateProvider”
<! — Replace xxx.xxx.xxx with the actual game package name. →
android:authorities=”xxx.xxx.xxx.hms.update.provider”
android:exported=”false”
android:grantUriPermissions=”true” >
</provider>
<provider
android:name=”com.huawei.updatesdk.fileprovider.UpdateSdkFileProvider”
<! — Replace xxx.xxx.xxx with the actual game package name. →
android:authorities=”xxx.xxx.xxx.updateSdk.fileProvider”
android:exported=”false”
android:grantUriPermissions=”true”>
</provider>
If the configurations do not exist, packaging errors or other exceptions may have occurred. In this case, you would need to manually add the provider name.
please! Install gms native harmonyos 2.0.0.218