海外老版本SDK迁移新版SDK说明文档
迁移文档说明
aab出包从旧版SDK迁移到新版SDK方式 Demo参考地址
- 无需改动代码业务逻辑,功能接口统一(某些不再使用的接口已经废弃,仍调用会根据原接口回调默认值)
- FastSdk.hasFunctionCode(int xx)接口会默认返回true,如有对不同渠道开放不同功能需要对此处进行更加严谨的判断
- 部分功能码FastSdk.getSpecialFunctionCodes()得到的回调将是一个空的键值对对象
- FastSdk.invokeSpecialFunction(int functionCode, Object... params){}调用原则上不需要改动,需要注意如果针对不同渠道开启相关功能的判断是否合理,见c,d两条规则
- 信鸽推送相关功能接口均已废弃,如有调用可直接移除即可
- 迁移仅需移除老版本SDK资源,增加新版SDK依赖即可
接口基本上不需要改动,仅需要查看下此前在老版SDK中默认的统一接口功能码是否有影响即可 改动方式如下
- 删除所有aar资源
- 删除AndroidManifest.xml相关配置,参考下面配置保留需要的配置
- 引入下面提供的依赖即可
删除aar后和旧版本三方依赖
下面引入新的代码块
java
dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
//hoolai-core(必接)
implementation 'com.hoolai.access.open:hoolai-core:1.0.3.25-global'
//access-native(必接)
implementation 'com.hoolai.access.platform:access-native:0.1.2.1420'
//fangzhou(必接)
implementation 'com.hoolai.access.open.fangzhou:fangzhou:4.5.16.3'
//基础功能模块,登录/支付/分享等(必接)
implementation 'com.hoolai.oversea:hl-oversea-global:1.0.0.8'
//迁移插件,适用于 v1 升级 v2 过度插件(选接)
implementation 'com.hoolai.access.open:fast-access:1.0.0.7'
//aihelp(选接)
implementation 'com.hoolai.oversea.aihelp:aihelp:1.0.0.1'
//appsflyer(选接)
implementation 'com.hoolai.oversea.appsflyer:appsflyer:1.0.0.2'
//firebase(选接)
implementation 'com.hoolai.oversea.firebase:firebase:1.0.0.2'
//facebooklinks(选接)
implementation 'com.hoolai.oversea.links:facebooklinks:1.0.0.0'
//openInstall(选接)
implementation 'com.hoolai.oversea.opins:openInstall:1.0.0.0'
}
并检查以下AndroidManifest.xml中这些配置是否存在,注意以下参数facebook_app_id,facebook_client_token,fb_login_protocol_scheme需要在res/values/strings.xml中声明,具体参数获取找运营申请获取
xml
<!--Games Services Sign In v2 如要使用PGS登录必须配置!否则不需要加-->
<meta-data android:name="com.google.android.gms.games.APP_ID"
android:value="@string/game_services_project_id"/>
<!--Games Services Sign In v2 如要使用PGS登录必须配置!否则不需要加-->
<!--openInstall 如用到openInstall需copy,否则无需处理,其中openInstallKey需要换成正式参数-->
<meta-data
android:name="com.openinstall.APP_KEY"
android:value="openInstallKey"/>
<!--openInstall-->
<!--Facebook login share-->
<provider
android:name="com.facebook.FacebookContentProvider"
android:authorities="com.facebook.app.FacebookContentProvider1234567890"
android:exported="true" />
<meta-data
android:name="com.facebook.sdk.ApplicationId"
android:value="@string/facebook_app_id" />
<meta-data
android:name="com.facebook.sdk.ClientToken"
android:value="@string/facebook_client_token" />
<activity
android:name="com.facebook.CustomTabActivity"
android:exported="true">
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data android:scheme="@string/fb_login_protocol_scheme" />
</intent-filter>
</activity>
<!--Facebook end-->
res/values/strings.xml中Facebook参数配置项
xml
<string name="facebook_app_id">facebookAppId</string>
<string name="fb_login_protocol_scheme">fbScheme</string>
<string name="facebook_client_token">facebookClientToken</string>
<!--pgs配置-->
<string translatable="false" name="game_services_project_id">googleProjectId</string>