01/10/2025 10:53:00
Solution
Warning: When upgrading the version, you must pay attention to the content of the upgrade guide.When upgrading from a lower version across several versions, you should pay attention to all the changes in the intermediate versions.
V5.31.000 Upgrade Guidelines
1. Functional changes
1.1 Precautions about Android upgrading Bugly SDK 4.1.13.6
1.1.1 Function description
Since Bugly SDK 4.1.13.6, the invoker must pass the smartphone model to Bugly.
1.1.2 Configuration description
A game can set the Model
field through SetSensitiveInfo. For details, refer to: Description of SetSensitiveInfo Interface.
1.1.3 Precautions
- Model: neither null nor empty string
1.2 Precautions about Android upgrading Garena SDK 4.0.28
1.2.1 Configuration content and path adjustment of authenticator.xml
For details, please refer to https://docs.msdk.qq.com/v5/zh-CN/Channel/Garena/?h=authenticator.xml
1.2.2 Garena SDK introduces kotlin plugin compilation, so the game project needs to adapt to it
For details, please refer to https://docs.msdk.qq.com/v5/zh-CN/Channel/Garena/?q=kotlin
1.2.3 No longer support the silent sharing type
1.3 Precautions about iOS upgrading Garena SDK 4.0.19
Upgrading Garena to version 4.0.19 requires compiling the program with XCode 14 and above. Moreover, after being upgraded to this version, Garena should at least support iOS version to be changed to iOS 11. It is necessary to modify the Minimum Deployments
parameter to version 11.0 and above in the XCode project. For details, please refer to Garena Documentation.
1.4 Android 13 Behavior Change Guidelines
1.4.1 Refine media permissions
In Android API 33, the android.permission.READ_EXTERNAL_STORAGE
permission is no longer valid
To access media files created by other applications, it is necessary to increase the read permissions for media images, media videos and media audio files as needed:
android.permission.READ_MEDIA_IMAGES
android.permission.READ_MEDIA_VIDEO
android.permission.READ_MEDIA_AUDIO
MSDK has added these permissions by default, and APP can delete some of them based on the actual usage
For details, please refer to Android 13 Behavior Changes and Android Storage Permission.
1.4.2 Add push permission
Add push permission in Android 13
APP must add the new POST message permission to display push messages:
android.permission.POST_NOTIFICATIONS
Generally, SDK in use carry this permission by default, so APP does not require special processing for this
To ensure the normal operation of the push function on Android 13, it is necessary to follow [Android Documentation](https://developer.android.com/training/permissions/requesting?hl=zh-cn) to apply for the permission.1.4.3 Permission must be declared when Google AD ID is used
In Android 13, Google's AD_ID permission must be declared in Androidmanifest so as to obtain Google AD ID normally
If you want to use the Google AD ID feature, you need to add the corresponding permission:
com.google.android.gms.permission.AD_ID
Generally, SDK in use carry this permission by default, so APP does not require special processing for this
Warning: Adjust, AppsFlyer, Facebook, etc. all carry this permission by default. If you need to remove it, please contact us for confirmation
1.5 Precautions about access to UnrealEngine
The minSdkVersion supported by MSDK is 15. Because the minSdkVersion of Line, Firebase and Vng SDK is greater than 15, the overrideLibrary configuration is removed from the corresponding plugin UPL file in the entire MSDK UnrealEngine package, so APP is required to configure it by itself.
1.6 The data reporting function of Firebase/AppsFlyer/Adjust supports the dynamic switching capability
1.6.1 Configuration description of Firebase channel
1.6.1.1 Android
If the game needs to disable the data collection function before the user agrees, please set the firebase_analytics_collection_enabled
value as false
in the Application tag of AndroidManifest.xml of the application. For example:
<meta-data android:name="firebase_analytics_collection_enabled" android:value="false" />
After users agree to the relevant privacy policy, if a game needs to enable the data reporting function of the Firebase channel, it can invoke the corresponding interface
//C# interface
string channels = "Firebase";
MSDKReport.EnablePluginReport(channels,true);
//C++ interface
string channels = "Firebase";
MSDKReport::EnablePluginReport(channels,true);
If you want to disable the data reporting function of the relevant channel again, you can invoke the corresponding interface again, for example:
//C# interface
string channels = "Firebase";
MSDKReport.EnablePluginReport(channels,false);
//C++ interface
string channels = "Firebase";
MSDKReport::EnablePluginReport(channels,false);
1.6.1.2 iOS
If the game needs to disable the data collection function before the user agrees, please set the FIREBASE_ANALYTICS_COLLECTION_ENABLED
value as No
(Boolean value) in the info.plist file of the application. For example:
<key>FIREBASE_ANALYTICS_COLLECTION_ENABLED</key>
<false/>
After users agree to the relevant privacy policy, if a game needs to enable the data reporting function of the Firebase channel, it can invoke the corresponding interface, for example:
//C# interface
string channels = "Firebase";
MSDKReport.EnablePluginReport(channels,true);
//C++ interface
string channels = "Firebase";
MSDKReport::EnablePluginReport(channels,true);
If you want to disable the data reporting function of the relevant channel again, you can invoke the corresponding interface again, for example:
//C# interface
string channels = "Firebase";
MSDKReport.EnablePluginReport(channels,false);
//C++ interface
string channels = "Firebase";
MSDKReport::EnablePluginReport(channels,false);
1.6.2 Configuration description of AppsFlyer and Adjust channel
If the game needs to disable the data collection function before the user agrees, please configure MSDK_DEFAULT_DISABLE_REPORT_LIST in the MSDKConfig.ini file. For example, if you don't want to make the initialization and reporting of AppsFlyer and Adjust before the user agrees, you can configure as follows:
MSDK_DEFAULT_DISABLE_REPORT_LIST=AppsFlyer,Adjust
After users agree to the relevant privacy policy, if a game needs to enable the data reporting function of the corresponding channel, it can invoke the corresponding interface, for example:
//C# interface
string channels = "AppsFlyer,Adjust";
MSDKReport.EnablePluginReport(channels,true);
//C++ interface
string channels = "AppsFlyer,Adjust";
MSDKReport::EnablePluginReport(channels,true);
If you want to disable the data reporting function of the relevant channel again, you can invoke the corresponding interface again, for example:
//C# interface
string channels = "AppsFlyer,Adjust";
MSDKReport.EnablePluginReport(channels,false);
//C++ interface
string channels = "AppsFlyer,Adjust";
MSDKReport::EnablePluginReport(channels,false);
Note: Restarting reporting by AppsFlyer is not immediate and will only take effect after APP re-enters the foreground or restarts the process.
2. Version change
Android
- TBS (overseas version) is upgraded to 44222
- Bugly is upgraded to 4.1.13.6
- Facebook is upgraded to 13.0.0
- Firebase Messaging is upgraded to 23.0.6
- Adjust is upgraded to 4.31.1
- Garena is upgraded to 4.0.28
iOS
- QIMEI is upgraded to 1.1.8.7
- Garena is upgraded to 4.0.19
V5.30.002 Upgrade Guidelines
1. Functional changes
1.1 MSDKCore network request optimization
1.2 TDM decoupling
V5.30.001 Upgrade Guidelines
1. Functional changes
1.1 Add the capability to disable MSDK logs
1.1.1 Function description
Through proper configuration, MSDK can achieve no log output.
1.1.2 Configuration description
Add the MSDK_DISABLE_LOG configuration in MSDKConfig.ini. When the switch is set to 1, no MSDK logs will be outputted; when it is 1, it takes effect for all channels, with priority greater than the MSDK_DEBUG configuration field, commented out by default.
1.2 Precautions about iOS upgrading Facebook SDK 15.0.0
- It is recommended to package the program with XCode 14 or above. Packaging the program with XCode versions earlier than XCode 14 may result in undefined symbols in Swift related libraries
- It is needed to configure FacebookClientToken in info.plist, and APP needs to view the value of the token on Facebook's management end by itself
- The minimum version of iOS supported by Facebook SDK 15.0.0 is 12.0
- Not support armv7 architecture
1.3 Precautions about Android upgrading AppsFlyer SDK 6.10.0
MSDKAppsFlyer doesn't integrate Xiaomi GetApps store referrer. If APP needs to add it, please refer to AppsFlyer documentation for relevant matters: https://dev.appsflyer.com/hc/docs/install-android-sdk.
1.4 Android Firebase adds the function for adding local push capability and removing local push capability
1.4.1 Add local push capability
1.4.1.1 Function description
Local push can be added when the game is not running. Users can click on Push
to invoke the specified activity. If no activity is specified, mainActivity will be invoked by default.
1.4.1.2 Interface description
C#
public static void AddLocalNotification(string channel, MSDKLocalNotification localNotification);
C++
static void AddLocalNotification(const String &channel,
const MSDKLocalNotification &localNotification);
1.4.1.3 Demo code
C#
MSDKLocalNotification message = new MSDKLocalNotification ();
message.Content = "There is an event. Everyone hurries to gather at the gate of the Royal City";
message.Title = "MSDK Push Android Test";
// If it is less than the current time, notify immediately
message.Date = DateTime.Now.ToString ("yyyyMMdd");
message.Hour = DateTime.Now.Hour.ToString ();
message.Min = (DateTime.Now.Minute - 1).ToString ();
MSDKPush.AddLocalNotification ("Firebase", message);
C++
MSDKLocalNotification message;
message.iconType = 0;
message.lights = 0;
message.ring = 0;
message.vibrate = 0;
message.content = "There is an event. Everyone hurries to gather at the gate of the Royal City";
message.title = "MSDK Push Test";
time_t rawTime = 0;
time(&rawTime);
struct tm * timeInfo;
timeInfo = localtime(&rawTime);
std::string dateStr;
std::stringstream ss;
dateStr.append(IntToString(timeInfo->tm_year + 1900));
dateStr.append(IntToString(timeInfo->tm_mon + 1));
dateStr.append(IntToString(timeInfo->tm_mday));
message.date = dateStr;
message.hour = IntToString(timeInfo->tm_hour);
message.min = IntToString(timeInfo->tm_min);
// If it is less than the current time, notify immediately
MSDKPush::AddLocalNotification ("Firebase", message);
1.4.1.4 Data structure description
The meaning of each parameter and the currently supported custom content are as follows:
Android struct description of MSDKLocalNotification
Member variable Name | Type | Description | Whether or not to support change |
---|---|---|---|
Type | int | Defaulted as the notification type | |
ActionType | int | Behavior after clicking on the Push button; open activity or app itself by default |
|
IconType | int | Notification bar icon; 0 is an in-app icon, and 1 is a custom icon, defaulted as 0 | Yes |
Lights | int | Whether it is a breathing light (0: No; 1: Yes; defaulted as 1) | Yes |
Vibrate | int | Whether to vibrate (0: No; 1: Yes; defaulted as 1) | Yes |
StyleID | int | Whether to overwrite the original save settings for build_id; 1: override, 0: not override | |
BuilderID | long | Set message style, defaulted as 0 or not set | |
Content | string | Set message content | Yes |
CustomiContent | string | Message custom key-value | Yes |
Activity | string | Set to invoke the application page | Yes |
PackageDownloadUrl | string | Not supported by the current channel | |
PackageName | string | Not supported by the current channel | |
IconRes | string | In-app icon file name | Yes |
Date | string | Set the message date in the format: 20140502 | Yes |
Hour | string | Set the hour (24-hour format) for message triggering, for example: 22 represents 10pm | Yes |
Min | string | Get the minute when the message was triggered, for example: 05 represents 05 minutes | Yes |
Title | string | Set message title | Yes |
Intent | string | Not supported by the current channel | |
Url | string | Not supported by the current channel | |
RingRaw | string | Specify the in-app sound (msdk. mp3), such as: msdk | Yes |
SmallIcon | string | Specify the small image of the status bar (msdknotify.png), such as: msdknotify.png | Yes |
1.4.1.5 Instructions for use
- To use the local push function of Firebase, you need to first register the Firebase channel. Please follow the relevant guidelines Register Push and Cancel Push to register the channel
- If you need to set up a notification channel, please add the following configuration in Androidmanifest
<meta-data
android:name="LOCAL_PUSH_CHANNEL"
android:value="MSDK-Test"
/>
<meta-data
android:name="LOCAL_PUSH_CHANNEL_ID"
android:value="MSDK-Test"
/>
This configuration is suitable for API 26 and higher devices. If this field is not configured, the default notification channel name of APP in API 26 and higher devices is MSDK-Firebase. For more information on notification channels, please refer to the official Android documentation: Create and Manage Notification Channels.
- If it is needed to receive push messages normally when the process is killed, the APP developer needs to guide users to enable the self-start permission of APP. Different smartphone vendors have different ROMs and corresponding functional pages are also different, so adaptation needs to be made for different smartphone vendors.
1.4.1.6 Handle callbacks
Support message display and the message-clicking callback. Please ensure that you have registered relevant callbacks according to the guidelines: Register Callbacks.
1.4.2 Remover local push capability
1.4.2.1 Function description
Remove all added local pushes
1.4.2.2 Interface description
C#
public static void ClearLocalNotifications(string channel);
C++
static void ClearLocalNotifications(const String &channel);
1.5 Precautions about Android upgrading TPNS SDK 1.3.9.0
1.5.1 MSDKXG plugin removes the following nodes from AndroidManifest.xml
<service
android:name="com.heytap.mcssdk.PushService"
android:permission="com.coloros.mcs.permission.SEND_MCS_MESSAGE">
<intent-filter>
<action android:name="com.coloros.mcs.action.RECEIVE_MCS_MESSAGE"/>
</intent-filter>
</service>
<service
android:name="com.heytap.mcssdk.AppPushService"
android:permission="com.heytap.mcs.permission.SEND_MCS_MESSAGE">
<intent-filter>
<action android:name="com.heytap.mcs.action.RECEIVE_MCS_MESSAGE"/>
</intent-filter>
</service>
1.5.2 MSDKXG plugin adds the following nodes from AndroidManifest.xml
<service
android:name="com.heytap.msp.push.service.CompatibleDataMessageCallbackService"
android:permission="com.coloros.mcs.permission.SEND_MCS_MESSAGE">
<intent-filter>
<action android:name="com.coloros.mcs.action.RECEIVE_MCS_MESSAGE"/>
</intent-filter>
</service>
<service
android:name="com.heytap.msp.push.service.DataMessageCallbackService"
android:permission="com.heytap.mcs.permission.SEND_PUSH_MESSAGE">
<intent-filter>
<action android:name="com.heytap.mcs.action.RECEIVE_MCS_MESSAGE"/>
<action android:name="com.heytap.msp.push.RECEIVE_MCS_MESSAGE"/>
</intent-filter>
</service>
1.5.3 Changes in OPPO channel dependency mode
OPPO channel dependency mode has been modified from gradle to jar, and new jar packages have been added: msdk_oppo_adapter.jar and oppo-3.1.0-msdk.jar, both of which need to be imported into the project engineering together.
2. Version change
Android
- WeChat OpenSDK is upgraded to 6.8.24
- TPNS is upgraded to 1.3.9.0
- AppsFlyer is upgraded to 6.10.0
iOS
- Facebook is upgraded to 15.0.0
- QIMEI is upgraded to 1.1.8.3
V5.30.000 Upgrade Guidelines
1. Functional changes
1.1 Agented games: Manually update WeChat version number in the compilation script
As for WeChat-side synchronization, due to maven warehouse related problems, agented games cannot draw WeChat OpenSDK 6.8.23. To use the agented game of the current version, you need to find the corresponding additions.gradle file in the WeChat plugin directory and replace 6.8.23 with 6.8.24.
dependencies {
compile fileTree(include: ['*.jar', '*.aar'], dir: 'libs')
compile 'com.tencent.mm.opensdk:wechat-sdk-android:6.8.24'
compile rootProject.ext.androidSupportDependencies.v4
}
1.2 Add WeChat native sharing capability
1.2.1 Function description
MSDK encapsulates the WeChat native sharing type and can share messages to WeChat sessions and WeChat Moment.
1.2.2 Demo code
Reuse MSDKFriend.SendMessage and MSDKFriend.Share interfaces. The input parameters are MSDKFriendReqInfo info and string channel. channel
is fixed as "WeChat"; info.Type parameter is set as FriendReqType.Friend_REQ_WX_NATIVE_GAME_PAGE; info.ExtraJson is passed in by APP itself and transmits isVideo, videoDuration, shareData and other parameters. For details, please refer to WeChat native sharing interface documentation: https://iwiki.woa.com/pages/viewpage.action?pageId=4007456114
Take sharing messages with friends as an example:
c# code:
var reqInfo = new MSDKFriendReqInfo();
reqInfo.Type = (int)FriendReqType.Friend_REQ_WX_NATIVE_GAME_PAGE;
reqInfo.Title = "WeChat native page sharing"; //Title
reqInfo.Desc = "WeChat sharing experience optimization"; //Summary information
reqInfo.ThumbPath = GetFileFromDisk ("test4.jpg"); // Fill in the corresponding cover image path
reqInfo.ExtraJson = "{\"message_action\":\"\",\"game_data\":\"Game Data\",\"media_tag_name\":\"MSG_INVITE\",\"isVideo\":0,\"videoDuration\":0,\"shareData\":\"{\\\"appid\\\":\\\"wx95a3a4d7c627e07d\\\",\\\"floating_layer\\\":{\\\"floating_layer_id\\\":23},\\\"game_launch\\\":{\\\"message_ext\\\":\\\"xxxx\\\"},\\\"share_image_tpl\\\":{\\\"share_img_list\\\":[{\\\"img_url\\\":\\\"http://p.qpic.cn/wxapp/98Nz5LFElxwa1SvRtFFOIV046OU5pA2PWicuC3rDosgy6D1wb9oAGRAYnYfVh6gNOyKzzEc1LiboQ/c456\\\",\\\"width\\\":300,\\\"height\\\":300}],\\\"user_card\\\":{\\\"content\\\":\\\"What kind of bird is this? It's so lovely and cute. I fall in love with it at a glance. The park is a magical place. Display up to two lines of words. When the word count is too long, excessive words will be automatically omitted...\\\"}}}\"}"; //Transmission parameter
MSDKFriend.SendMessage (reqInfo, "WeChat");
1.3 Add the capability for invoking QQ miniApp
1.3.1 Function description
MSDK encapsulates the QQ miniApp invocation interface.
1.3.2 Demo code
Reuse MSDKFriend.SendMessage interface. The input parameters are MSDKFriendReqInfo info and string channel. info.Type parameter is set as FriendReqType.FRIEND_REQ_PULL_UP_MINI_APP, and info.ExtraJson passed in by APP itself,
c# code:
var reqInfo = new MSDKFriendReqInfo();
reqInfo.Type = (int)FriendReqType.FRIEND_REQ_PULL_UP_MINI_APP;
reqInfo.ExtraJson = "{\"mini_appid\":\"1109878856\", \"mini_path\":\"pages/component/pages/launchApp813/launchApp813?1=2&2=4\",\"mini_program_type\":3}"; // mini_appid: miniApp's AppID (note: miniApp must be bound to the shared App on the QQ-Connect platform); mini_path: the display path of miniApp; the default miniApp homepage will be displayed if this field is left blank; mini_program_type: the default type of miniApp, defaulted as 3 (0, development version; 1, test version; 3, release version; 4, preview version)
MSDKFriend.SendMessage (reqInfo, "QQ");
1.4 TPNS Android has restored vendor channel push capabilities
TPNS Android has been updated to 1.3.7.2 and has restored vendor channel push capabilities
1.5 Instructions on the update of Beacon version
1.5.1 Precautions about Beacon Android package integration
Refer to: https://doc.weixin.qq.com/doc/w3_AOQADAbbACgqJ91uqbMRnKuobyvnZ?scode=AJEAIQdfAAosBHFrxzAOQADAbbACg
1.5.2 Beacon iOS version adds an interface to transmit fields to Beacon
1.5.2.1 Function description
Beacon iOS version has been updated to 4.2.76.20, and Beacon no longer collects idfa, wifiName and wifimac. Therefore, MSDK provides a privacy setting interface to transmit fields such as idfa and fill them into Beacon.
1.5.2.2 Interface example
MSDKSensitive::SetSensitiveInfo("{\"WiFiMacAddress\":\"xxx\", \"WiFiName\":\"xxx\", \"Idfa\":\"xxx\"}");
1.5.2.3 Precautions
- **It is needed to add the system dependency library Network.framework and set it as optional**
- Beacon iOS currently supports WiFiMacAddress, WiFiName and Idfa fields. For its specific usage, please refer to the "Special Information Settings" interface in https://docs.msdk.qq.com/v5/en/Access/iOS.html
1.6 Instructions on the update of Qimei version
In Qimei Android 1.2.17.2, replace libbeaconid.so (Qimei SDK so file) with libqimei.so.
2. Version change
Android
- WeChat OpenSDK is upgraded to 6.8.23
- QQ-Connect OpenSDK is upgraded to 3.5.14
- QIMEI is upgraded to 1.2.17.2
- TPNS is upgraded to 1.3.7.2
iOS
- WeChat OpenSDK is upgraded to 2.0.1
- QQ-Connect OpenSDK is upgraded to 3.5.14
- Appsflyer is upgraded to 6.10.0
- Beacon is upgraded to 4.2.76.20
V5.29.000 Upgrade Guidelines
1. Precautions about updating V5.29 version
Starting from V5.29, MSDK has merged MiniMSDK of iOS dynamic library version with MSDKCore. If APP uses dynamic library version, the original MiniMSDK.framework needs to be deleted during upgrade.
Because the iOS dynamic library depends on the static library, there may be duplicate code appearing in the compilation process. MSDK makes the following adjustments to the dynamic library version:
- Add support for the dynamic library plugins of the following third-party channels: Facebook, Twitter, Line, Vng, Adjust, and AppsFlyer
- Remove support for the dynamic library plugins of the following third-party channels: WeChat, QQ, Google, XG, Beacon, Bugly, Friebase, Singular, and Garena
Note: Dynamic library support will be synchronously added in the future after a channel updates its dynamic library
2. Version change
Android
- Upgrade Garena to 4.0.24, and remove WeChat sub-channel related interfaces and codes
iOS
- Upgrade Garena to 4.0.16, and remove WeChat sub-channel related interfaces and codes
V5.28.001 Upgrade Guidelines
1. Functional changes
1.1 Adjust the interfaces of Android QQ-Connect OpenSDK
1.1.1 Function description
After invoking the new authorization interface of QQ-Connect OpenSDK, the Android side must pass the smartphone model to OpenSDK; otherwise, authorization can't be made.
1.1.2 Configuration description
APP can set the Model
field through SetSensitiveInfo. Currently, QQ-Connect OpenSDK only supports the Model
field. For specific settings, please refer to: SetSensitiveInfo Interface Description.
If APP does not set the Model
field, MSDK will obtain and process it internally. If all of the above measures fail, you will not be able to use the related functions of QQ Connect OpenSDK.
1.1.3 Precautions
- Model: neither null nor empty string
2 Internal optimization
- IP obtains location information to adapt to the cloud game scene
3. Version change
Android
- TBS is upgraded to 4.3.0.343_44243
V5.28.000 Upgrade Guidelines
1. Functional changes
1.1 Warning about iOS 16 adaptation
For QQ and WeChat channels, add LSApplicationQueriesSchemes
configuration in info.plist, as follows:
<key>LSApplicationQueriesSchemes</key>
<array>
<string>mqqopensdknopasteboard</string>
<string>mqqopensdknopasteboardios16</string>
</array>
<key>LSApplicationQueriesSchemes</key>
<array>
<string>weixinURLParamsAPI</string>
</array>
The above LSApplicationQueriesSchemes
is recommended to be configured within the top 50. For details, please refer to iOS Developer Documentation Description
1.2 Add Adjust
configuration switch
1.2.1 Function description
Android adds a switch used to determine whether to enable the CoppaCompliant function and PlayStoreKidsApp function; iOS adds a switch used to determine whether to enable the CoppaCompliant function.
1.2.2 Configuration description
Configure it in the configuration file "MSDKConfig.ini". The configuration example is as follows:
Android
# Whether to enable CoppaCompliant function? 0 by default, meaning disabled.
ADJUST\_COPPA\_COMPLIANT\_ENABLE = 0
# Whether to enable PlayStoreKidsApp function? 0 by default, meaning disabled.
ADJUST\_PLAYSTORE\_KIDS\_APP\_ENABLE = 0
iOS
# Whether to enable CoppaCompliant function? 0 by default, meaning disabled.
ADJUST\_COPPA\_COMPLIANT\_ENABLE = 0
1.3 The LBS location module adds a return field
For details, please refer to MSDK IP Access Location Information Service Description.
1.4 Add the capability of printing QQ OpenSDK debug logs
Refer to MSDK DEBUG Mode Configuration documentation description. If you need to print QQ OpenSDK debug logs, just add QQ at MSDK_DEBUG_CHANNEL, such as:
#Whether to enable debugging; a global switch; 1 means "enable", and 0 means "disable"; It is recommended to disable it when release
MSDK_DEBUG = 1
MSDK_DEBUG_CHANNEL = QQ
1.5 Add the screen orientation configuration capability for iOS16 QQ OpenSDK WebView
1.5.1 Function description
When the QQ client is not installed under iOS16, by configuring QQ_SDK_WEBVIEW_SCREENDIR, you can solve the problem that you cannot switch back to the landscape mode when you return to the game after the landscape mode game invokes QQ website login.
1.5.2 Configuration description
Add the configuration field QQ_SDK_WEBVIEW_SCREENDIR
in the configuration file "MSDKConfig.ini" to control the screen orientation of QQ OpenSDK WebView according to the following priorities:
The following configuration values are obtained:
0: screen orientation 1: landscape mode 2: portrait mode
The above configuration values are not obtained: Obtain the UI direction in APP login; if any, return the obtained UI direction; otherwise, return "screen orientation neutral".
2. Internal optimization
- Optimize the problem that the central control pop-up window has multiple callbacks
3. Version changes
Android
- Beacon is upgraded to 4.2.84.3
- Adjust is upgraded to 4.30.1
iOS
- TPNS is upgraded to 1.3.4.6
- Bugly is upgraded to 2.6.0
- Adjust is upgraded to 4.30.0
V5.27.001 upgrade guidelines
1. Version changes
Android
- QQ OpenSDK is upgraded to 3.5.13.1
V5.27.000 upgrade guidelines
1. Functional changes
1.1 Warning about iOS 16 adaptation
For QQ and WeChat channels, add LSApplicationQueriesSchemes
configuration in info.plist, as follows:
QQ:
<key>LSApplicationQueriesSchemes</key>
<array>
<string>mqqopensdknopasteboard</string>
<string>mqqopensdknopasteboardios16</string>
</array>
WeChat:
<key>LSApplicationQueriesSchemes</key>
<array>
<string>weixinURLParamsAPI</string>
</array>
The above LSApplicationQueriesSchemes
is recommended to be configured within the top 50. For details, please refer to iOS Developer Documentation Description
1.2 Add QQ Small World Share capability
1.2.1 Function description
MSDK encapsulates the QQ Small World Share interface and reuses the MSDKFriend.SendMessage interface; and the input parameters are MSDKFriendReqInfo info and string channel.
1.2.2 Demo code
Please use the SendMessage interface. Type
and ExtraJson
in info
are required fields, and other fields need not be filled in; channel
should be filled in with "QQ".
The info.Type
parameter is set to FriendReqType.Friend_REQ_QQ_COMMON_SHARE, and info.extraJson
is passed in by the app itself, including serviceID
and ExtraJson
fields (pay attention to case). Invocation example:
string serviceID = "3004"; // service ID; each connected QQ service needs to contact QQ-Connect to assign a service ID to it; Android and iOS have the same service ID
string extraJson = "{\\\"local_video_path\\\":\\\"\\\\\\/storage\\\\\\/emulated\\\\\\/0\\/Android\\\\\\/data\\\\\\/com.example.wegame\\\\\\/files\\\\\\/video.mp4\\\"}"; //Extensible parameter; the data will be transparently transmitted to Mobile QQ, and the incoming content shall be agreed with the QQ
var reqInfo = new MSDKFriendReqInfo
{
Type = FriendReqType.Friend_REQ_QQ_COMMON_SHARE,
ExtraJson = "{\"serviceID\":\"" + serviceID + "\"," + "\"extraJson\":\"" + extraJson + "\"}";
};
MSDKFriend.SendMessage (reqInfo, "QQ");
1.2.3 Warning
- To assign service ID, please contact MSDK Assistant
1.3 Add the capability of invoking the account cancellation page
1.3.1 Function description
MSDK embeds the function of invoking the account cancellation page. By invoking OpenDeleteAccountUrl interface, the app passes in the corresponding account cancellation page's url. By carrying the required parameters, it can then invoke the account cancellation page according to the cancellation protocol. After the user completes the account cancellation process, the corresponding operation results can be obtained through callback.
Account cancellation page's url:
The test environment: https://gacc-account-web-test.odp.qq.com/writeoff.html The release environment: https://gacc-account-web.odp.qq.com/writeoff.html
1.3.2 Interface declaration
///<summary>
/// Invoke the account cancellation page
/// </summary>
/// <param name="url"> account cancellation page's url</param>
/// <param name="screenType">1 Default 2 Portrait 3 Landscape</param>
/// <param name="isFullScreen">Whether it is full screen or not</param>
/// <param name="extraJson">Extension field</param>
public static void OpenDeleteAccountUrl(string url,
MSDKWebViewOrientation screenType = MSDKWebViewOrientation.Auto, bool isFullScreen = false, string extraJson = "")
1.3.3 Demo code
// The test environment
MSDKWebView.OpenDeleteAccountUrl("https://gacc-account-web-test.odp.qq.com/writeoff.html");
// The release environment
MSDKWebView.OpenDeleteAccountUrl("https://gacc-account-web.odp.qq.com/writeoff.html");
1.3.4 Callback for cancellation operation
After the cancellation operation is executed, the page invokes the jsCallNative method. The app can parse the json string and perform corresponding logical processing after receiving the WebView callback. Please ensure that you have set the listening callback according to the guidelines given in Set Listening Callback.
1.3.4.1 Cancel the account successfully
The callback value is
{"MsdkMethod":"jsCallNative","type":"gacc:write_off_success","value":"The application for cancelling the game account is submitted successfully"}
1.3.4.2 Fail to cancel the account
The callback value is
{"MsdkMethod":"jsCallNative","type":"gacc:write_off_fail","value":"$code|$datamore_seq_id|$message"}
At this time, value
contains three pieces of information (separated by "|"): $code
is the error code (a number), and $datamore_seq_id
is the serial number of the request (used to locate the backend interface error), and $message
is the error information.
1.3.5 Other instructions
Refer to the following documentation for the details of the protocol and the process:
- Account cancellation process documentation: https://iwiki.woa.com/pages/viewpage.action?pageId=818439899
- Account cancellation protocol: https://iwiki.woa.com/pages/viewpage.action?pageId=459104231
1.4 iOS adds Garena Email login capability
1.4.1 Warning
This version of Garena iOS SDK provides access to IDFA internally. Please refer to the documentation FAQs on IDFA Access to configure framework library dependencies, info.plist permission description and the permission popup-related code, otherwise there is a risk of rejection.
1.5 Android adds Instagram channel sharing capability
1.5.1 Function description
Support Android Instagram channel text and image sharing types. Since the sharing process of iOS Instagram is similar to system sharing, you cannot select Instagram separately. iOS is not integrated yet, so it is recommended to use system sharing directly.
1.5.2 Demo code
1.5.2.1 Share the text
//Define `Channel` as Instagram
public static final String mCurChannel = "Instagram";
MSDKFriendReqInfo reqInfo = new MSDKFriendReqInfo();
reqInfo.desc="MSDK text sharing test";
reqInfo.type = MSDKFriendReqInfo.FRIEND_REQ_TEXT;
//Share messages
MSDKPlatform.Friend.share(reqInfo, mCurChannel);
1.5.2.2 Share images
Instagram sharing, based on system sharing, supports the sharing of local images and network images and shares them internally through FileProvider. For network images, MSDK needs to download them locally before sharing them.
//Define `Channel` as Instagram
public static final String mCurChannel = "Instagram";
MSDKFriendReqInfo reqInfo = new MSDKFriendReqInfo();
reqInfo.title = "it's title";
reqInfo.link = "http://gamecenter.qq.com/gcjump?appid=100703379&pf=invite&from=iphoneqq&plat=qq&originuin=111&ADTAG=gameobj.msg_invite";
reqInfo.imagePath = "http://q.qlogo.cn/qqapp/100703379/C1BF66286792F24E166C9A5D27CFB519/100";
//Share messages
MSDKPlatform.Friend.share(reqInfo, mCurChannel);
1.5.3 The package visibility of Android Target 30 for Instagram sharing
Android Instagram sharing is actually accomplished through system sharing. If Instagram is not installed on the mobile phone, an empty application list will pop up in the system sharing pop-up window. This actually shows that sharing fails, so it is needed to check whether Instagram has been installed in advance.
In order to adapt to a more comprehensive scene, MSDK's Instagram sharing does not check the installation package by default. If the app needs to do so, please add query
in the installation package of Target 30, as follows:
<queries>
...
<package android:name="com.instagram.android" />
</queries>
At the same time, add the following configure option in MSDKConfig.ini: ENABLE_PACKAGE_CHECK, whose value is 1.
2. Internal optimization
- Optimize the display of the channel icon in embedded Webview under screen orientation switching
3. Version changes
Android
- QQ OpenSDK is upgraded to 3.5.11
- Bugly is upgraded to 4.1.13
iOS
- QQ OpenSDK is upgraded to 3.5.12
- WeChat OpenSDK is upgraded to 1.9.6
- Garena is upgraded to 4.0.12.2
- Facebook is upgraded to 12.3.2
V5.26.000 upgrade guidelines
1. Internal optimization
- Optimize the link address splicing for sharing the message to QZone
- The local push callback adds
CustomContent
,IconType
andSmallIcon
values - Distinguish whether it is code-scanning login when login requests the central control
- Optimize Android obfuscation rules
2. Version changes
Android
- Bugly is upgraded to 4.0.4
- Garena is upgraded to 4.0.21
- TBS (domestic) is upgraded to 44216
- TBS (overseas) is upgraded to 44218
- Facebook (Android X version) is upgraded to 12.2.0
iOS
- WeChat OpenSDK is upgraded to 1.9.4
V5.25.000 upgrade guidelines
1. Functional changes
1.1 Added WeChat video account authorization capability (cross-platform)
1.1.1 Function description
MSDK encapsulates WeChat Video Circle authorization interface. Through invoking ChannelPermissionAuth interface, WeChat currently requires snsapi_channels_livestream to be passed in and gets tdiAuthBuffer
in the callback of MSDK for subsequent livestreaming login. This function does not limit the login channel and login status, that is, the interface can be invoked across platforms.
1.1.2 Demo code
Please use the ChannelPermissionAuth interface. The permissions
parameter is currently set to snsapi_channels_livestream. The permissions
required by WeChat may change in the future. Please contact MSDK Assistant to learn more. In case of logout, in the application wakeup callback OnBaseRetNotify
interface, the authorization return (MSDK_CHANNEL_PERMISSION_AUTH), whose methodId is 137, is regarded as the marker of livestreaming authorization. The invocation example:
// `channel` passes WeChat, which means WeChat channel
// `permissions` is passed to snsapi_channels_livestream and is also a special marker permission
MSDKLogin.ChannelPermissionAuth("WeChat", "snsapi_channels_livestream", null, null);
Return result:
{
"ret":-1,
"msg":"",
"methodNameID":137,
"retCode":0,
"retMsg":"Success",
"extraJson":"{\"tdiAuthBuffer\":\"Cp4BMV9CZ0FBU1lndnk0MzFqbTlRZUszUHZtTnpOMVFkWTBlQzdyRmRYd2lseFJFMGFmRzZmNFVlN25aUXRVVFpzeHN1UVZNKzFyakI4QTVGZWtmZTRTV3ZKRzJISzhJTEVhNlRVRnVhQWpNblRtVGN0UVoxdXpZVjdlNys3YzVsNC9LRE5CTHBCa1V1eXhKTkFMT0dTM1N6WG1PS3FBPT0SF2lsaW5rYXBwXzA2MDAwMDNhZGNhZDI3\"}"
}
1.1.3 Warning
- WeChat Video Circle authorization currently only supports WeChat Video Circle
- For the permission list, please fill in snsapi_channels_livestream at present, which is also the marker of the bottom layer to distinguish normal login and permission application
- Please invoke this function after successfully logging into WeChat channel
tdiAuthBuffer
in the OnBaseRetNotify callback exists in theextraJson
field and is returned in Base64 format and obtained through Json parsing. Please use standard Base64 decoding before use- Timeout callback logic is not supported for the time being
- MSDK only returns the content of
tdiAuthBuffer
. As for its specific usage method, please directly contact MSDK Assistant for docking
1.2 Add WeChat Video Circle livestreaming capability
1.2.1 Function description
MSDK encapsulates the WeChat Video Circle livestreaming interface and reuses the MSDKFriend.SendMessage interface. The input parameters are MSDKFriendReqInfo info and string channel.
1.2.2 Demo code
Please use the SendMessage interface. Type
and ExtraJson
in info are required fields, and other fields do not need to be filled in; channel
should be fixed as "WeChat". The info.Type
parameter is set to FriendReqType.Friend_REQ_WX_CHANNEL_START_LIVE, and the value of info.ExtraJson
is passed in by the game, including liveJsonInfo
and openID
fields (pay attention to case). For details, please refer to the interface documentation: https://doc.weixin.qq.com/doc/w3_AJIAmAbDAK4LXcbbMdHT6OnjGLNvf?scode=AJEAIQdfAAoCcEODzyAJIAmAbDAK4. The invocation example:
var reqInfo = new MSDKFriendReqInfo
{
Type = FriendReqType.Friend_REQ_WX_CHANNEL_START_LIVE,
ExtraJson = "{\"liveJsonInfo\":\"{\\\"extraAntiInfo\\\":\\\"bQ9Xn5XOTvUmrcjt3%2FOWSs4CXtiWfDMtoQlMb1UNrScXEkkzIVE74jlDsOUloSOx\\\",\\\"routeScene\\\":3,\\\"liveEntryScene\\\":1,\\\"appid\\\":\\\"xxxxx\\\"}\",\"openID\":\"oHlap1YDU3v_xdsM-OfFUICKa_VU\"}";
};
MSDKFriend.SendMessage (reqInfo, "WeChat");
Return result:
Skip to WeChat successfully, and launch WeChat Video Circle livestreaming page. MSDK has no callback in case of success.
Only when WeChat opensdk has an exception does it return a result through OnMSDKRetEventHandler<MSDKBaseRet> FriendRetEvent
1.2.3 Warning
- WeChat Video Circle livestreaming function currently only supports WeChat channel
- For details on how to use, please directly contact MSDK Assistant for docking
1.3 Uno plugin URL adaptation
Adapt to the situation that the original URL has "?" or "#".
2. Internal optimization
- WeChat authorization login removes message authorization scope (snsapi_message)
- Optimize the automatic login error message
- Optimize the encrypted token interface compilation
3. Version changes
Android
- WeChat OpenSDK is upgraded to 6.8.9
iOS
- WeChat OpenSDK is upgraded to 1.9.3
V5.23.003 upgrade guidelines
1. Internal optimizationines
- Remove Meizu manufacturer channel in TPNS
2. Version changes
Android
- TPNS is upgraded to 1.3.4.3
V5.23.002 upgrade guidelines
1. Internal optimizationines
- Remove Xiaomi, Vivo and Huawei manufacturer channels from TPNS
V5.23.001 upgrade guidelines
1. Android
1.1 Add AndroidID & Apn collection configuration switch
Add a code switch and a configuration switch for single-field AndroidID & Apn collection. The game side can configure whether these fields are allowed to collect as needed.
Preconditions: V5.20 and above, and SetCouldCollectSensitiveInfo is set to true.
Collection switch priority description:
- Both the code and the configuration have values: the code switch shall prevail
- Both the code and the configuration are empty: default collection
- Either the code or the configuration has a value: the value obtained shall prevail
1.1.1 Code switch interface declaration
// Set the special information single-field switch in json form; currently support setting AndroidID and Apn. Parameter example: {"AndroidID":true,"Apn":true}
// `value` in the parameter is the code switch situation of the corresponding field. The field can be collected when `value' is true
MSDK_EXPORT_UE static void SetCollectSensitiveInfo(const String &jsonInfo);
1.1.2 Demo code of the code switch
char *jsonInfo = "{\"AndroidID\":true,\"Apn\":true}";
MSDKSensitive::SetCollectSensitiveInfo(jsonInfo);
1.1.3 Configuration switch
The configuration switch is located in MSDKConfig.ini, and the corresponding configuration item is MSDK_DENIED_COLLECT_LIST, which is a list of special fields that are not allowed to be collected. Currently, the targeted fields are AndroidID and Apn. The configuration example is as follows:
//The configuration item is located in MSDKConfig.ini. By default, the list of special fields that are not allowed to be collected is empty, and multiple fields are connected with English commas.
MSDK_DENIED_COLLECT_LIST =
1.1.4 Warning
- Before the game engine starts up or MSDK is initialized, the Android side can invoke the Java interface MSDKSensitive.setCollectSensitiveInfo(jsonInfo) in advance at the Java layer; set the code switch for single-field collection in advance
- After MSDK is initialized, the code switch can only be controlled through C++ interfaces. Please do not use any Java interface
- The multi-process scene is not explicitly supported. It is recommended to put the invocation of the code switch's setting interface in the main process, or invoke the interface by the sub-process itself
1.2 MSDKPolicy plugin permission description page supports configuration
msdk_permission_content.html supports configuration. Whether the permission description page is displayed or not is determined according to whether it is configured or not. In the case of no display, the user can directly enter the game after agreeing to the agreement.
1.2.1 Configuration description
If msdk_permission_content.html is set empty or is deleted, the permission description page will not be popped up. After the user clicks the "Agree" button on the agreement page, he or she can directly enter the game.
1.3 Version changes
- QIMEI is upgraded to 1.2.13.1
- TBS is upgraded to 4.3.0.284_44184
- Beacon is upgraded to 4.2.80.6
V5.23.000 upgrade guidelines
1. Double end
1.1 Add the ability of the gateway number picking function to return the carrier information
1.1.1 Import MSDK js
https://img.ssl.msdk.qq.com/wiki/msdkJsAdapter.js
1.1.2 Encapsulate json parameters
var requestJson = '{"MsdkMethod":"sendGetPhoneNumberRequest","open_url":"https://xxx","port":443,"carrier":1}'
Wherein:
- The "MsdkMethod" field is fixed to "sendGetPhoneNumberRequest"
- The "open_url" field transmits the URL which requires Native to send requests
- The "port" field transmits the port which requires Native to send requests
- The "carrier" field passes the carrier, 1: China Mobile, 2: China Unicom, 3: China Telecom. After the number picking is finished, this field will be called back to H5 along with the number picking result.
1.1.3 Invoke MSDK js interface msdkCall
msdkCall('MSDKCall', requestJson)
The first parameter of the msdkCall interface is fixed to pass "MSDKCall", and the second parameter passes the json parameter string encapsulated in step 2
1.1.4 Set js callback
function msdkCallback(data) {
}
msdkAddNativeCallbackObserver(msdkCallback)
Callback data
is a json string {"MsdkMethod":"sendGetPhoneNumberRequestResult","flag":0,"carrier":1,"data":$ json data returned by the carrier}
Wherein:
- The "MsdkMethod" field is fixed as "sendGetPhoneNumberRequestResult"
- The "flag" field indicates the requested carrier result, 0 means success, non-0 means failure
- The "carrier" field is the carrier type, namely the carrier of H5 in Transmission Step 1.1.2
- The "data" field is the json data returned by the carrier after the request is successful; it is only valid when the
flag
field is 0
2. Android
2.1 Precaution about updating Beacon 4.2.80.2-hf version
In this upgrade, Qimei SDK gets independent from Beacon SDK; you need to set the Qimei
special field before setting Beacon on the Android side, otherwise this can affect the information reporting of Beacon.
QimeiSDK.getInstance("appkey1").getStrategy()
.enableOAID(true) // disable `oaid` collection, and set it to false here
.enableIMEI(true) // disable `imei` collection, and set it to false here; it is recommended to collect such information as much as possible if the user authorizes such collection, so as to facilitate the review of the problem
.enableIMSI(true) // disable `imsi` collection, and set it to false here
.enableAndroidId(true) // disable `android id` collection, and set it to false here; it is recommended to collect such information as much as possible if the user authorizes such collection, so as to facilitate the review of the problem
.enableMAC(true) // disable `mac` collection, and set it to false here
.enableCid(true); // disable `cid` collection, and set it to false here
.enableProcessInfo(true) // disable the application list enumeration, and set it to false here; valid for versions above 1.0.5
.enableBuildModel(true) // disable BUILD.MODEL collection, and set it to false here; valid for versions above 1.2.3
Note that MSDK sets all the above fields to false by default, so that MSDK including Beacon will not actively collect them, but rely on the game to collect them. After the user agrees, the game will collect them in any of the following ways:
- the game directly reflects invoke Beacon or qimei set interface to set special fields;
- Enable and set special field reporting through the MSDKSensitive interface provided by MSDK;
Among them, the process of setting special fields through MSDK is as follows:
std::string sensitiveInfo = "{\"AndroidID\":\"xxx\", \"WiFiMacAddress\":\"xxx\", \"Model\":\"xxx\", \"Oaid\":\"xxx\", \"Imsi\":\"xxx\", \"Cid\":\"xxx\"}"; //pass in special fields in json format; not passing in the `Model` value can affect the effect of Beacon's mid-ground algorithm
MSDKSensitive::SetSensitiveInfo(sensitiveInfo); //set special information
You can see the corresponding field information in the Beacon real-time joint test. For the specific field key-value, please refer to: https://doc.weixin.qq.com/sheet/e3_m_FQqjSTulsZmQ?scode=AJEAIQdfAAoYCcswsTAP0AIgaEACc&tab=p142s5
2.2 Precautions about updating AppsFlyer 6.5.2
2.2.1 The game project needs to support AndroidX
Since V5.23, MSDKAppsFlyer has been packaged based on AndroidX project. If the game side needs to access MSDKAppsFlyer V5.23 and above, please ensure that your project already supports AndroidX.
2.2.2 Add permissions in AndroidManifest.xml
According to AppsFlyer official documentation, when App Target API level in Android 12 is 31, you need to add the following permissions in AndroidManifest.xml before being able to access Android Advertising Identifier.
<uses-permission android:name="com.google.android.gms.permission.AD_ID" />
2.2.3 Warning
MSDKAppsFlyer plugin does not add the permissions listed in 2.2.2 by default. Games (non-family apps) need to confirm their own targetSDkVersion. If targetSDkVersion >= 31, then the above permissions need to be added, so as to make sure to get Android Advertising Identifier and do a good job of testing and verification.
2.3 Internal optimization
- Add built-in WebView to support the ability of saving an image in Base64 byte stream format by pressing it for some time
2.4 Version changes
- Beacon is upgraded to 4.2.80.2-hf
- QIMEI is upgraded to 1.2.11
- AppsFlyer is upgraded to 6.5.2
3. iOS
3.1 Version changes
- Beacon is upgraded to 4.2.75.3
- QIMEI is upgraded to 1.1.6.8
- AppsFlyer is upgraded to 6.5.3
V5.22 upgrade guidelines
1. Android
1.1 Description of updating TPNS 1.3.1.1
1.1.1 Function description
Update the TPNS Android SDK version to 1.3.1.1 to fix the TPNS component's export risk vulnerability, and add asymmetric encryption check to Intent
that opens TpnsActivity (the iOS is not updated this time).
Warning
Upgrade SDK, upgrade the main package of TPNS and the TPNS package of manufacturer channels(except OPPO) to 1.3.1.1, but that of OPPO is still 1.1.6.3.
1.1.2 AndroidManifest configuration changes
MSDKV5.22.000 (TPNS Android 1.3.1.1) starts to add InnerTpnsActivity node:
<!-- [Warning] InnerTpnsActivity configuration has been added since MSDKV5.22.000 (TPNS Android 1.3.1.1), where ${applicationId} is replaced with "application package name" -->
<activity
android:name="com.tencent.android.tpush.InnerTpnsActivity"
android:exported="false"
android:launchMode="singleInstance"
android:theme="@android:style/Theme.Translucent.NoTitleBar">
<intent-filter>
<!-- [Required] [Warning] Please modify it to the current APP package name.OPEN_TPNS_ACTIVITY_V2 -->
<action android:name="${applicationId}.OPEN_TPNS_ACTIVITY_V2" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
<intent-filter>
<!-- [Required] [Warning] ${applicationId} is modified to correspond to the current APP package name-->
<data
android:host="${applicationId}"
android:scheme="stpns" />
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.BROWSABLE" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
<intent-filter>
<action android:name="android.intent.action" />
</intent-filter>
</activity>
<!-- [Warning] InnerTpnsActivity configuration has been added since MSDKV5.22.000 (TPNS Android 1.3.1.1), where ${applicationId} is replaced with "application package name" -->
MSDKV5.22.000 (TPNS Android 1.3.1.1) starts to replace the content of the XGPushReceiver node:
<!-- [Required] TPNS receiver; MSDKV5.22.000 (TPNS Android 1.3.1.1) starts to configure XGPushReceiver (TPNS receiver) as follows -->
<receiver
android:name="com.tencent.android.tpush.XGPushReceiver"
android:exported="false"
android:process=":xg_vip_service">
<intent-filter android:priority="0x7fffffff">
<!-- [Required] Internal broadcast of TPNS SDK -->
<action android:name="com.tencent.android.xg.vip.action.SDK" />
<action android:name="com.tencent.android.xg.vip.action.INTERNAL_PUSH_MESSAGE" />
<action android:name="com.tencent.android.xg.vip.action.ACTION_SDK_KEEPALIVE" />
</intent-filter>
</receiver>
1.2 Internal optimizationines
- Update the default value of TBS WebView kernel
- Optimize the refreshing of the token switch backend logic
1.3 Version changes
- TPNS is upgraded to 1.3.1.1
2. iOS
2.1 Internal optimizationines
- Optimize the pop-up selection menu logic of iOS 15
- Optimize the refreshing of the token switch backend logic
V5.21 upgrade guide
1. Dual-end
1.1 WeChat adds supporting WeChat Video Channel authorization
1.1.1 Function description
MSDK encapsulates video number authorization. By calling Login interface, it passes in snsapi_channels_livestream and obtains tdiAuthBuffer
in the callback of MSDK and uses it for subsequent livestreaming login.
1.1.2 Demo code
Please use the Login interface and set the permissions
parameter to snsapi_channels_livestream. In the interface of the login callback, by judging that the methodId is 136 (MSDK_PERMISSION_ATUH), the login return is used as the livestreaming authorization mark. A call example is as follows:
// `channel` transmits `WeChat`, which means WeChat channel
// `permissions` transmits `snsapi_channels_livestream` and is also a special mark permission
MSDKLogin.login("WeChat", "snsapi_channels_livestream", null, null);
Return result:
{
"ret": 1,
"msg": "",
"openid": "",
"token_expire_time": 0,
"first": 0,
"reg_channel_dis": "",
"user_name": "",
"picture_url": "",
"need_name_auth": false,
"channel_info": "{\"tdiAuthBuffer\":\"Cp4BMV9CZ0FBOTJoYWVDZzBLY3d2c012S2hRK0NCZDhheE1QSHNHdmI1cW1JK3lJSWtrT0xoU0NF\\nR1VDYmVIcFM3YTRnNXdOV2Z4MVNTeDJyYkxSS28yblVZZkFnL3dyOEFZZktwL0ZKMGRBa1NYYnVW\\najB4MERNZmxJQlJHWS9rNDBuL0hqZGk2dE9qMi9ORTArTHZVczQrZ0Z6MUV3PT0SF2lsaW5rYXBw\\nXzA2MDAwMDNhZGNhZDI3\\n\"}",
"bind_list": "",
"confirm_code": "",
"confirm_code_expire_time": 0,
"channelid": 1,
"retCode": 0,
"retMsg": "Success",
"token": "",
"gender": 0,
"pf": "",
"pfKey": "",
"channel": "WeChat",
"methodNameID": 136,
"extraJson": ""
}
1.1.3 Warning
- Video Channel livestreaming authorization currently only supports WeChat channel
- Please fill in
snsapi_channels_livestream
in the permission list, which is also the mark used to distinguish normal login and permission application in the bottom layer - Please call this function after successfully logging in the WeChat channel
- In the login callback,
tdiAuthBuffer
exists in the 'channelInfo' field and is returned in the format of Base64. It is obtained through Json parsing. Please use the standard Base64 to decode it before using it. - The timeout callback logic is not yet supported
- MSDK only returns the content of
tdiAuthBuffer
. As for its usage method, please contact MSDK Assistant for docking
2. Android
2.1 Precautions about updating TBS 44142 version
- For the frequent acquisition of personal information, in addition to updating the TBS Client version, it is also needed to dynamically issue the X5 kernel (configured by the TBS backend. Game developers don't need to process it. Game developers can contact the platform side to confirm the issued result. The contact person: cameralu).
- If App does not want TBS to obtain the smartphone model (Build.Model), please call "setUserID" of QbSdk to pass in the smartphone model before using TBS:
public static void setUserID(Context context, Bundle b)
; the key is "model", and the value is smartphone model Build.Model; otherwise, TBS will get the smartphone model once by itself. If App passes in a fake smartphone model, this may affect the model- specific issuance and disabling control of the X5 kernel of TBS and may affect the adaptation of the load page of X5 Webview to the smartphone model.
2.2 Update the default startup configuration of TPNS
Before version 5.21, TPNS had a self-start problem. Starting from version 5.21, the self-start related configuration has been removed. The impact brought by this is that TPNS Android side cannot be self-started.
The configuration has been changed to:
<receiver
android:name="com.tencent.android.tpush.XGPushReceiver"
android:process=":xg_vip_service">
<intent-filter android:priority="0x7fffffff">
<!-- [Required] Internal broadcast of TPNS SDK -->
<action android:name="com.tencent.android.xg.vip.action.SDK" />
<action android:name="com.tencent.android.xg.vip.action.INTERNAL_PUSH_MESSAGE" />
<action android:name="com.tencent.android.xg.vip.action.ACTION_SDK_KEEPALIVE" />
</intent-filter>
</receiver>
If you need the self-start function, you can restore the configuration as follows:
<receiver
android:name="com.tencent.android.tpush.XGPushReceiver"
android:process=":xg_vip_service">
<intent-filter android:priority="0x7fffffff">
<!-- [Required] Internal broadcast of TPNS SDK -->
<action android:name="com.tencent.android.xg.vip.action.SDK" />
<action android:name="com.tencent.android.xg.vip.action.INTERNAL_PUSH_MESSAGE" />
<action android:name="com.tencent.android.xg.vip.action.ACTION_SDK_KEEPALIVE" />
<!-- [Optional] System broadcast: network switch -->
<action android:name="android.net.conn.CONNECTIVITY_CHANGE" />
<!-- [Optional] System broadcast: open screen -->
<action android:name="android.intent.action.USER_PRESENT" />
<!-- [Optional] Some commonly used system broadcasts can enhance the resurrection chance of TPNS. Please choose them according to your needs. Of course, you can also add some broadcast-initiated services defined by App -->
<action android:name="android.bluetooth.adapter.action.STATE_CHANGED" />
<action android:name="android.intent.action.ACTION_POWER_CONNECTED" />
<action android:name="android.intent.action.ACTION_POWER_DISCONNECTED" />
</intent-filter>
</receiver>
2.3 Internal optimization
- Use the notice function's filter field to replace platform switching
- Adapt to Android 12
2.4 Version changes
- Garena is upgraded to 4.0.17
- QQ OpenSDK is upgraded to 3.5.8
- TBS is upgraded to 4.3.0.242_44142
3. iOS
3.1 Add a special information control interface
3.1.1 Function description
Before the switch is turned on, MSDK itself as well as Beacon, QQ OpenSDK and Bugly components cannot obtain special information. Games need to actively call MSDK's special information control interface to enable the permission acquisition switch after the user has agreed to the relevant terms of the Tencent Game User Agreement.
3.1.2 Statement of the special information switch interface
// Set whether to allow collecting special information
MSDK_EXPORT_UE static void SetCouldCollectSensitiveInfo(bool couldCollect);
3.1.3 Demo code
MSDKSensitive::SetCouldCollectSensitiveInfo(true);
3.1.4 Warning
- The user must actively call the interface after agreeing to the relevant terms of the agreement.
- [Important] QQ OpenSDK 3.5.7 has begun to update permissions- related functions, and the accessing party cannot use the functions of QQ OpenSDK without calling SetCouldCollectSensitiveInfo for authorization. The log will report an error "The user is not authorized and is temporarily unable to use QQ login and sharing functions".
- When MSDK- QQ related functions are not used, MSDK will not perform QQ OpenSDK permission settings.
3.2 Internal optimization
- Use the notice function's filter field to replace platform switching
- Optimize the switch configuration interface
- Add the device model
3.3 Version changes
- Garena is upgraded to 4.0.9
- TPNS is upgraded to 1.3.4.1
- QQ OpenSDK is upgraded to 3.5.8
V5.20.001 upgrade guide
1. Android
1.1 Modify MSDKPolicy plugin configuration script and re-popup logic
MSDKPolicy has been updated in accordance with the requirement of the company's legal affairs department. It adds "Third-party Shared List" and links. Because the agreement has changed, it is necessary to add the mandatory popup logic for the agreement change. After the new version is released, the authorization agreement will pop up again when the application starts. For details about the update, please refer to: https://docs.qq.com/doc/DSnlkYU5SZWhPYmNR
1.2 Version changes
- [Important] WeChat OpenSDK is upgraded to 6.8.0 to adapt to Android 11's system features
[Important] QQ OpenSDK is upgraded to 3.5.7
Warning: QQ OpenSDK 3.5.7 has updated permissions-related functions. the accessing party cannot use the functions of QQ OpenSDK without calling SetCouldCollectSensitiveInfo for authorization. The log will report an error "The user is not authorized and is temporarily unable to use QQ login and sharing functions". View details about the interface
When MSDK-QQ related functions are not used, MSDK will not perform QQ OpenSDK permission settings.Bugly is upgraded to 3.4.41
- TPNS is upgraded to 1.2.7.1 (OPPO channel is still 1.1.6.3)
2. iOS
2.1 Instructions on the adaption of WeChat OpenSDK to iOS 15 system
For Apps compiled with Xcode13.0 and higher versions, the number of URL Scheme query
is limited to 50 in iOS 15.0 and higher systems. For Apps with more than 50 schemes configured in LSApplicationQueriesSchemes
in plist
, they may cause:
- Some interfaces of WeChat OpenSDK return wrong results
- Unable to use
Universal Link
to initiate WeChat, causing the problem that App's name is added with "Unverified Application" after messages are shared to WeChat
Developers who use Xcode 13.0 and above versions to compile App need to adapt to iOS 15 to ensure the normal use of WeChat OpenSDK.
2.1.1 Background
Starting from iOS 9, iOS has supported configuring LSApplicationQueriesSchemes
in the project's plist
.
Example:
After configuring the scheme of other Apps in LSApplicationQueriesScheme
, you can use the following code to judge whether or not to skip to the corresponding App through scheme.
BOOL ret = [[UIApplication sharedApplication] canOpenURL:[NSURL URLWithString:@"weixin://"]];
When WeChat OpenSDK is accessed, Access Document requires to add "weixin" and "weixinULAPI" in LSApplicationQueriesScheme
(as shown in the above screenshot).
2.1.2 iOS 15 system-related changes
Confirmed with Apple, On iOS 15 system, for Apps compiled with Xcode 13, the number of LSApplicationQueriesSchemes shall be limited to 50.
The scheme configuration after the 50th scheme will not take effect. The following code will return NO
BOOL ret = [[UIApplication sharedApplication] canOpenURL:[NSURL URLWithString:@"otherAppScheme://"]];
2.1.3 Suggestions on adaptation to WeChat OpenSDK
If the number of schemes configured in LSApplicationQueriesSchemes
is less than 50 or the two schemes, "weixin" and "weixinULAPI", are in the first 50 ones, it is not needed to adapt to WeChat OpenSDK.
Apps compiled with Xcode 12 and lower versions currently do not need to adapt to WeChat OpenSDK.
Make sure that "weixin" and "weixinULAPI" are configured in the first 50 of LSApplicationQueriesSchemes. Otherwise, the following interfaces may return incorrect results or behave abnormally in the iOS 15 system:
[WXApi isWXAppInstalled]
: it will also return "NO" if WeChat is installed[WXApi isWXAppSupportApi]
: it will also return "NO" if it is supported[WXApi isWXAppSupportStateAPI]
: it will also return "NO" if it is supported[WXApi sendAuthReq:viewController:delegatecompletion]
: it will judge whether WeChat is installed and will then initiate the webpage authorization.- All interfaces will not be able to use
Universal Link
to initiate WeChat and will use scheme to initiate WeChat in a downgrading manner, resulting in the "Unverified Application" problem.
V5.20.000 upgrade guide
1. Android
1.1 Add a special information control interface
1.1.1 Function description
Starting from MSDK V5.20, the special information switch and special information setting-related capabilities will be controlled by the game itself. Before the switch is enabled, MSDK itself as well as Beacon, QQ OpenSDK and Bugly components will not obtain special information. After the user agrees to the relevant terms of the Tencent Game User Agreement, the game side should actively call the MSDK special information switch interface to open the "Allow to obtain" switch and actively set the relevant special information to MSDK; otherwise, this will affect the data acquisition of MSDK as well as the data acquisition and data statistics of the Beacon component.
1.1.2 Statement of the special information switch interface
// Set whether to allow collecting special information
MSDK_EXPORT_UE static void SetCouldCollectSensitiveInfo(bool couldCollect);
1.1.2.1 Demo code
MSDKSensitive::SetCouldCollectSensitiveInfo(true);
1.1.2.2 Warning
- The user must actively call this interface after the user agrees to the relevant terms of the Tencent Game User Agreement; otherwise, this will affect MSDK and the Beacon component to acquire relevant information.
- Before the game engine is started or MSDK is initialized, the Android side can call Java interface
MSDKSensitive.setCouldCollectSensitiveInfo(true);
in the Java layer in advance to turn on the switch. - After MSDK is initialized, the switch can be controlled only through C++ interfaces. Please do not use the Java interface to control it.
- Multi- process scenes are not explicitly supported. It is recommended that all calls for the component's special information switch interface be placed in the main process or the child process call the component's special information switch interface by itself.
1.1.3 Declaration of the special information setting interface
// Set the special information field to each component's SDK in the form of json. This function currently supports {"AndroidID":"xxx","WiFiMacAddress":"xxx","Imei":"xxx"}
MSDK_EXPORT_UE static void SetSensitiveInfo(const String &jsonInfo);
1.1.3.1 Demo code
char *jsonInfo = "{\"AndroidID\":\"xxx\", \"WiFiMacAddress\":\"xxx\", \"Imei\":\"xxx\"}";
MSDKSensitive::SetSensitiveInfo(jsonInfo);
1.1.3.2 Warning
- After the user agrees to the relevant terms of the Tencent Game User Agreement, the game must actively call the interface to set the `AndroidID` field (`AndroidID` needs to be obtained by the game); otherwise, this will affect the data statistics of the Beacon component.
- Before the game engine is started or MSDK is initialized, the Android side can call the Java interface
MSDKSensitive.setSensitiveInfo(jsonInfo);
in the Java layer in advance to set relevant special information. - After MSDK is initialized, the relevant special information can be set only through C++ interfaces. Please do not use the Java interface to set it anymore.
- Special information such as
AndroidID
andWiFiMacAddress
must be obtained and filled out by the accessing party through the system API.
1.2 Login callback adds the transmission of central control underage information
1.2.1 Function description
After the login is completed (including the first login and autoLogin), the central control health field will be transmitted since MSDK V5.20 version. Through this field, the system can get information about whether the player is real-name certified and whether the player is a teenager, and so on.
1.2.2 Field description
Field | Type | Access | Description |
---|---|---|---|
health_game_ext | Json string type | In the channelInfo field of the login callback |
The health_game_ext field is the central control health field |
The following is an example of login result information (already formatted as Json).
{
"ret": 0,
"msg": "success",
"openid": "11506955275097003492",
"token_expire_time": 1634093150,
"first": 1,
"reg_channel_dis": "00000000",
"user_name": "xxx",
"picture_url": "http://thirdqq.qlogo.cn/g?b=oidb&k=e61neJybAeJDsCRXDAoOBA&s=100&t=1557138845",
"need_name_auth": false,
// health_game_ext exists in the `channel_info` field in Json string format.
"channel_info": "{\"extend\":\"\",\"access_token\":\"7E7CAF13EC305112A2AD054013EA3129\",\"pay_token\":\"3F507F00921B845E5A5600EE40CA746E\",\"expired\":2592000,\"refresh_token\":\"\",\"scope\":\"\",\"funcs\":\"\",\"other_funcs\":\"\",\"expire_ts\":1634093150,\"health_game_ext\":\"{\\\"serial_number\\\":\\\"T-HP1631501150SFGZSSMLOLPAESNDWY\\\",\\\"prajna_ext\\\":\\\"{ \\\\\\\"adultType\\\\\\\": 2, \\\\\\\"isRealName\\\\\\\": 1, \\\\\\\"type\\\\\\\": 0, \\\\\\\"webview_frame\\\\\\\": { \\\\\\\"buttons\\\\\\\": [ ], \\\\\\\"show_title\\\\\\\": 0, \\\\\\\"show_titlebar\\\\\\\": 0, \\\\\\\"url\\\\\\\": \\\\\\\"\\\\\\\" } }\\\",\\\"ruleName\\\":\\\"\\\"}\",\"channel_openid\":\"B9C8EBEBF8C7354151290DD31175
Among them, health_game_ext is the key
of Json data. If it is the LoginRet struct, please access it through healthGameExt. The field content includes serial_number, prajna_ext, adultType (adult status, 0-unknown 1-underage 2-adult), isRealName (real-name authentication status, 0 - no real-name authentication 1 - real-name authentication).
1.2.3 Warning
- Health_game_ext is Json in string format; there is a multi- layer string structure inside it; pay attention to the format when parsing it
- Judge whether the user is an adult or a minor; it is first needed to judge isRealName==1 before it is meaningful to get the value of
adultType
As for the meaning of other fields, please refer to the central control documentation: https://hope.qq.com/wiki/htdocs/document/view.html?file=7/206
1.3 Garena Target API 30 adaptation
1.3.1 Warning
- Garena is upgraded to version 4.0.16; this version only supports Android X version, and the game project needs to support Android X
- Use targetVersion >= 30 to compile it
- {YOUR_GARENA_APP_ID} in the
authenticator.xml
file needs to be replaced with the game's own data; otherwise, it will affect Guest sub- channel login
1.4 LBS adds the default configuration for time and precision
Add the time and precision configuration of LBS in App/MSDK/Android/app/src/main/assets/MSDKConfig.ini:
[LBS environment configuration]
MIN_TIME = 2000 // Time interval, in milliseconds; defaulted as 2000ms (2s) |Minimum time interval used to update the location information |
MIN_DISTANCE = 100 // Distance interval, in meters; defaulted as 100 meters | The minimum change distance used to update the location information |
1.5 Shield the quick start capability of QQ Game Center
The game which is updated to version 5.20 needs to contact the QQ Game Center to cancel the `accesstoken` and `paytoken` fields carried in `scheme` when the game is started in the QQ Game Center; otherwise, the login state in the game will become invalid (the old version will also lose the quick start capability after the platform cancels the configuration. As for details, please consult the platform side).1.6 Internal optimization
- Refresh and optimize the frontend token returned after the game switches the backend
- Internal policy optimization.
- Optimize Webview Cookie parameter transmission
- Optimize the internal policy of MSDKPolicy plugins
- Fix King Kong scan exception
1.7 Version changes
- Beacon is upgraded to 4.1.24.3
- TBS is upgraded to 4.3.0.185_44085 to be compatible with WeChat; TBS switched X5 kernel directory in November 2021
- Garena is upgraded to 4.0.16 to adapt to Target 30
- Firebase is upgraded to 22.0.0
2. iOS
2.1 Login callback adds the transmission of central control underage information
2.1.1 Function description
After the login is completed (including the first login and autoLogin), the central control health field will be transmitted since MSDK V5.20 version. Through this field, the system can get information about whether the player is real-name certified and whether the player is a teenager, and so on.
2.1.2 Field description
Field | Type | Access | Description |
---|---|---|---|
health_game_ext | Json string type | In the channelInfo field of the login callback |
The health_game_ext field is the central control health field |
The following is an example of login result information (already formatted as Json).
{
"ret": 0,
"msg": "success",
"openid": "11506955275097003492",
"token_expire_time": 1634093150,
"first": 1,
"reg_channel_dis": "00000000",
"user_name": "xxx",
"picture_url": "http://thirdqq.qlogo.cn/g?b=oidb&k=e61neJybAeJDsCRXDAoOBA&s=100&t=1557138845",
"need_name_auth": false,
// health_game_ext exists in the `channel_info` field in Json string format.
"channel_info": "{\"extend\":\"\",\"access_token\":\"7E7CAF13EC305112A2AD054013EA3129\",\"pay_token\":\"3F507F00921B845E5A5600EE40CA746E\",\"expired\":2592000,\"refresh_token\":\"\",\"scope\":\"\",\"funcs\":\"\",\"other_funcs\":\"\",\"expire_ts\":1634093150,\"health_game_ext\":\"{\\\"serial_number\\\":\\\"T-HP1631501150SFGZSSMLOLPAESNDWY\\\",\\\"prajna_ext\\\":\\\"{ \\\\\\\"adultType\\\\\\\": 2, \\\\\\\"isRealName\\\\\\\": 1, \\\\\\\"type\\\\\\\": 0, \\\\\\\"webview_frame\\\\\\\": { \\\\\\\"buttons\\\\\\\": [ ], \\\\\\\"show_title\\\\\\\": 0, \\\\\\\"show_titlebar\\\\\\\": 0, \\\\\\\"url\\\\\\\": \\\\\\\"\\\\\\\" } }\\\",\\\"ruleName\\\":\\\"\\\"}\",\"channel_openid\":\"B9C8EBEBF8C7354151290DD31175
Among them, health_game_ext is the key
of Json data. If it is the LoginRet struct, please access it through healthGameExt. The field content includes serial_number, prajna_ext, adultType (adult status, 0-unknown 1-underage 2-adult), isRealName (real-name authentication status, 0 - no real-name authentication 1 - real-name authentication).
2.1.3 Warning
- Health_game_ext is Json in string format; there is a multi- layer string structure inside it; pay attention to the format when parsing it
- Judge whether the user is an adult or a minor; it is first needed to judge isRealName==1 before it is meaningful to get the value of
adultType
As for the meaning of other fields, please refer to the central control documentation: https://hope.qq.com/wiki/htdocs/document/view.html?file=7/206
2.2 LBS adds the default configuration for time and precision
Add the time and precision configuration of LBS in App/MSDK/Android/app/src/main/assets/MSDKConfig.ini:
[LBS environment configuration]
MIN_TIME = 2000 // Time interval, in milliseconds; defaulted as 2000ms (2s) |Minimum time interval used to update the location information |
MIN_DISTANCE = 100 // Distance interval, in meters; defaulted as 100 meters | The minimum change distance used to update the location information |
2.3 Shield the quick start capability of QQ Game Center
The game which is updated to version 5.20 needs to contact the QQ Game Center to cancel the `accesstoken` and `paytoken` fields carried in `scheme` when the game is started in the QQ Game Center; otherwise, the login state in the game will become invalid.2.4 Internal optimization
- Refresh and optimize the frontend token returned after the game switches the backend
2.5 Version changes
- Firebase is upgraded to 8.3.0
V5.19 upgrade guide
1. Android
1.1 WeChat adds the state sharing capability
1.1.1 Function description
Share the status message to WeChat. After the status is shared successfully, the status-related information will be displayed under WeChat -> My Avatar. When the application name under the status is clicked, the URL will automatically jump to the specified page. The current version of MSDK supports sharing the image status to WeChat.
1.1.2 Interface declaration
/**
* Send a message to the session
*
* @param reqInfo message struct, which contains the content that needs to be sent
*@Param channel: channel information, such as "WeChat"
*/
MSDK_EXPORT_UE static void SendMessage(const MSDKFriendReqInfo &reqInfo, const String &channel = "");
Where, fill kMSDKFriendReqTypeWXStatePhoto
into the type
field of the reqInfo
parameter .
1.1.3 Demo code
MSDKFriendReqInfo info;
info.title = "MSDK WeChat State Test Title";
info.link = "https://game.weixin.qq.com/cgi-bin/h5/static/circlecenter/mixed_circle.html?tabid=7&appid=wx95a3a4d7c627e07d&ssid=46#wechat_redirect";
info.type = kMSDKFriendReqTypeWXStatePhoto;
info.imagePath = "http://q.qlogo.cn/qqapp/100703379/C1BF66286792F24E166C9A5D27CFB519/100";
info.extraJson = "{\"stateId\":\"1019\"}";
1.1.4 Sharing effect
1.1.5 Warning
- If you need to access it, you need to contact MSDK Assistant for docking.
stateId
can be filled with 1019,link
is the Game Circle's address, andtitle
will be set as the default value of the edit page. After the link skips to WeChat,title
andstateId
parameters can be modified independently.- link: please fill in it with the Game Circle address.
- The recommended size for an image is 9:16.
1.2 Adjust adds support for data residency in the US
1.2.1 Function description
Through the data residency function, you can choose the country in which Adjust stores your data. This function can be very useful when the country where the App operates has strict privacy regulations. After setting the data residency, Adjust will store your data in the data center of the selected region.
1.2.2 Configuration description
MSDKAdjust adds the ADJUST_DATA_RESIDENCY configuration to support this feature. This configuration does not exist in the MSDKConfig.ini configuration file by default. Games that require data residency can add this configuration in the MSDKConfig.ini file. As for the specific value, please refer to the Adjust documentation https://github.com/adjust/android_sdk#beta-data-residenc to make a choice and fill in the corresponding actual value.
# If you want to store the data in the United States, you can take the value filled in by Android as the actual value, `data_residency_us`, of AdjustConfig.DATA_RESIDENCY_US, as follows:
ADJUST_DATA_RESIDENCY = data_residency_us
1.3 Internal optimization
- Optimize the overload problem of nativeCallJS page
- Ignore invalid Scheme in WebView
1.4 Version changes
- Adjust is upgraded to 4.28.1 to add support for data residency in the U.S.
- TBS is upgraded to 4.3.0.166_44066
2. iOS
2.1 WeChat adds the state sharing capability
2.1.1 Function description
Share the status message to WeChat. After the status is shared successfully, the status-related information will be displayed under WeChat -> My Avatar. When the application name under the status is clicked, the URL will automatically jump to the specified page. The current version of MSDK supports sharing the image status to WeChat.
2.1.2 Interface declaration
/**
* Send a message to the session
*
* @param reqInfo message struct, which contains the content that needs to be sent
*@Param channel: channel information, such as "WeChat"
*/
MSDK_EXPORT_UE static void SendMessage(const MSDKFriendReqInfo &reqInfo, const String &channel = "");
Where, fill kMSDKFriendReqTypeWXStatePhoto
into the type
field of the reqInfo
parameter .
2.1.3 Demo code
MSDKFriendReqInfo info;
info.title = "MSDK WeChat State Test Title";
info.link = "https://game.weixin.qq.com/cgi-bin/h5/static/circlecenter/mixed_circle.html?tabid=7&appid=wx95a3a4d7c627e07d&ssid=46#wechat_redirect";
info.type = kMSDKFriendReqTypeWXStatePhoto;
info.imagePath = [[[NSBundle mainBundle] pathForResource:@"IMG_0208" ofType:@"png"] UTF8String];
info.extraJson = "{\"stateId\":\"1019\"}";
2.1.4 Sharing effect
2.1.5 Warning
- If you need to access it, you need to contact MSDK Assistant for docking.
stateId
can be filled with 1019,link
is the Game Circle's address, andtitle
will be set as the default value of the edit page. After the link skips to WeChat,title
andstateId
parameters can be modified independently.- link: please fill in it with the Game Circle address.
- The recommended size for an image is 9:16.
2.2 Adjust adds support for data residency in the US
2.2.1 Function description
Through the data residency function, you can choose the country in which Adjust stores your data. This function can be very useful when the country where the App operates has strict privacy regulations. After setting the data residency, Adjust will store your data in the data center of the selected region.
2.2.2 Configuration description
MSDKAdjust adds the ADJUST_DATA_RESIDENCY configuration to support this feature. This configuration does not exist in the MSDKConfig.ini configuration file by default.
Games that require data residency can add this configuration in the MSDKConfig.ini file. As for the specific value, please refer to the Adjust documentation https://github.com/adjust/ios_sdk#beta-data-residency to make a choice and fill in the corresponding actual value.
# If you want to store the data in the United States, you can take the value filled in by iOS as the actual value, `DataResidencyUS`, of ADJDataResidencyUS, as follows:
ADJUST_DATA_RESIDENCY = DataResidencyUS
2.3 Add the fcmtoken
field in the callback return of Firebase push registration
2.4 Version changes
- Beacon is upgraded to 4.1.36 to solve the libnetwork problem
- TPNS is upgraded to 1.3.0.3 to fix the occasional reconnection problem
- Adjust is upgraded to 4.29.2 to add support for data residency in the U.S.
*[Important] The following is the modification
1.4 Update MSDKPolicy plugin script
2.3 WeChat adds the video account sharing capability
1.1 Beacon and TBS SDK solve the problem of frequently obtaining device data
Solve the problem that Beacon and TBS obtain MAC address and Deviceid many times during their operation processes.
V5.18 Upgrade guide
1. Android
1.1 Bugly adds the capability of dynamically disabling monitoring
In some scenarios, apps do not need to report a crash, such as: some apps do not want to report to Bugly crashes triggered during the killing of processes; at this time, they can call this interface to close crash reporting, but other Bugly functions will not be affected; crashes triggered by the restart of the apps will be reported normally.
1.1.1 Interface declaration
C# interface declaration
/**
* Turn off Bugly's crash reporting
**/
public static native void closeCrashReport();
1.1.2 Demo code
C# interface example
MSDKCrash.CloseCrashReport();
1.2 Built-in Webview adds the capability to set the title bar, toolbar color and transparency
1.2.1 Function description
Games can modify the background color and transparency of the title bar and toolbar of the built-in Webview by modifying relevant configuration items in the MSDKConfig.ini file.
1.2.2 Configuration description
Configuration description example:
WEBVIEW_TITLE_BAR_BACKGROUND_COLOR = 333333
WEBVIEW_TITLE_BAR_ALPHA = 100
WEBVIEW_TOOL_BAR_BACKGROUND_COLOR = 333333
WEBVIEW_TOOL_BAR_ALPHA = 100
WEBVIEW_TITLE_BAR_BACKGROUND_COLOR
is the color of the title bar at the top of the built-in Webview. Its valid value range is 000000-FFFFFF, and its default value is 333333WEBVIEW_TITLE_BAR_ALPHA
is the transparency of the title bar at the top of the built-in Webview. Its effective value range is 0-100, and its default value is 100WEBVIEW_TOOL_BAR_BACKGROUND_COLOR
is the color of the bottom toolbar of the built-in Webview. Its valid range is 000000-FFFFFF, and its default value is 333333WEBVIEW_TOOL_BAR_ALPHA
is the transparency of the toolbar at the bottom of the built-in Webview. Its effective value range is 0-100, and its default value is 100
1.3 WeChat adds the video account sharing capability
1.3.1 Function description
Share the video to WeChat video account with one click. After sharing the video successfully, you can view the shared video in the WeChat video account.
1.3.2 Interface declaration
C++ Interface declaration
/**
* Share
*
*@Param reqInfo: message struct, which contains the content to be shared
*@Param channel: channel information, such as "WeChat"
*/
MSDK_EXPORT_UE static void Share(const MSDKFriendReqInfo &reqInfo, const String &channel = "");
Wherein, the type
field of the reqInfo
parameter is filled with kMSDKFriendReqTypeWXChannelShareVideo
; the mediaPath
field is filled with the video resource 'PHAsset localIdentifier' on the iOS side and the local path of the video resource on the Android side. The video specification requires a size of 1:3 - 3:1, and the size of the video cannot exceed 450M and its duration cannot exceed 30 minutes.
C# interface declaration
/// <summary>
/// Send messages to WeChat Moment or QZone, etc.
/// </summary>
/// <param name="info">Message struct, which contain the content to be shared</param>
/// <param name="channel">Channel</param>
public static void Share(MSDKFriendReqInfo info, string channel = "")
Wherein, the type
field of the info
parameter is filled with FriendReqType.Friend_REQ_WX_CHANNEL_SHARE_VIDEO
; the mediaPath
field is filled with the video resource 'PHAsset localIdentifier' on the iOS side and the local path of the video resource on the Android side. The video specification requires a size of 1:3-3:1,the size of the video cannot exceed 450M and its duration cannot exceed 30 minutes.
1.4 Update the copywriting of privacy-compliant plugins
- "Permission request" is changed to "Permission description"
- Delete "(required)" copywriting
- Removed from the default configuration: storage permission, phone permission sample
1.5 Instructions on FileProvider
If an app is allowed to be installed on the SD card, it is recommended to add 'root-path'; otherwise, this may cause the failure of the sharing due to permission problems. Refer to FAQ: Android fails to send a big picture, reporting an error "Failed to find configured root"
1.6 Internal optimization
- Optimize the third-party error codes of WeChat login authorization callback
1.7 Version changes
- Upgrade Beacon to 4.1.22.3 to modify the user sensitive information collection switch
- Upgrade WeChat OpenSDK to 6.7.5 to add the interface for publishing a game to the video account with one click
2. iOS
2.1 Bugly adds the capability of dynamically disabling monitoring
In some scenarios, apps do not need to report a crash, such as: some apps do not want to report to Bugly crashes triggered during the killing of processes; at this time, they can call this interface to close crash reporting, but other Bugly functions will not be affected; crashes triggered by the restart of the apps will be reported normally.
2.1.1 Interface declaration
C# interface declaration
/**
* Turn off Bugly's crash reporting
**/
public static native void closeCrashReport();
2.1.2 Demo code
C# interface example
MSDKCrash.CloseCrashReport();
2.2 Built-in Webview adds the capability to set the title bar, toolbar color and transparency
2.2.1 Function description
Games can modify the background color and transparency of the title bar and toolbar of the built-in Webview by modifying relevant configuration items in the MSDKConfig.ini file.
2.2.2 Configuration description
Configuration description example:
WEBVIEW_TITLE_BAR_BACKGROUND_COLOR = 333333
WEBVIEW_TITLE_BAR_ALPHA = 100
WEBVIEW_TOOL_BAR_BACKGROUND_COLOR = 333333
WEBVIEW_TOOL_BAR_ALPHA = 100
WEBVIEW_TITLE_BAR_BACKGROUND_COLOR
is the color of the title bar at the top of the built-in Webview. Its valid value range is 000000-FFFFFF, and its default value is 333333WEBVIEW_TITLE_BAR_ALPHA
is the transparency of the title bar at the top of the built-in Webview. Its effective value range is 0-100, and its default value is 100WEBVIEW_TOOL_BAR_BACKGROUND_COLOR
is the color of the bottom toolbar of the built-in Webview. Its valid range is 000000-FFFFFF, and its default value is 333333WEBVIEW_TOOL_BAR_ALPHA
is the transparency of the toolbar at the bottom of the built-in Webview. Its effective value range is 0-100, and its default value is 100
2.3 Guide on access to WeChat video account sharing function
2.3.1 Function description
Share the video to WeChat video account with one click. After sharing the video successfully, you can view the shared video in the WeChat video account.
2.3.2 Interface declaration
C++ Interface declaration
/**
* Share
std::string url_str = "start ";
*@Param reqInfo: message struct, which contains the content to be shared
*@Param channel: channel information, such as "WeChat"
*/
MSDK_EXPORT_UE static void Share(const MSDKFriendReqInfo &reqInfo, const String &channel = "");
Wherein, the type
field of the reqInfo
parameter is filled with kMSDKFriendReqTypeWXChannelShareVideo
; the mediaPath
field is filled with the video resource 'PHAsset localIdentifier' on the iOS side and the local path of the video resource on the Android side. The video specification requires a size of 1:3 - 3:1, and the size of the video cannot exceed 450M and its duration cannot exceed 30 minutes.
C# interface declaration
/// <summary>
/// Send messages to WeChat Moment or QZone, etc.
/// </summary>
/// <param name="info">Message struct, which contain the content to be shared</param>
/// <param name="channel">Channel</param>
public static void Share(MSDKFriendReqInfo info, string channel = "")
Wherein, the type
field of the info
parameter is filled with FriendReqType.Friend_REQ_WX_CHANNEL_SHARE_VIDEO
; the mediaPath
field is filled with the video resource 'PHAsset localIdentifier' on the iOS side and the local path of the video resource on the Android side. The video specification requires a size of 1:3-3:1,the size of the video cannot exceed 450M and its duration cannot exceed 30 minutes.
2.4 Instructions on Tencent Mobile Push TPNS
+Register the push interface. The interface has a callback only for its first call at every startup of App. It has no callback for later calls. The above is the design logic of Tencent Mobile Push TPNS-SDK. MSDK currently deals with this issue with reference to the recommendations of XG
- MSDK5.18 and later versions can ignore the
XG_FREE_ACCESS_ID_IOS = {YOUR_OLD_XG_ACCESS_ID_IOS}
configuration
2.5 Internal optimization
- Optimize the location permission pop-up
- Optimize WebView screen edge gesture
2.6 Version changes
- Upgrade Beacon to 4.1.29.6 to remove IDFA and support QIMEI36
- Upgrade Tencent Mobile Push TPNS to 1.3.0.2 to resolve occasional exceptions
- Upgrade WeChat OpenSDK to 1.9.1 to add the interface for publishing a game to the video account with one click
3. JavaScript
3.1 Add the JS interface for judging whether WeChat/QQ is installed
3.1.1 Function description
Open the webpage in the built-in Webview provided by MSDK to judge whether QQ/ WeChat is installed. This interface supports Android and iOS. It needs to run in MSDK's WebView to take effect, including built-in Webview and embedded Webview.
3.1.2 Interface declaration
Similar to other JS functions of MSDK, the interface for judging whether an app is installed follows the same JS calling protocol. Refer to the following code to implement the JS logic for judging whether an app is installed:
// Judge whether App is installed
function msdkIsAppInstalled(target, callback){
if(isiOS()){
var params = '{"MsdkMethod":"isAppInstalled","packageUrl":"' + target + '"}';
msdkiOSHandler('MSDKCall', params, callback);
}else{
var params = '{"MsdkMethod":"isAppInstalled","package":"' + target + '"}';
callback(prompt(params));
}
}
MsdkMethod
is filled in with "isAppInstalled". In case of iOS, use packageUrl
; in case of Android, use package
callback' is a callback function. Its parameter is a string; true means installed, false means not installed, and others means query failure.
3.1.3 Demo code
Judge whether QQ is installed
function demoIsQQInstalled(){
if(isiOS()){
msdkIsAppInstalled("mqq://", function(resp){
alert(resp);
});
}else{
msdkIsAppInstalled("com.tencent.mobileqq", function(resp){
alert(resp);
});
}
}
Judge whether WeChat is installed
function demoIsWeChatInstalled(){
if(isiOS()){
msdkIsAppInstalled("weixin://", function(resp){
alert(resp);
});
}else{
msdkIsAppInstalled("com.tencent.mm", function(resp){
alert(resp);
});
}
}
Note:
- On the Android side, if App's Target SDK is 11 and runs on an Android 11 device, it is needed to declare 'query' before this function can be used normally.
- On the Android side, if the Target API is equal to 30 and is not configured with 'queries', App's installation status cannot be queried
- On the Android side, if Target API is equal to 30, returning 'true' means 'installed', and returning 'false' means unknown (due to no way of identifying whether it is a permission problem or App is really not installed)
- On the iOS side, if there was an earlier interface using MSDK to judge whether App is installed, please check whether the interface works normally. This time, this interface is provided to the outside in a unified manner and is standardized and adjusted
3.2 Add forward and backward JS interfaces
3.2.1 Function description
Control the forward and backward of the built-in Webview page through the JS forward and backward interfaces.
3.2.2 Demo code
var GoForward = '{"MsdkMethod":"GoForward"}';
var GoBack = '{"MsdkMethod":"GoBack"}';
//Call 'msdkCall' and send 'GoForward' and 'GoBack' to Native
<input type="button" value="Forward" onclick="msdkCall (GoForward) ">
<input type="button" value="Backward" onclick="msdkCall (GoBack) ">
V5.17 Upgrade guide
1. Android
1.1 MSDKPolicy
1.1.1 Adjust the privacy page pop-up logic
In response to legal requirements, adjust the privacy page pop-up logic, and disable the default configuration 'MSDK_RESULT_FILE_NAME', which is used to judge the login status, in 'MSDKPolicyActivity.
For games that have been connected to MSDKPolicy , it is needed to manually delete the 'MSDK_RESULT_FILE_NAME' configuration item in AndroidManifest.xml:
<activity android:name="com.tencent.gcloud.msdk.core.policy.MSDKPolicyActivity"
android:configChanges = "keyboard|keyboardHidden|screenLayout|screenSize"
android:launchMode="singleTask"
android:theme="@style/MSDKPolicyTheme">
<!-- Delete this configuration <meta-data android: name="MSDK_RESULT_FILE_NAME" android: value="itop_login.txt"/> -->
</activity>
The adjusted behavior is as follows:
"Tencent Games User Protocol and Privacy Policy"page pop-up logic description
(1) If APP is a new installation, the privacy page will pop up for the first time
(2) If APP is an overwritten installation:
If the previously installed APP has agreed to the privacy page, the page will not pop up
If the previously installed APP has not agreed to the privacy page:
- If the App hasn't agreed to the privacy page but has logged in it, the page will pop up
- If the App hasn't agreed to the privacy page and hasn't logged in it, the page will pop up
1.1.2 Optimize the display logic of the permission description page
If the "Confirm" button on the permission description page is not clicked, the page will exit directly. When APP is restarted next time, the permission description page will still be displayed.
1.2 Target 30 version adaptation
Official documentation guidelines: https://developer.android.com/distribute/best-practices/develop/target-sdk
- Require APK signature scheme v2
- Need to add the package visibility list according to the accessed plugin. Please refer to: Android Target 30 Visibility Adaptation - App Package Name Reference
Warning
- Since Garena has not yet been adapted to Target 30, it is necessary to wait for the new Garena SDK version for compatible adaptation. It is recommended that games whose current version is connected to Garena channel use Target 29.
1.3 Changes to the "Adjust" version
Updated to 4.27.0 version.
2. iOS
2.1 Supplement the return value of MSDKTools::GetConfigChannelID interface
Return to iOS channel number 1001.
2.2 MSDKXG's internal optimization
Add 'xgPushLog' to print the startup log of TPNS.
2.3 Changes to the "Adjust" version
The version is updated to 4.28.0, mainly to solve the problem that some codes in the low-version Adjust SDK on the iOS side may lead to the rejection of the review. If your APP accesses MSDKAdjust, it is recommended to upgrade it to MSDKAdjust V5.17.000 version.
2.4 Garena version changes
Updated to 4.0.6 version.
- The new version of Garena must be compiled with XCode 12
- MSDKGarena plugin needs to do Swift mixed compilation configuration with reference to MSDKLine and MSDKFacebook. Refer to the following documentation according to the engine used by the game itself: Garena
- Garena has added the AdSupport.framework library. The game needs to use the ATT framework pop-up window to declare permissions and explain the reason for requesting IDFA data in info.plist; otherwise, there will be a review risk
V5.16 Upgrade guide
1. Android
1.1 Beacon and TBS SDK need to solve the problem about the frequent collection of private data
Solve the problem that Beacon and TBS collect MAC address and 'Deviceid' for many times during operation.
1.2 Add HTTPDNS configuration
Add HTTPDNS switch configuration in the MSDKConfig.ini file to enable or disable the HTTPDNS resolution capability; the default is 1, which means 'enable'
HttpDns switch: 0: enable, 1: disable
MSDK_HTTPDNS_ENABLE = 0
1.3 Optimize the display of embedded Webview's special-shaped screen
1.4 Facebook changes
1.4.1 Facebook ANALYTICS function closure configuration
This configuration is the two switches provided by Facebook to comply with GDPR. Pay attention to the following points when configuring them:
- For disabling the automatic initialization, it is not recommended to add the 'AutoInitEnabled' configuration in Facebook versions below 9.0, because this can cause a login exception. Version 9.0 and above do not need to add the 'AutoInitEnabled' configuration.
- If you need to disable the Automatic Event Collection, you can add the 'AutoLogAppEventsEnabled' configuration. Refer to the configuration documentation of Facebook (https://developers.facebook.com/docs/app-events/gdpr-compliance/#disabling-automatic-event-collection)
1.4.2 Upgrade Facebook version to 9.0+
In Facebook 9.0 version, Facebook strongly checks 'permissions'. You must pass the permissionsfield when calling Facebook's login interface; otherwise, the login will fail; an error will be reported that 'permissions' is not passed in: FBSDKLog: Invalid combination of permissions and tracking preference provided to login configuration.
1.5 Firebase changes
1.5.1 Changes to Firebase component interfaces
The original interface 'getInstanceID' is obsolete. If you want to get the 'instanceID' of Firebase, you need to use the 'getInstanceIDAsync' interface.
1.5.2 Firebase crash reporting component supports split usage
The Firebase component integrates: data reporting, push, and crash reporting. If your App needs to incorporate Firebase and Bugly at the same time, you must remove the Firebase crash module; otherwise, the Firebase crash module will conflict with Bugly.
Removal guidelines: Firebase-FAQ
1.6 Warning
- When sharing an image, you should match the 'file_provider_paths.xml' configuration with the storage location of the image. Please refer to: Android fails to send a big picture, reporting an error "Failed to find configured root"
- Before June 30, 2021, Garena version must be upgraded to 4.0.13, that is, MSDKV5.16 version; otherwise, there may be Google related failures.
2. iOS
2.1 Add XG extension function library file
The extension function is accessed as needed. MSDK only provides the corresponding version of 'libXGExtension.a' library in the MSDKXG plugin to avoid the version difference encountered by separate access. The specific implementation method is based on the XG documentation. XG documentation: https://cloud.tencent.com/document/product/548/36667
2.2 Add HTTPDNS configuration
Add HTTPDNS switch configuration in the MSDKConfig.ini file. The switch is used to enable or disable the HTTPDNS resolution capability; it is defaulted as 1, namely "enable".
HttpDns switch: 0: enable, 1: disable
MSDK_HTTPDNS_ENABLE = 0
2.3 Add Appsflyer, which allows the game to delay reporting data after it is started
In the MSDKConfig.ini file, add the "Appsflyer starts to delay sending data" configuration.
Whether to call the 'waitForATTUserAuthorizationWithTimeoutInterval' function switch? 0: disable, 1: enable; the default is 1,namely 'enable the call'
APPSFLYER_WAIT_FOR_ATT_ENABLE = 1
How many seconds to delay before sending data? the default is 60s if it is not configured; it cannot be configured to 0
APPSFLYER_WAIT_FOR_ATT_TIMEOUT_INTERVAL = 60
2.4 Upgarde Facebook version to 9.0+
In Facebook 9.0 version, Facebook strongly checks 'permissions'. You must pass the permissionsfield when calling Facebook's login interface; otherwise, the login will fail; an error will be reported that 'permissions' is not passed in: FBSDKLog: Invalid combination of permissions and tracking preference provided to login configuration.
2.5 Support XCode 12 compilation
3. Engine
3.1 UE4.26 engine's adaptation support
- UE4.26 only supports XCode 11.3.1 and above
- Mac system requires Mojave 10.14 and above
UE4 Release Note: https://docs.unrealengine.com/en-US/WhatsNew/Builds/ReleaseNotes/4_26/index.html
All rights reserved.