-
Notifications
You must be signed in to change notification settings - Fork 7
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 pack
from 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.json
from App Gallery Connect and copy it to theandroid/app
folder - 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.gradle
addmaven { url 'https://developer.huawei.com/repo/' }
forrepositories
insidebuildscript
andallprojects
buildscript {
repositories {
...
+ maven { url 'https://developer.huawei.com/repo/' }
}
...
}
allprojects {
repositories {
...
+ maven { url 'https://developer.huawei.com/repo/' }
}
}
- In the
android/build.gradle
remove 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