10/22/2024 16:10:39

Problem description

The Android Q system does not have SD card permission. When a third-party application shares an image to QQ, the sharing will fail if the image is shared via a SD card.

Problem causes

After Android Q, due to the storage permission limit of applications, when a third-party application without SD card permission shares an image to QQ, the sharing will fail if the image is shared via a SD card.

Solution

Since QQ interconnection opensdk 3.3.8 (MSDK's corresponding versions are: V5 5.10.000, V3 3.3.12a), its sharing function supports sharing images to QQQ through FilePorvider. Through this sharing method, even QQQ can access the image shared by a third-party application even without SD card permission.

FileProvider configuration

<provider android:authorities="com.example.wegame.QQSDKFileProvider"
           android:name="android.support.v4.content.FileProvider"
           android:exported="false"
           android:grantUriPermissions="true" >
            <meta-data android:name="android.support.FILE_PROVIDER_PATHS"
                       android:resource="@xml/file_paths"/>
</provider>

Add the file_paths.xml file under the 'res/xml' directory. If there is no 'xml' directory in the 'res' directory, you need to add an 'xml' directory. The content of the file is as follows:

<?xml version="1.0" encoding="utf-8"?>
<paths>
    <external-files-path name="opensdk_external" path="Images/tmp"/>
    <root-path name="opensdk_root" path=""/>
</paths>

Note

QQ Interconnection's instructions on the permission adaptation of the above shared content: https://wiki.connect.qq.com/%E5%88%86%E4%BA%AB%E5%8A%9F%E8%83%BD%E5%AD%98%E5%82%A8%E6%9D%83%E9%99%90%E9%80%82%E9%85%8D



Copyright © 2024 MSDK.
All rights reserved.

results matching ""

    No results matching ""