-
Couldn't load subscription status.
- Fork 9
How to build application for Huawei with mobile messaging plugin
We don't have support for Huawei in MobileMessaging plugin yet, however on a separate branch - huawei_wrapper we've demonstrated which changes need to be done on the plugin wrapper code and how to setup everything in Example app to build it for Huawei platform.
You can check the diff between master branch (6.3.4 version) and huawei_wrapper branch
- Checkout branch locally
- Make a local plugin version by calling
npm packfrom folder where you checked out the branch - Install local version of the plugin
npm install <path to the .tgz file>
Notice: All changes on the current branch are done for the 6.3.4 plugin version, if you are using other version, you may try to apply changes yourself on the version you need, by checking changes on huawei_wrapper branch.
- Provide HMS App ID to the
android/app/src/res/values/strings.xml. It could be taken from Huawei Developer Console - Application settings<resources> ... <string name="app_id">HMS App ID</string> </resources> - Download file
agconnect-services.jsonfrom App Gallery Connect and copy it to theandroid/appfolder - Provide signing configs as it done in Example app
- Setup application at Infobip portal for Huawei platform, if you haven't done it already.
- Apply 'com.huawei.agconnect' plugin instead of 'com.google.gms.google-services' in
android/app/build.gradle- link to the Example
- apply plugin: 'com.google.gms.google-services'
+ apply plugin: 'com.huawei.agconnect'- In the
android/build.gradleaddmaven { url 'https://developer.huawei.com/repo/' }forrepositoriesinsidebuildscriptandallprojects
buildscript {
repositories {
...
+ maven { url 'https://developer.huawei.com/repo/' }
}
...
}
allprojects {
repositories {
...
+ maven { url 'https://developer.huawei.com/repo/' }
}
}- In the
android/build.gradleremove classpath for Google Messaging Services Plugin -classpath 'com.google.gms:google-services'and add classpath for App Gallery Connectclasspath 'com.huawei.agconnect:agcp:1.6.0.300'- link to the Example
- classpath 'com.google.gms:google-services:4.3.10'
+ classpath 'com.huawei.agconnect:agcp:1.6.0.300'Notice: Would be not worse to make cleanups
./gradlew clean,npm run --clear-cache, if you are oprning project in Android studio you can makeFile->Invalidate Caches
If you have any questions or suggestions, feel free to send an email to [email protected] or create an issue.
- Library events
- Server errors
- Users and installations
- Messages and notifications management
- Inbox
- Privacy settings
- In‐app chat
- WebRTC Calls and UI
- Migration guides
- JSON Web Token (JWT) structure and generation example