ShekarMudaliyar / social_share

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

everything is false in checkInstalledAppsForShare #81

Open ArtemZip opened 3 years ago

ArtemZip commented 3 years ago
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 commented 3 years ago

Solved by downgrading compileSdkVersion and targetSdkVersion to 28 instead of 30

somy360 commented 2 years ago

Adding

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

In AndroidManifest.xml also solved this issue for me

rishabh89 commented 2 years ago

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

Solved by downgrading compileSdkVersion and targetSdkVersion to 28 instead of 30

what about iOS

guilhermeagostinelli commented 2 years ago

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>