social_share icon indicating copy to clipboard operation
social_share copied to clipboard

everything is false in checkInstalledAppsForShare

Open ArtemZip opened this issue 3 years ago • 4 comments

SocialShare.checkInstalledAppsForShare().then((value) => {
  value?.forEach((key, value) {print("$key : $value");})
});

Output:

I/flutter ( 2860): sms : false
I/flutter ( 2860): instagram : false
I/flutter ( 2860): facebook : false
I/flutter ( 2860): twitter : false
I/flutter ( 2860): whatsapp : false
I/flutter ( 2860): telegram : false

Version: ^2.1.1 Also, sharing is not working, I think because of that.

ArtemZip avatar Aug 21 '21 15:08 ArtemZip

Solved by downgrading compileSdkVersion and targetSdkVersion to 28 instead of 30

ArtemZip avatar Aug 23 '21 18:08 ArtemZip

Adding

<uses-permission android:name="android.permission.QUERY_ALL_PACKAGES" />

In AndroidManifest.xml also solved this issue for me

somy360 avatar Dec 09 '21 10:12 somy360

<uses-permission android:name="android.permission.QUERY_ALL_PACKAGES" />

Solved by downgrading compileSdkVersion and targetSdkVersion to 28 instead of 30

what about iOS

rishabh89 avatar May 05 '22 14:05 rishabh89

Adding

<uses-permission android:name="android.permission.QUERY_ALL_PACKAGES" />

In AndroidManifest.xml also solved this issue for me

Recently Google announced that they are restricting the usage of QUERY_ALL_PACKAGES, allowing it to be used only for apps that must discover any and all installed apps on the device, for awareness or interoperability purposes. In order to publish new apps or updates, app developers will also be required to submit a Permissions Declaration Form explaining why the app really needs such broad permission.

So, it would be better to use a less broad app-visibility method, such as the <queries> element to specify exactly which packages to query.

Adding the following under the <manifest> tag of your AndroidManifest.xml file will suffice:

<queries>
    <package android:name="com.instagram.android" />
    <package android:name="com.facebook.katana" />
    <package android:name="com.twitter.android" />
    <package android:name="com.whatsapp" />
    <package android:name="org.telegram.messenger" />
</queries>

guilhermeagostinelli avatar Jun 15 '22 15:06 guilhermeagostinelli