01/10/2025 10:53:00
System channel's function description
I. Overview
System is the system sharing component of Android and iOS. when App calls the Friend module, the system sharing page can be launched after relevant parameters are transferred to the System channel. The user can select a third-party app to share.
The required minimum system version of iOS: iOS 8
II. Project configuration
2.1 Android FileProvider description
If the game needs to use the image sharing function, Android needs to add the following configuration
Check the following configuration in AndroidManifest; if it doesn't exist, add:
<application> ... <provider android:name="com.tencent.gcloud.msdk.system.SystemFileProvider" android:authorities="${applicationId}.system.provider" android:exported="false" android:grantUriPermissions="true"> <meta-data android:name="android.support.FILE_PROVIDER_PATHS" android:resource="@xml/system_share_storage" /> </provider> ... </application>
Wherein, replace {applicationId} with the package name of the game
Add the 'xml' directory under the 'res' directory, and add the 'system_share_storage.xml' file under the xml directory. The content of the file is as follows:
<paths xmlns:android="http://schemas.android.com/apk/res/android"> <root-path name="root_path" path="."/> <files-path name="system_files" path="."/> <external-files-path name="system_external" path="." /> </paths>
2.2 iOS configuration description
Need to rely on MessageUI.framework
III. Function description
3.1 Friend module's sharing function description
Systemsharing component, which supports text, image and link (iOS only) sharing types.
List of supported types
No. | Function | Required field | Remarks |
---|---|---|---|
1 | Share-text | Desc | - |
2 | Share-link | Link | Only supported by iOS |
3 | Share-image | ImagePath | - |
Description:
- For each sharing type, if it is filled in with other fields, these fields will not be used. For example, the 'Link' and 'ImagePath' fields of the text sharing will not be used;
- The 'Title' field of Android's system sharing function is used to launch the title display of the system's sharing UI; the title of iOS system sharing UI displays the shared content, because iOS can only set one text content
- The callback of the system sharing function only indicates whether the system sharing page is launched successfully, and does not indicate whether the player actually shares messages successfully or not;
3.2 Sharing effect
1) Android
Call interfaces and launch the pop-up of the system's sharing function
Click Wechat Moment to share messages, and pop up the sharing box
After the sharing is completed
2) iOS
Call interfaces and launch the pop-up of the system's sharing function
Click QQ, select QZone to share messages and share messages to QZone
After the sharing is completed, the sharing UI disappears and the system sharing callback is given
3.3 Instructions on the user settings of iOS system sharing
After iOS launches system sharing, the apps displayed by the system by default in the launched sharing UI are different according to the version of the iOS system, and they are generally incomplete. These are the display controls of the system, and the user can select and set them.
For example, on the iPad device of iOS12
You can set how to display other apps in
More...
on the far right, as shown in the figure
You can add the frequently shared apps to the default launch panel, as shown in the figure
After they are added, they are as shown in the figure
On the iPhoneX device of iOS 13
You can select other apps in
More...
on the far right, as shown in the figure
Click on
More...
and then select the app you want to share, as shown in the figure
All rights reserved.