appinioGmbH / flutter_packages

Dart and Flutter plugins/packages used and maintained by @appinioGmbH
187 stars 214 forks source link

shareToFacebook not working on Android #133

Closed ehtiqamar closed 9 months ago

ehtiqamar commented 1 year ago

D/error (11286): A valid Facebook app id must be set in the AndroidManifest.xml or set by calling FacebookSdk.setApplicationId before initializing the sdk.

A valid facebook app id and client token is set in AndroidManfest but it still gives this error

khanmujeeb687 commented 1 year ago

Hey @ehtiqamar , could you please share the code snippet of your android manifest?

kirillmesiats commented 1 year ago

Same for me - shareToFacebook not working on Android. Just no redirect to Facebook App. Android 13, POCO F3. Seems that something invisible appears and goes away immediately. No error happenned.

My AndroidManifest.xml:

`<manifest package="" xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools">

<uses-permission android:name="android.permission.USE_BIOMETRIC"/>
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.MANAGE_EXTERNAL_STORAGE" />

<application
    android:name="${applicationName}"
    android:fullBackupContent="@xml/backup_rules"
    android:icon="@mipmap/ic_launcher"
    android:label="@string/app_name"
    android:roundIcon="@mipmap/ic_launcher_round"
    android:dataExtractionRules="@xml/data_extraction_rules"
    tools:replace="android:fullBackupContent">
    <activity
        android:name=".MainActivity"
        android:configChanges="orientation|keyboardHidden|keyboard|screenSize|smallestScreenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode"
        android:exported="true"
        android:hardwareAccelerated="true"
        android:launchMode="singleTop"
        android:theme="@style/LaunchTheme"
        android:windowSoftInputMode="adjustResize">
        <!-- Specifies an Android theme to apply to this Activity as soon as
             the Android process has started. This theme is visible to the user
             while the Flutter UI initializes. After that, this theme continues
             to determine the Window background behind the Flutter UI. -->
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />
            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>
        <intent-filter android:autoVerify="true">
            <action android:name="android.intent.action.VIEW"/>
            <category android:name="android.intent.category.DEFAULT"/>
            <category android:name="android.intent.category.BROWSABLE"/>
            <data 
                android:host="${firebaseAppLinkHost}"
                android:scheme="https"/>
        </intent-filter>
        <intent-filter android:autoVerify="true">
            <action android:name="android.intent.action.VIEW"/>
            <category android:name="android.intent.category.DEFAULT"/>
            <category android:name="android.intent.category.BROWSABLE"/>
            <data 
                android:host="${appsFlyerAppLinkHost}"
                android:scheme="https"/>
        </intent-filter>
        <intent-filter>
            <action android:name="android.intent.action.VIEW" />
            <category android:name="android.intent.category.DEFAULT" />
            <category android:name="android.intent.category.BROWSABLE" />
            <data android:scheme="${applicationId}" />
        </intent-filter>
        <meta-data
            android:name="io.flutter.embedding.android.NormalTheme"
            android:resource="@style/NormalTheme" />
    </activity>
    <!-- Don't delete the meta-data below.
         This is used by the Flutter tool to generate GeneratedPluginRegistrant.java -->
    <meta-data
        android:name="flutterEmbedding"
        android:value="2" />

    <meta-data
        android:name="com.google.firebase.messaging.default_notification_icon"
        android:resource="@drawable/ic_push_small" />

    <meta-data
        android:name="com.google.firebase.messaging.default_notification_color"
        android:resource="@android:color/black" />

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

    <provider 
        android:name="com.facebook.FacebookContentProvider" 
        android:authorities="com.facebook.app.FacebookContentProvider<facebookAppId>"
        android:exported="true" 
        />
    <meta-data 
        android:name="com.facebook.sdk.ApplicationId" 
        android:value="@string/facebook_app_id" 
        />
    <meta-data 
        android:name="com.facebook.sdk.ClientToken" 
        android:value="@string/facebook_client_token" 
        />
</application>

<queries>
    <intent>
        <action android:name="android.intent.action.VIEW" />
        <data android:scheme="https" />
    </intent>
    <intent>
        <action android:name="android.intent.action.VIEW" />
        <data android:scheme="http" />
    </intent>

    <package android:name="com.facebook.katana"/>
    <package android:name="com.instagram.android"/>
    <intent>
        <action android:name="android.intent.action.SEND" />
        <data android:mimeType="image/*" />
    </intent>
    <provider android:authorities="com.facebook.katana.provider.PlatformProvider" />
</queries>

` P.S. shareToFacebookStory works as expected. But SUCCESS is returned just after redirecting to Facebook App before actual sharing. Is it possible to return result AFTER content is shared?

PrzemyslawPluszowy commented 12 months ago

i have the some problem any solution? V/AudioManager(23923): querySoundEffectsEnabled... D/DecorView(23923): showOrHideHighlightView: hasFocus=false; winMode=1; isMrgNull=true I/RmeSchedManager(23923): init Rme, version is: v1.0 D/ZrHung.AppEyeUiProbe(23923): not watching, wait. D/ActivityThread(23923): Won't deliver top position change in state=4 D/ZrHung.AppEyeUiProbe(23923): restart watching I/RmeSchedManager(23923): init Rme, version is: v1.0 I/RtgSchedEvent(23923): current pid:23923 AppType:-1 D/DecorView(23923): showOrHideHighlightView: hasFocus=true; winMode=1; isMrgNull=true W/InputMethodManager(23923): startInputReason = 1 W/HwRemoteInputMethodManager(23923): isCasting false because IHwDistributedWindowManager is invalid.

facebook close

horizon554 commented 11 months ago

Same problem for me

json1994 commented 10 months ago

me too