Coder Social home page Coder Social logo

openflutter / flutter_share_me Goto Github PK

View Code? Open in Web Editor NEW
153.0 7.0 149.0 5.81 MB

Flutter Plugin for sharing contents to social media. You can use it share to Facebook , WhatsApp , Twitter And System Share UI. Support Url and Text.

Home Page: https://github.com/lizhuoyuan

License: Apache License 2.0

Java 31.85% Objective-C 1.91% Dart 27.10% Ruby 4.85% Kotlin 0.31% Swift 33.99%

flutter_share_me's Issues

WhatsApp sharing is not working

Good afternoon

I am trying to implement the sharing via whatsapp where I am sending image and text, however when the routine calls whatsapp only the text appears and sending only the text below follows what I am doing.

`File file = File(savePath);
var raf = file.openSync(mode: FileMode.write);
raf.writeFromSync(response.data);
await raf.close();

  if (file != null) {
    String base64;
    if ((tiposhared == 'W') || (tiposhared == 'WB')) {
      base64 = base64Encode(file.readAsBytesSync());
      if (tiposhared == 'W') {
        FlutterShareMe().shareToWhatsApp(msg: com.eComDesc, base64Image: base64);
      } else {
        FlutterShareMe().shareToWhatsApp4Biz(msg: com.eComDesc, base64Image: base64);
      }
    }
  }`

share to whatsapp not working

getting this error on ios

VERBOSE-2:ui_dart_state.cc(186)] Unhandled Exception: type '_InternalLinkedHashMap<String, dynamic>' is not a subtype of type 'Map<String, Object>' in type cast
#0 FlutterShareMe.shareToWhatsApp
package:flutter_share_me/flutter_share_me.dart:37
#1 _SharePageState._shareToWhatsapp.
package:believe/…/pages/share_page.dart:424

Missing plugin exception

I installed the plugin as usual. Calling the methods however throws missing plugin exception.

19:08:21.757 26 info flutter.tools [VERBOSE-2:ui_dart_state.cc(148)] Unhandled Exception: MissingPluginException(No implementation found for method system on channel flutter_share_me)
19:08:21.757 27 info flutter.tools #0      MethodChannel.invokeMethod (package:flutter/src/services/platform_channel.dart:300:7)
19:08:21.757 28 info flutter.tools <asynchronous suspension>
19:08:21.757 29 info flutter.tools #1      FlutterShareMe.shareToSystem (package:flutter_share_me/flutter_share_me.dart:33:27)
19:08:21.757 30 info flutter.tools <asynchronous suspension>
19:08:21.757 31 info flutter.tools #2      InviteScreen.build._shareToSystem (package:entree/screens/account/invite.dart:33:15)
19:08:21.757 32 info flutter.tools #3      InviteScreen.build.<anonymous closure>.<anonymous closure> (package:entree/screens/account/invite.dart:97:49)
19:08:21.757 33 info flutter.tools #4      _InkResponseState._handleTap (package:flutter/src/material/ink_well.dart:513:14)
19:08:21.757 34 info flutter.tools #5      _InkResponseState.build.<anonymous closure> (package:flutter/src/material/ink_well.dart:568:30)
19:08:21.757 35 info flutter.tools #6      GestureRecognizer.invokeCallback (package:flutter/src/gestures/recognizer.dart:166:24)
19:08:21.757 36 info flutter.tools #7      TapGestureRecognizer._checkUp (package:flutter/src/gestures/tap.dart:246:9)
19:08:21.757 37 info flutter.tools #8      TapGestureRecognizer.acceptGesture (p<…>

Did a clean build, still the issue persists.

Build Failed in Release Mode (ios)

Hello,
I tried to build a release version but I got this error, it works in debug mode.

Undefined symbols for architecture arm64:
"OBJC_CLASS$_FBSDKShareLinkContent", referenced from:
objc-class-ref in SwiftFlutterShareMePlugin.o
"OBJC_CLASS$_FBSDKShareDialog", referenced from:
objc-class-ref in SwiftFlutterShareMePlugin.o
ld: symbol(s) not found for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
note: Using new build system
note: Building targets in parallel
note: Planning build
note: Analyzing workspace
note: Constructing build description
note: Build preparation complete

.aab fails to upload to Google Play

I'm using version 0.9.1 of this plug-in.

Everything works fine when I build an apk and test this on both the emulator and on a real device.
I'm also able to build a final release version as an .aab file without problems, but this .aab file is not accepted when uploading it to Google Play (through Google Play Console). There is no error message to explain the reason for the upload failure.

