diff --git a/client/mobile/.env.example b/client/mobile/.env.example index 3b3848e8..901591a0 100644 --- a/client/mobile/.env.example +++ b/client/mobile/.env.example @@ -1,3 +1,4 @@ GETUI_APPID= GETUI_APPKEY= GETUI_APPSECRET= +GETUI_HUAWEI_APP_ID= diff --git a/client/mobile/.gitignore b/client/mobile/.gitignore index 16f8c307..51e9229b 100644 --- a/client/mobile/.gitignore +++ b/client/mobile/.gitignore @@ -1,3 +1,5 @@ +android/app/agconnect-services.json + # OSX # .DS_Store diff --git a/client/mobile/android/app/build.gradle b/client/mobile/android/app/build.gradle index a82fb86f..83a12c82 100644 --- a/client/mobile/android/app/build.gradle +++ b/client/mobile/android/app/build.gradle @@ -1,6 +1,7 @@ apply plugin: "com.android.application" apply plugin: "com.facebook.react" apply from: project(':react-native-config').projectDir.getPath() + "/dotenv.gradle" +apply plugin: 'com.huawei.agconnect' // huawei push import com.android.build.OutputFile @@ -104,6 +105,20 @@ android { manifestPlaceholders = [ GETUI_APPID: project.env.get("GETUI_APPID"), + + MEIZU_APP_ID : "", + MEIZU_APP_KEY : "", + + HUAWEI_APP_ID : project.env.get("GETUI_HUAWEI_APP_ID"), + + XIAOMI_APP_ID : "", + XIAOMI_APP_KEY : "", + + VIVO_APP_ID : "", + VIVO_APP_KEY : "", + + OPPO_APP_KEY : "", + OPPO_APP_SECRET : "" ] } @@ -136,6 +151,11 @@ android { } } + lintOptions { + // https://stackoverflow.com/questions/49286268/error-execution-failed-for-task-app-lintvitalrelease-any-one-can-solve-it + checkReleaseBuilds false + } + // applicationVariants are e.g. debug, release applicationVariants.all { variant -> variant.outputs.each { output -> @@ -170,6 +190,9 @@ dependencies { } else { implementation jscFlavor } + + // Push + implementation 'com.huawei.hms:push:6.9.0.300' } apply from: file("../../node_modules/@react-native-community/cli-platform-android/native_modules.gradle"); applyNativeModulesAppBuildGradle(project) diff --git a/client/mobile/android/build.gradle b/client/mobile/android/build.gradle index 16d34143..075cfc40 100644 --- a/client/mobile/android/build.gradle +++ b/client/mobile/android/build.gradle @@ -13,10 +13,15 @@ buildscript { repositories { google() mavenCentral() + + maven { + url "https://developer.huawei.com/repo/" + } } dependencies { classpath("com.android.tools.build:gradle:7.3.1") classpath("com.facebook.react:react-native-gradle-plugin") + classpath("com.huawei.agconnect:agcp:1.6.0.300") } } @@ -26,6 +31,10 @@ allprojects { url "https://mvn.getui.com/nexus/content/repositories/releases/" } + maven { + url "https://developer.huawei.com/repo/" + } + google() mavenCentral() } diff --git a/codemagic.yaml b/codemagic.yaml index cf3bc97c..4c2596da 100644 --- a/codemagic.yaml +++ b/codemagic.yaml @@ -17,6 +17,9 @@ workflows: - name: Set Android SDK location script: | echo "sdk.dir=$ANDROID_SDK_ROOT" > "./android/local.properties" + - name: Set Huawei AGCONNECT_SERVICES + script: | + echo $AGCONNECT_SERVICES | base64 --decode > "./android/app/agconnect-services.json" - name: Build Android release working_directory: client/mobile/android script: |