ShekarMudaliyar / social_share

Flutter package to share images/videos/text on social media
https://pub.dev/packages/social_share
MIT License
112 stars 191 forks source link

error sharing facebook #100

Closed hoanggia2499 closed 2 years ago

hoanggia2499 commented 2 years ago

Hi and thanks for your work I have an error when trying to share on Facebook, only tried on Android, the error on console is:

D/ ( 9900): com.qasoftsolution.pivo_game.MainActivity@eecab39 I/flutter ( 9900): error

and I copied the code into manifest file and also created the filepaths.xml.

JustinWeru12 commented 2 years ago

How did you solve this issue?

vinhmdev commented 2 years ago

I have same isue. How did you solve this issue?

limitless-brain commented 1 year ago

This issue is due to un-updated documentation for the android part. Please update the share plugin provider in the manifest: and remove tools:replace="android:authorities"

       <provider
            android:name="androidx.core.content.FileProvider"
            android:authorities="${applicationId}.com.shekarmudaliyar.social_share"
            android:exported="false"
            android:grantUriPermissions="true" >
            <meta-data
                android:name="android.support.FILE_PROVIDER_PATHS"
                android:resource="@xml/filepaths" />
        </provider>

Add queries after the application tag:

    </application>
    <queries>
        <!-- If your app opens https URLs -->
        <intent>
            <action android:name="android.intent.action.VIEW" />
            <data android:scheme="https" />
        </intent>
        <package android:name="com.instagram.android" />
        <package android:name="com.facebook.katana" />
    </queries>

Afterthat, the plugin should work correctly.