Ver Fonte

新增服务器参数

zhipeng há 8 meses atrás
pai
commit
147b60a552

+ 5 - 1
build-templates/android/proj/gradle.properties

@@ -92,4 +92,8 @@ yidun_register_business_id=5207bea0195a35f67d173765f1b3872b
 # wechat appId
 wechat_app_id=wx3712e7207686dc32
 # aplipay appId
-alipay_app_id=2021005120615288
+alipay_app_id=2021005120615288
+# production server host
+prod_server_host=https://project-api.atmob.com
+# test server host
+test_server_host=https://central-test.atmob.com

+ 5 - 1
build/android/proj/gradle.properties

@@ -90,4 +90,8 @@ yidun_register_business_id=5207bea0195a35f67d173765f1b3872b
 # wechat appId
 wechat_app_id=wx3712e7207686dc32
 # aplipay appId
-alipay_app_id=2021005120615288
+alipay_app_id=2021005120615288
+# production server host
+prod_server_host=https://project-api.atmob.com
+# test server host
+test_server_host=https://central-test.atmob.com

+ 4 - 0
native/engine/android/app/build.gradle

@@ -93,6 +93,8 @@ android {
             buildConfigField "String", "YIDUN_REGISTER_BUSINESS_ID", "\"$yidun_register_business_id\""
             buildConfigField "String", "WECHAT_APP_ID", "\"$wechat_app_id\""
             buildConfigField "String", "ALIPAY_APP_ID", "\"$alipay_app_id\""
+            buildConfigField "String", "PROD_SERVER_HOST", "\"$prod_server_host\""
+            buildConfigField "String", "TEST_SERVER_HOST", "\"$test_server_host\""
         }
 
         debug {
@@ -109,6 +111,8 @@ android {
             buildConfigField "String", "YIDUN_REGISTER_BUSINESS_ID", "\"$yidun_register_business_id\""
             buildConfigField "String", "WECHAT_APP_ID", "\"$wechat_app_id\""
             buildConfigField "String", "ALIPAY_APP_ID", "\"$alipay_app_id\""
+            buildConfigField "String", "PROD_SERVER_HOST", "\"$prod_server_host\""
+            buildConfigField "String", "TEST_SERVER_HOST", "\"$test_server_host\""
         }
     }
 

+ 1 - 0
native/engine/android/app/src/com/cocos/game/GameApp.java

@@ -13,6 +13,7 @@ public class GameApp extends Application {
     public void onCreate() {
         super.onCreate();
         AtmobCocosBridge.getInstance().init(this, new Config.Builder()
+                .serverHost(BuildConfig.PROD_SERVER_HOST)
                 .debug(BuildConfig.DEBUG)
                 .testChannel(BuildConfig.TEST_CHANNEL)
                 .appKey(BuildConfig.ATMOB_CENTRAL_APP_KEY)