It turns out that the .aab file is considered to be invalid because of an invalid resource contained in the Facebook Android SDK ver. 5.9.0 (which this plug-in uses).

I was able to create a valid .aab file using the solution found here:
https://stackoverflow.com/questions/58924089/error-when-trying-upload-aab-to-google-play-console-res-values-fb

Of course, the real fix is for this plug-in to use the updated version of the Facebook SDK.

How add this pub in web project?

How add this pub in web project? I don't know how to setting, for example, add facebook config. I would like that you show tutorial how add this configuration. Thanks!

AndroidX error after installing flutter_facebook_login

I tried both versions:

  • if you want to avoid AndroidX, use version 1.2.0.
  • for AndroidX Flutter projects, use versions 2.0.0 and up.

I can't build my project. it says:


error: package androidx.core.content does not exist
import androidx.core.content.FileProvider;

flutter_share_me: ^0.8.0

Migrate version 2.0.x

Hello @lizhuoyuan

This is the starting point of the discussion of version 2.0.x

Features

  • Able to send personal messages on WhatsApp (Android& ios).
  • Able to share the video using WhatsApp.
  • #50
  • Able to share the image in native share.

Code Structure

  • Add Robust error handling for Android & IOS.
  • Add linting support.
  • Improve code quality.

Let me know if we need to add anything else.
Feedback is welcome.

Jigar

export="false" causing exception in vs code

why we are exporting false in provider? what is the reason?
Here is my Menifest,

<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.example.mog" xmlns:tools="http://schemas.android.com/tools">
	<uses-permission android:name="android.permission.CAMERA" />
	<uses-permission android:name="android.permission.INTERNET" />
	<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
	<application android:name="io.flutter.app.FlutterApplication" android:label="mokoo_dog" android:icon="@mipmap/ic_launcher">
		<meta-data android:name="com.google.android.geo.API_KEY" android:value="AIzaSyDlws99uIlKKmMTuo443NXa8RNUO7L4vLw" />
		<meta-data android:name="com.facebook.sdk.ApplicationId" android:value="@string/facebook_app_id" />
		<provider android:name="com.facebook.FacebookContentProvider" android:authorities="com.facebook.app.FacebookContentProvider457320668485189" android:exported="false"/>
		<activity android:name=".MainActivity" android:launchMode="singleTop" android:theme="@style/LaunchTheme" android:configChanges="orientation|keyboardHidden|keyboard|screenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode" android:hardwareAccelerated="true" android:windowSoftInputMode="adjustResize">
			<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>
		</activity>
	</application>
</manifest>

Herer is exception

D:\Mobile\Flutter Projects\moo\android\app\src\debug\AndroidManifest.xml:15:143-167 Error:
Attribute provider#com.facebook.FacebookContentProvider@exported value=(false) from AndroidManifest.xml:15:143-167
is also present at [:flutter_share_me] AndroidManifest.xml:13:13-36 value=(true).
Suggestion: add 'tools:replace="android:exported"' to element at AndroidManifest.xml to override.

FAILURE: Build failed with an exception.

  • What went wrong:
    Execution failed for task ':app:processDebugManifest'.
    Manifest merger failed with multiple errors, see logs

  • Try:
    Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

  • Get more help at https://help.gradle.org

BUILD FAILED in 5s
Running Gradle task 'assembleDebug'...
Running Gradle task 'assembleDebug'... Done 6.6s
Gradle task assembleDebug failed with exit code 1

It works fine when removed "export=false" and add "tools:replace="android:authorities"

Incompatible with flutter_webview_plugin, gradle build failure

I am using flutter_webview_plugin in my app

and when I tried to build the app this was the error

and it had something related to flutter_share_me package .

D:\vicky\Work\WritCo\writco\android\app\src\debug\AndroidManifest.xml:17:17-50 Error:
Attribute meta-data#android.support.FILE_PROVIDER_PATHS@resource value=(@xml/filepaths) from [:flutter_webview_plugin] AndroidManifest.xml:17:17-50
is also present at [:flutter_share_me] AndroidManifest.xml:21:17-51 value=(@xml/file_paths).
Suggestion: add 'tools:replace="android:resource"' to element at AndroidManifest.xml to override.

FAILURE: Build failed with an exception.

  • What went wrong:
    Execution failed for task ':app:processDebugManifest'.

Manifest merger failed : Attribute meta-data#android.support.FILE_PROVIDER_PATHS@resource value=(@xml/filepaths) from [:flutter_webview_plugin] AndroidManifest.xml:17:17-50
is also present at [:flutter_share_me] AndroidManifest.xml:21:17-51 value=(@xml/file_paths).
Suggestion: add 'tools:replace="android:resource"' to element at AndroidManifest.xml to override.

