romatroskin / social_share_plugin

Social Share to Facebook and Instagram Flutter plugin.
BSD 2-Clause "Simplified" License
41 stars 86 forks source link

The shareToFeedFacebookLink doesn't return the response if you post shared successfully or cancelled. Callbacks are not triggered #22

Closed vuleanh closed 4 years ago

vuleanh commented 4 years ago

Please help. Anyone is facing the same problem. Thanks alot

romatroskin commented 4 years ago

In the example app callbacks are triggered. FACEBOOK CANCELLED printed on cancel and FACEBOOK SUCCESS on successful sharing, just checked it out.

vuleanh commented 4 years ago

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

<!-- The INTERNET permission is required for development. Specifically,
     flutter needs it to communicate with the running application
     to allow setting breakpoints, to provide hot reload, etc.
-->
<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.FOREGROUND_SERVICE" />
<uses-permission android:name="android.permission.CAMERA" />
<uses-permission android:name="android.permission.VIBRATE"/>

<!-- io.flutter.app.FlutterApplication is an android.app.Application that
     calls FlutterMain.startInitialization(this); in its onCreate method.
     In most cases you can leave this as-is, but you if you want to provide
     additional functionality it is fine to subclass or reimplement
     FlutterApplication and put your custom class here. -->
<application
    android:name="io.flutter.app.FlutterApplication"
    android:label="@string/app_name"
    android:allowBackup="false"
    android:icon="@mipmap/ic_launcher"
    tools:replace="android:label">
    <activity
        android:name=".MainActivity"
        android:launchMode="singleTask"
        android:theme="@style/LaunchTheme"
        android:configChanges="orientation|keyboardHidden|keyboard|screenSize|locale|layoutDirection|fontScale|screenLayout|density"
        android:hardwareAccelerated="true"
        android:screenOrientation="portrait"
        android:windowSoftInputMode="adjustResize">
        <!-- This keeps the window background of the activity showing
             until Flutter renders its first frame. It can be removed if
             there is no splash screen (such as the default splash screen
             defined in @style/LaunchTheme). -->
        <meta-data
            android:name="io.flutter.app.android.SplashScreenUntilFirstFrame"
            android:value="true" />
        <intent-filter>
            <action android:name="android.intent.action.MAIN"/>
            <category android:name="android.intent.category.LAUNCHER"/>
        </intent-filter>
        <!-- Branch URI scheme -->
        <intent-filter>
            <data android:scheme="backhug" android:host="open"/>
            <action android:name="android.intent.action.VIEW" />
            <category android:name="android.intent.category.DEFAULT" />
            <category android:name="android.intent.category.BROWSABLE" />
        </intent-filter>

        <!-- Branch App Links -->
        <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:scheme="https" android:host="backhug.app.link" />
        </intent-filter>

        <intent-filter>
            <action android:name="FLUTTER_NOTIFICATION_CLICK" />
            <category android:name="android.intent.category.DEFAULT" />
        </intent-filter>
    </activity>

    <service android:name="com.pacla.foregroundservice.ForegroundService" >
    </service>
    <activity android:screenOrientation="portrait" android:name="com.apptreesoftware.barcodescan.BarcodeScannerActivity"/>

    <!-- Branch init -->
    <meta-data android:name="io.branch.sdk.BranchKey" android:value="key_live_mkHwgebc6OlhRJZZUdWrNpmiFulcZ3HZ" />
    <meta-data android:name="io.branch.sdk.TestMode" android:value="false" /> <!-- Set to true to use Branch_Test_Key -->

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

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

    <!-- Branch install referrer tracking -->
    <receiver android:name="io.branch.referral.InstallListener" android:exported="true">
        <intent-filter>
            <action android:name="com.android.vending.INSTALL_REFERRER" />
        </intent-filter>
    </receiver>

    <meta-data android:name="com.facebook.sdk.ApplicationId"
        android:value="@string/facebook_app_id"/>

    <meta-data android:name="com.facebook.sdk.ApplicationName"
        android:value="@string/app_name"/>

    <activity android:name="com.facebook.FacebookActivity"
        android:configChanges=
            "keyboard|keyboardHidden|screenLayout|screenSize|orientation"
        android:label="@string/app_name" />

    <provider android:authorities="com.facebook.app.FacebookContentProvider1232858287105015"
        android:name="com.facebook.FacebookContentProvider"
        android:exported="true"/>

    <provider android:name="androidx.core.content.FileProvider"
        android:authorities="com.pacla.backhug.social.share.fileprovider"
        android:exported="false"
        android:grantUriPermissions="true">
        <meta-data
            android:name="android.support.FILE_PROVIDER_PATHS"
            android:resource="@xml/provider_paths"/>
    </provider>

    <activity
        android:name="com.facebook.CustomTabActivity"
        android:exported="true">
        <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="@string/fb_login_protocol_scheme" />
        </intent-filter>
    </activity>
</application>

`package com.pacla.backhug;

import android.os.Bundle;

import io.flutter.plugins.GeneratedPluginRegistrant; import io.flutter.app.FlutterActivity;

public class MainActivity extends FlutterActivity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); GeneratedPluginRegistrant.registerWith(this); } }`

This is my Manifest and MainActivity. Still not sure why it is not triggered. Please help . Many thanks

DevRahul123 commented 4 years ago

Hi @vuleanh did you find the solution, i am also facing the same issue, callback are not triggered, i am using this version :: social_share_plugin: ^0.3.1+1