I was not able to figure it out so can anyone suggest anything ?

Not opening Facebook

I am using this Plug-in. It's smoothly work on emulator but crashes on Real Device. Only Facebook create this problem. Twitter works fine.

WhatsApp msg

Is there any way to send it directly to a specific number?

Share image to whatsapp

Hi
Share the image to whats app not working,
it just. take the message and ignore the image

IOS SLRemoteComposeViewController error.

When running on ios device it will say everything worked when sharing to facebook. I do have facebook installed and it finds my account just fine. The post never appears. If I run the device hooked into xcode so I can watch the errors, I get the following after perceiving the post to work just fine.

2021-08-12 20:05:38.680313-0700 Runner[3385:1487872] [core] SLRemoteComposeViewController: (this may be harmless) viewServiceDidTerminateWithError: Error Domain=_UIViewServiceErrorDomain Code=1 "(null)" UserInfo={Terminated=disconnect method}
2021-08-12 20:05:41.422189-0700 Runner[3385:1491843] [] tcp_input [C20.1:3] flags=[R] seq=850013987, ack=0, win=0 state=CLOSED rcv_nxt=850013987, snd_una=485929286
2021-08-12 20:05:41.422371-0700 Runner[3385:1491843] [] tcp_input [C20.1:3] flags=[R] seq=850013987, ack=0, win=0 state=CLOSED rcv_nxt=850013987, snd_una=485929286

I've updated the pods and tried again.

Installing FBSDKCoreKit (5.15.1)
Installing FBSDKShareKit (5.15.1)
Installing FacebookCore (0.9.0)
Installing FacebookShare (0.9.0)

This was happening on version 0.11.2 and I just updated to 1.0.0 and tried with the same result.

IMPORTANT : This goes beyond the plugin. There are issues of this of this on stack overflow. Fixes are random and all over the place, including updating the facebook SDK's, changing the function call from url to urls, etc... Not sure which it could be, but I'm very sure it's not you. Just have to find the workaround.

Warning when tried to built the app

I received an warning when tried to build the app.

Note: C:\flutter.pub-cache\hosted\pub.dartlang.org\flutter_share_me-0.5.0\android\src\main\java\zhuoyuan\li\fluttershareme\util\FileUtil.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.

Unable to use without Registering My App In Facebook

I don't want Facebook share but the plugin crashes as the app is not connected to Facebook.
Remove the restriction pls

Built build\app\outputs\apk\debug\app-debug.apk.
Error: ADB exited with exit code 1
Performing Streamed Install

adb: failed to install D:\CURRENT\whatsappstatus\build\app\outputs\apk\app.apk: Failure [INSTALL_FAILED_CONFLICTING_PROVIDER: Package couldn't be installed in /data/app/thondan.whatsappstatus-VPXO5oVnAcG4rDB9pkxt_A==: Can't install because provider name com.facebook.app.FacebookContentProvider1234567890 (in package com.android.apptwo) is already used by com.android.appone]
Error launching application on SM M105F

Filter ShareToSystem Application List

When I use the await command FlutterShareMe (). ShareToSystem (msg: 'test');

Is displayed all the list of applications I can share, is it possible to filter just a few example twitter, facebook, whatsapp, instagram, telegram, gmail and outlook?

iOS Support

Someone please help with iOS support for this plugin. I wish I had the knowledge to contribute.

Error while generating the main dex list

Launching lib/main.dart on SM G965F in debug mode...
Initializing gradle...
Resolving dependencies...
Running Gradle task 'assembleDebug'...
Note: /Users/rranjan/work/iS/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_share_me-0.2.1/android/src/main/java/zhuoyuan/li/fluttershareme/FlutterShareMePlugin.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
warning: unknown enum constant ThreadMode.MAIN
reason: class file for org.greenrobot.eventbus.ThreadMode not found
1 warning

FAILURE: Build failed with an exception.

  • What went wrong:
    Execution failed for task ':app:transformClassesWithMultidexlistForDebug'.
    com.android.build.api.transform.TransformException: Error while generating the main dex list.

  • Try:
    Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

  • Get more help at https://help.gradle.org

BUILD FAILED in 26s
Finished with error: Gradle task assembleDebug failed with exit code 1

This is the error while doing a Android build.

Not able to test the example

Hi
While trying to build the example app,
I am getting the below error.
Based on the read me instructions, I have changed the facebook id details in the corresponding file.
FlutterShareMePlugin.java:53: error: cannot find symbol
[ ] onAttachedToEngine(binding.getBinaryMessenger());
symbol: method getBinaryMessenger()
[ ] location: variable binding of type FlutterPluginBinding
[ ] 1 error

flutter_share_me 和 flutter_webview_plugin 冲突了

error:
Attribute provider#androidx.core.content.FileProvider@authorities value=(com.freeupapp.freeup.provider) from [:flutter_share_me] AndroidManifest.xml:16:13-60
is also present at [:flutter_webview_plugin] AndroidManifest.xml:11:13-64 value=(com.freeupapp.freeup.fileprovider).
Suggestion: add 'tools:replace="android:authorities"' to element at AndroidManifest.xml:14:9-22:20 to override.
/Users/feature_ZH/Documents/FreeUpApp/freeup_app/android/app/src/debug/AndroidManifest.xml:18:17-72 Error:
Attribute meta-data#android.support.FILE_PROVIDER_PATHS@resource value=(@xml/file_paths) from [:image_picker] AndroidManifest.xml:18:17-72
is also present at [:flutter_webview_plugin] AndroidManifest.xml:17:17-50 value=(@xml/filepaths).
Suggestion: add 'tools:replace="android:resource"' to element at AndroidManifest.xml to override.


The Gradle failure may have been because of AndroidX incompatibilities in this Flutter app.
See https://goo.gl/CP92wY for more information on the problem and how to fix it.


Finished with error: Gradle task assembleDebug failed with exit code 1

Map<String, dynamic>() as Map<String, Object>; Runing error

E/flutter (27281): [ERROR:flutter/lib/ui/ui_dart_state.cc(199)] Unhandled Exception: type '_InternalLinkedHashMap<String, dynamic>' is not a subtype of type 'Map<String, Object>' in type cast
E/flutter (27281): #0 FlutterShareMe.shareToFacebook (package:flutter_share_me/flutter_share_me.dart:8:66)

-canOpenURL: failed for URL: "instagram://app"

I'm having a heck of time with the instagram share function on iOS. Works fine for me on Android.

When I attempt to share on iOS, I get the following error

-canOpenURL: failed for URL: "instagram://app" - error: "This app is not allowed to query for scheme instagram"

I do have instagram in plist, as the example app shows:

<key>LSApplicationQueriesSchemes</key> <array> <string>instagram</string>

I also tried <string>instagram://app</string>, as suggested by Facebook documentation, but get the same error.

I am using a real device and instagram is installed on that device.

I attempted to reproduce the issue with the example app. While I can compile and run the example on Android, it fails to build for me on iOS:

$ flutter build ios
Expected ios/Runner.xcodeproj/project.pbxproj but this file is missing.

Application not configured for iOS

$ ls ./Runner
AppDelegate.swift               Base.lproj                      GeneratedPluginRegistrant.m     Runner-Bridging-Header.h
Assets.xcassets                 GeneratedPluginRegistrant.h     Info.plist

$ ls ./Runner.xcodeproj/
project.xcworkspace     xcshareddata
Taylors-MBP:ios taylorgarabedian$ 

While its likely my problem is due to ignorance with iOS, I thought it possible this is a real. issue.

My test environment is using Xcode Version 13.0 (13A233)

ApplicationID Facebook

In the documentation says I need to add the following line in AndroidManifest.xml:

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

I believe I am not able to report this correctly because when I inform I can not compile nor trigger the debug mode of application Applicationid of my application is com.home how to proceed to inform correctly?

Can't build for android

Hi,

When trying to build for release on android I'm getting the following error:

`
Execution failed for task ':flutter_share_me:verifyReleaseResources'.

java.util.concurrent.ExecutionException: com.android.builder.internal.aapt.v2.Aapt2Exception: Android resource linking failed
/Users/amit/Workspace/FlutterApps/maariv_new/build/flutter_share_me/intermediates/res/merged/release/values-v28/values-v28.xml:7: error: resource android:attr/dialogCornerRadius not found.
/Users/amit/Workspace/FlutterApps/maariv_new/build/flutter_share_me/intermediates/res/merged/release/values-v28/values-v28.xml:11: error: resource android:attr/dialogCornerRadius not found.
/Users/amit/Workspace/FlutterApps/maariv_new/build/flutter_share_me/intermediates/res/merged/release/values/values.xml:3286: error: resource android:attr/fontVariationSettings not found.
/Users/amit/Workspace/FlutterApps/maariv_new/build/flutter_share_me/intermediates/res/merged/release/values/values.xml:3287: error: resource android:attr/ttcIndex not found.
error: failed linking references.
`

Can anyone help me?

iOS support?

I'm having problems getting it to work with iOS. I am trying to share to Twitter.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.