Git Product home page Git Product logo

shareextend's Introduction

Language: English | 中文简体

ShareExtend

pub package

A Flutter plugin for iOS and Android for sharing text, image, video and file with system ui.

Installation

First, add share_extend as a dependency in your pubspec.yaml file.

dependencies:
  share_extend: "^2.0.0"

iOS

Add the following key to your info.plist file, located in <project root>/ios/Runner/Info.plist for saving shared images to photo library.

<key>NSPhotoLibraryAddUsageDescription</key>
<string>describe why your app needs access to write photo library</string>

Android

If your project needs read and write permissions for sharing external storage file, please add the following permissions to your AndroidManifest.xml, located in <project root>/android/app/src/main/AndroidManifest.xml

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

Import

import 'package:share_extend/share_extend.dart';

Example


//share text
ShareExtend.share("share text", "text","android share panel title","share subject");

//share image
File f =
    await ImagePicker.pickImage(source: ImageSource.gallery);
ShareExtend.share(f.path, "image");

//share video
File f = await ImagePicker.pickVideo(
        source: ImageSource.gallery);
ShareExtend.share(f.path, "video");

//share file
Directory dir = Platform.isAndroid
    ? await getExternalStorageDirectory()
    : await getApplicationDocumentsDirectory();
File testFile = new File("${dir.path}/flutter/test.txt");
if (!await testFile.exists()) {
  await testFile.create(recursive: true);
  testFile.writeAsStringSync("test for share documents file");
}
ShareExtend.share(testFile.path, "file");

///share multiple images
_shareMultipleImages() async {
  List<Asset> assetList = await MultiImagePicker.pickImages(maxImages: 5);
  var imageList = List<String>();
  for (var asset in assetList) {
    String path =
        await _writeByteToImageFile(await asset.getByteData(quality: 30));
    imageList.add(path);
  }
  ShareExtend.shareMultiple(imageList, "image",subject: "share muti image");
}

Future<String> _writeByteToImageFile(ByteData byteData) async {
  Directory dir = Platform.isAndroid
      ? await getExternalStorageDirectory()
      : await getApplicationDocumentsDirectory();
  File imageFile = new File(
      "${dir.path}/flutter/${DateTime.now().millisecondsSinceEpoch}.png");
  imageFile.createSync(recursive: true);
  imageFile.writeAsBytesSync(byteData.buffer.asUint8List(0));
  return imageFile.path;
}

shareextend's People

Contributors

jeuler avatar mbikyaw avatar mehdithreem avatar miguelpruivo avatar sgehrman avatar zhouteng0217 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

shareextend's Issues

java.lang.NullPointerException: Attempt to invoke virtual method 'android.content.res.XmlResourceParser android.content.pm.ProviderInfo.loadXmlMetaData(android.content.pm.PackageManager, java.lang.String)' on a null object reference

CustomCacheManager().getFile(imageUrl).listen((_info){
      print("--------------${_info.file.path}");
      ShareExtend.share(_info.file.path, "image");
    });

print

I/flutter (10823): --------------/data/user/0/com.example.example/cache/customCache/2ae80350-3260-11e9-95f4-fd084d457e91.jpeg

Android

E/MethodChannel#share_extend(10823): Failed to handle method call
E/MethodChannel#share_extend(10823): java.lang.NullPointerException: Attempt to invoke virtual method 'android.content.res.XmlResourceParser android.content.pm.ProviderInfo.loadXmlMetaData(android.content.pm.PackageManager, java.lang.String)' on a null object reference
E/MethodChannel#share_extend(10823): 	at androidx.core.content.FileProvider.parsePathStrategy(FileProvider.java:605)
E/MethodChannel#share_extend(10823): 	at androidx.core.content.FileProvider.getPathStrategy(FileProvider.java:579)
E/MethodChannel#share_extend(10823): 	at androidx.core.content.FileProvider.getUriForFile(FileProvider.java:417)
E/MethodChannel#share_extend(10823): 	at com.zt.shareextend.ShareUtils.getUriForFile(ShareUtils.java:29)
E/MethodChannel#share_extend(10823): 	at com.zt.shareextend.ShareExtendPlugin.share(ShareExtendPlugin.java:81)
E/MethodChannel#share_extend(10823): 	at com.zt.shareextend.ShareExtendPlugin.onMethodCall(ShareExtendPlugin.java:51)
E/MethodChannel#share_extend(10823): 	at io.flutter.plugin.common.MethodChannel$IncomingMethodCallHandler.onMessage(MethodChannel.java:201)
E/MethodChannel#share_extend(10823): 	at io.flutter.view.FlutterNativeView$PlatformMessageHandlerImpl.handleMessageFromDart(FlutterNativeView.java:188)
E/MethodChannel#share_extend(10823): 	at io.flutter.embedding.engine.FlutterJNI.handlePlatformMessage(FlutterJNI.java:202)
E/MethodChannel#share_extend(10823): 	at android.os.MessageQueue.nativePollOnce(Native Method)
E/MethodChannel#share_extend(10823): 	at android.os.MessageQueue.next(MessageQueue.java:326)
E/MethodChannel#share_extend(10823): 	at android.os.Looper.loop(Looper.java:160)
E/MethodChannel#share_extend(10823): 	at android.app.ActivityThread.main(ActivityThread.java:6669)
E/MethodChannel#share_extend(10823): 	at java.lang.reflect.Method.invoke(Native Method)
E/MethodChannel#share_extend(10823): 	at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)
E/MethodChannel#share_extend(10823): 	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:858)

Flutter

E/flutter (10823): [ERROR:flutter/lib/ui/ui_dart_state.cc(148)] Unhandled Exception: PlatformException(error, Attempt to invoke virtual method 'android.content.res.XmlResourceParser android.content.pm.ProviderInfo.loadXmlMetaData(android.content.pm.PackageManager, java.lang.String)' on a null object reference, null)
E/flutter (10823): #0      StandardMethodCodec.decodeEnvelope (package:flutter/src/services/message_codecs.dart:564:7)
E/flutter (10823): #1      MethodChannel.invokeMethod (package:flutter/src/services/platform_channel.dart:302:33)
E/flutter (10823): <asynchronous suspension>
E/flutter (10823): #2      ShareExtend.share (package:share_extend/share_extend.dart:37:21)
E/flutter (10823): #3      ExamplePresenter.share.<anonymous closure> (package:example/presenter/example_presenter.dart:80:19)
E/flutter (10823): #4      _rootRunUnary (dart:async/zone.dart:1132:38)
E/flutter (10823): #5      _CustomZone.runUnary (dart:async/zone.dart:1029:19)
E/flutter (10823): #6      _CustomZone.runUnaryGuarded (dart:async/zone.dart:931:7)
E/flutter (10823): #7      _BufferingStreamSubscription._sendData (dart:async/stream_impl.dart:336:11)
E/flutter (10823): #8      _DelayedData.perform (dart:async/stream_impl.dart:591:14)
E/flutter (10823): #9      _StreamImplEvents.handleNext (dart:async/stream_impl.dart:707:11)
E/flutter (10823): #10     _PendingEvents.schedule.<anonymous closure> (dart:async/stream_impl.dart:667:7)
E/flutter (10823): #11     _rootRun (dart:async/zone.dart:1120:38)
E/flutter (10823): #12     _CustomZone.run (dart:async/zone.dart:1021:19)
E/flutter (10823): #13     _CustomZone.runGuarded (dart:async/zone.dart:923:7)
E/flutter (10823): #14     _CustomZone.bindCallbackGuarded.<anonymous closure> (dart:async/zone.dart:963:23)
E/flutter (10823): #15     _rootRun (dart:async/zone.dart:1124:13)
E/flutter (10823): #16     _CustomZone.run (dart:async/zone.dart:1021:19)
E/flutter (10823): #17     _CustomZone.runGuarded (dart:async/zone.dart:923:7)
E/flutter (10823): #18     _CustomZone.bindCallbackGuarded.<anonymous closure> (dart:async/zone.dart:963:23)
E/flutter (10823): #19     _microtaskLoop (dart:async/schedule_microtask.dart:41:21)
E/flutter (10823): #20     _startMicrotaskLoop (dart:async/schedule_microtask.dart:50:5)

iOS app crashing when Save Image is selected

On an iOS device, the app crashes when I select Save Image - This is on the SImulator. When I select Shared Albums I get the shared albums dialog which seems fine. Just the "Save Image" link causes the app to crash.
No debug output. It just terminates.

The plugin `share_extend` is built using an older version of the Android plugin API

Hi! Thank you for your good job.
I try to use your plugin in embeded flutter module and have a warning above:
The plugin share_extend is built using an older version of the Android plugin API which assumes that it's running in a full-Flutter environment. It may have undefined behaviors when Flutter is integrated into an existing app as a module.
The plugin can be updated to the v2 Android Plugin APIs by following https://flutter.dev/go/android-plugin-migration.
Can you do it upgrade?

can't share text + image Android on whatsapp

Only image getting shared.

ShareExtend.share(file.path, 'this is my image', subject: "Hello");

there is no text when sharing.

I think there should be a line in ShareExtendedPlugin.java after line number 102

shareIntent.putExtra(Intent.EXTRA_TEXT, type);

getting Permission Denial: reading com.zt.shareextend.ShareExtendProvider uri c

E/DatabaseUtils( 6372): java.lang.SecurityException: Permission Denial: reading com.zt.shareextend.ShareExtendProvider uri content://kw.ltd.sss.shareextend.fileprovider/root_path/data/data/kw.ltd.corovavirusapp/app_flutter/2020-03-23T16%3A56%3A26.803860.png from pid=6011, uid=1000 requires the provider be exported, or grantUriPermission()

i already applied

Sharing big file

It can't share big mp4 file (~85Mb) to Viber, Gmail, Telegram and so on. Unfortunately I can't see any errors and exceptions.
Testing device Samsung Galaxy A30 with Android 10.

macos support

It would be great to have macos support. Basically show a platform file save dialog to save a shared file.

Unable to share audio file

Hi,

I tried to share .mp3 or .acc or .wav on whatsapp for example and always say "file type is not supported", any advise? When I save on dropbox works.

pubspec share_extend: ^1.1.5

void _share() async {
    print(_recordedFile); // /storage/emulated/0/Android/data/com.xxxx.myapp/files/xxxx.aac
    ShareExtend.share(_recordedFile.path, "file");
  }

thank you

missingplugin

hi i have a porblem.

D/jniPdfium(19205): Init FPDF library
D/EGL_emulation(19205): eglMakeCurrent: 0xd6a1a240: ver 3 1 (tinfo 0xd6a0f810)
E/flutter (19205): [ERROR:flutter/lib/ui/ui_dart_state.cc(157)] Unhandled Exception: MissingPluginException(No implementation found for method share on channel com.zt.shareextend/share_extend)
E/flutter (19205): #0 MethodChannel.invokeMethod
package:flutter/…/services/platform_channel.dart:319
E/flutter (19205):
E/flutter (19205): #1 ShareExtend._shareInner (package:share_extend/share_extend.dart:62:21)
E/flutter (19205): #2 ShareExtend.share (package:share_extend/share_extend.dart:34:12)
E/flutter (19205): #3 _SonuclarPDFEkraniState.build.
package:sis_av_hesaplama/screen/sonuc_pdfekrani.dart:103
E/flutter (19205): #4 _InkResponseState._handleTap
package:flutter/…/material/ink_well.dart:706
E/flutter (19205): #5 _InkResponseState.build.
package:flutter/…/material/ink_well.dart:789
E/flutter (19205): #6 GestureRecognizer.invokeCallback

ios分享text到微信不成功

ios下分享text到微信,提示【不支持分享类型,无法分享到微信】。在安卓下没问题,ios下分享到其它qq,邮件都行,这个问题在多个ios设备上都出现,并且之前用的1.1.5和现在新的1.1.7都存在,请看看怎么解决,谢谢。

Warnings about CharSequence and String

Hi, amazing work!

I have these warnings on Android, when I use shareMultiple with images, everything is ok but, I just wanted to say this to have cleaner code.

Thanks


W/Bundle (25424): Key android.intent.extra.TEXT expected ArrayList but value was a java.lang.String. The default value was returned.
W/Bundle (25424): Attempt to cast generated internal exception:
W/Bundle (25424): java.lang.ClassCastException: java.lang.String cannot be cast to java.util.ArrayList
W/Bundle (25424): at android.os.BaseBundle.getCharSequenceArrayList(BaseBundle.java:1302)
W/Bundle (25424): at android.os.Bundle.getCharSequenceArrayList(Bundle.java:1076)
W/Bundle (25424): at android.content.Intent.getCharSequenceArrayListExtra(Intent.java:7570)
W/Bundle (25424): at android.content.Intent.migrateExtraStreamToClipData(Intent.java:10415)
W/Bundle (25424): at android.content.Intent.migrateExtraStreamToClipData(Intent.java:10378)
W/Bundle (25424): at android.app.Instrumentation.execStartActivity(Instrumentation.java:1735)
W/Bundle (25424): at android.app.Activity.startActivityForResult(Activity.java:4594)
W/Bundle (25424): at android.app.Activity.startActivityForResult(Activity.java:4552)
W/Bundle (25424): at android.app.Activity.startActivity(Activity.java:4917)
W/Bundle (25424): at android.app.Activity.startActivity(Activity.java:4885)
W/Bundle (25424): at com.zt.shareextend.Share.startChooserActivity(Share.java:104)
W/Bundle (25424): at com.zt.shareextend.Share.share(Share.java:96)
W/Bundle (25424): at com.zt.shareextend.MethodCallHandlerImpl.onMethodCall(MethodCallHandlerImpl.java:29)
W/Bundle (25424): at io.flutter.plugin.common.MethodChannel$IncomingMethodCallHandler.onMessage(MethodChannel.java:230)
W/Bundle (25424): at io.flutter.embedding.engine.dart.DartMessenger.handleMessageFromDart(DartMessenger.java:85)
W/Bundle (25424): at io.flutter.embedding.engine.FlutterJNI.handlePlatformMessage(FlutterJNI.java:692)
W/Bundle (25424): at android.os.MessageQueue.nativePollOnce(Native Method)
W/Bundle (25424): at android.os.MessageQueue.next(MessageQueue.java:326)
W/Bundle (25424): at android.os.Looper.loop(Looper.java:160)
W/Bundle (25424): at android.app.ActivityThread.main(ActivityThread.java:6923)
W/Bundle (25424): at java.lang.reflect.Method.invoke(Native Method)
W/Bundle (25424): at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)
W/Bundle (25424): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:870)

Nothing popped up

Nothing popped up after I clicked on share text or after I picked image or videos. I am using ios 13.4 (not sure if that affects this package?)

Is there any possible solution?

Thanks!

java.lang.NullPointerException: Attempt to read from field 'android.content.pm.ApplicationInfo android.content.pm.ComponentInfo.applicationInfo' on a null object reference

Failed to handle method call
E/MethodChannel#com.zt.shareextend/share_extend(32332): java.lang.NullPointerException: Attempt to read from field 'android.content.pm.ApplicationInfo android.content.pm.ComponentInfo.applicationInfo' on a null object reference
E/MethodChannel#com.zt.shareextend/share_extend(32332): at android.os.Parcel.readException(Parcel.java:1960)
E/MethodChannel#com.zt.shareextend/share_extend(32332): at android.os.Parcel.readException(Parcel.java:1900)
E/MethodChannel#com.zt.shareextend/share_extend(32332): at android.content.pm.IPackageManager$Stub$Proxy.queryIntentActivities(IPackageManager.java:3621)
E/MethodChannel#com.zt.shareextend/share_extend(32332): at android.app.ApplicationPackageManager.queryIntentActivitiesAsUser(ApplicationPackageManager.java:944)
E/MethodChannel#com.zt.shareextend/share_extend(32332): at android.app.ApplicationPackageManager.queryIntentActivities(ApplicationPackageManager.java:933)
E/MethodChannel#com.zt.shareextend/share_extend(32332): at com.zt.shareextend.ShareUtils.grantUriPermission(ShareUtils.java:34)
E/MethodChannel#com.zt.shareextend/share_extend(32332): at com.zt.shareextend.ShareExtendPlugin.share(ShareExtendPlugin.java:109)
E/MethodChannel#com.zt.shareextend/share_extend(32332): at com.zt.shareextend.ShareExtendPlugin.onMethodCall(ShareExtendPlugin.java:61)
E/MethodChannel#com.zt.shareextend/share_extend(32332): at io.flutter.plugin.common.MethodChannel$IncomingMethodCallHandler.onMessage(MethodChannel.java:226)
E/MethodChannel#com.zt.shareextend/share_extend(32332): at io.flutter.embedding.engine.dart.DartMessenger.handleMessageFromDart(DartMessenger.java:85)
E/MethodChannel#com.zt.shareextend/share_extend(32332): at io.flutter.embedding.engine.FlutterJNI.handlePlatformMessage(FlutterJNI.java:631)
E/MethodChannel#com.zt.shareextend/share_extend(32332): at android.os.MessageQueue.nativePollOnce(Native Method)
E/MethodChannel#com.zt.shareextend/share_extend(32332): at android.os.MessageQueue.next(MessageQueue.java:379)
E/MethodChannel#com.zt.shareextend/share_extend(32332): at android.os.Looper.loop(Looper.java:144)
E/MethodChannel#com.zt.shareextend/share_extend(32332): at android.app.ActivityThread.main(ActivityThread.java:7529)
E/MethodChannel#com.zt.shareextend/share_extend(32332): at java.lang.reflect.Method.invoke(Native Method)
E/MethodChannel#com.zt.shareextend/share_extend(32332): at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:245)
E/MethodChannel#com.zt.shareextend/share_extend(32332): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:921)
W/InputMethodManager(32332): startInputReason = 1
E/flutter (32332): [ERROR:flutter/lib/ui/ui_dart_state.cc(157)] Unhandled Exception: PlatformException(error, Attempt to read from field 'android.content.pm.ApplicationInfo android.content.pm.ComponentInfo.applicationInfo' on a null object reference, null)
E/flutter (32332): #0 StandardMethodCodec.decodeEnvelope (package:flutter/src/services/message_codecs.dart:569:7)
E/flutter (32332): #1 MethodChannel._invokeMethod (package:flutter/src/services/platform_channel.dart:156:18)
E/flutter (32332):
E/flutter (32332): #2 MethodChannel.invokeMethod (package:flutter/src/services/platform_channel.dart:329:12)
E/flutter (32332): #3 ShareExtend._shareInner (package:share_extend/share_extend.dart:62:21)
E/flutter (32332): #4 ShareExtend.share (package:share_extend/share_extend.dart:34:12)
E/flutter (32332): #5 _MyAppState.build. (package:share_extend_example/main.dart:49:35)
E/flutter (32332):
E/flutter (32332): #6 _MyAppState.build. (package:share_extend_example/main.dart)
E/flutter (32332): #7 _InkResponseState._handleTap (package:flutter/src/material/ink_well.dart:772:19)
E/flutter (32332): #8 _InkResponseState.build. (package:flutter/src/material/ink_well.dart:855:36)
E/flutter (32332): #9 GestureRecognizer.invokeCallback (package:flutter/src/gestures/recognizer.dart:182:24)
E/flutter (32332): #10 TapGestureRecognizer.handleTapUp (package:flutter/src/gestures/tap.dart:504:11)
E/flutter (32332): #11 BaseTapGestureRecognizer._checkUp (package:flutter/src/gestures/tap.dart:282:5)
E/flutter (32332): #12 BaseTapGestureRecognizer.handlePrimaryPointer (package:flutter/src/gestures/tap.dart:217:7)
E/flutter (32332): #13 PrimaryPointerGestureRecognizer.handleEvent (package:flutter/src/gestures/recognizer.dart:475:9)
E/flutter (32332): #14 PointerRouter._dispatch (package:flutter/src/gestures/pointer_router.dart:76:12)
E/flutter (32332): #15 PointerRouter._dispatchEventToRoutes. (package:flutter/src/gestures/pointer_router.dart:122:9)
E/flutter (32332): #16 _LinkedHashMapMixin.forEach (dart:collection-patch/compact_hash.dart:379:8)
E/flutter (32332): #17 PointerRouter._dispatchEventToRoutes (package:flutter/src/gestures/pointer_router.dart:120:18)
E/flutter (32332): #18 PointerRouter.route (package:flutter/src/gestures/pointer_router.dart:106:7)
E/flutter (32332): #19 GestureBinding.handleEvent (package:flutter/src/gestures/binding.dart:218:19)
E/flutter (32332): #20 GestureBinding.dispatchEvent (package:flutter/src/gestures/binding.dart:198:22)
E/flutter (32332): #21 GestureBinding._handlePointerEvent (package:flutter/src/gestures/binding.dart:156:7)
E/flutter (32332): #22 GestureBinding._flushPointerEventQueue (package:flutter/src/gestures/binding.dart:102:7)
E/flutter (32332): #23 GestureBinding._handlePointerDataPacket (package:flutter/src/gestures/binding.dart:86:7)
E/flutter (32332): #24 _rootRunUnary (dart:async/zone.dart:1196:13)
E/flutter (32332): #25 _CustomZone.runUnary (dart:async/zone.dart:1085:19)
E/flutter (32332): #26 _CustomZone.runUnaryGuarded (dart:async/zone.dart:987:7)
E/flutter (32332): #27 _invoke1 (dart:ui/hooks.dart:275:10)
E/flutter (32332): #28 _dispatchPointerDataPacket (dart:ui/hooks.dart:184:5)

折腾一天了也没有成功希望作者能协助一下,在安卓的手机上

Module 'share_extend' not found

Launching lib/main.dart on iPhone 11 Pro Max in debug mode...
Running pod install... 1.0s
Running Xcode build...
Xcode build done. 14.6s
Failed to build iOS app
Error output from Xcode build:

** BUILD FAILED **

Xcode's output:

error: the following command failed with exit code 0 but produced no further output
CompileC /Users/bruce/Library/Developer/Xcode/DerivedData/Runner-cgopmhyxonoqgqbrncalhjmszkrs/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/FMDB.build/Objects-normal/x86_64/FMDatabaseQueue.o /Users/bruce/Documents/work/esky/interference/ios/Pods/FMDB/src/fmdb/FMDatabaseQueue.m normal x86_64 objective-c com.apple.compilers.llvm.clang.1_0.compiler
error: the following command failed with exit code 0 but produced no further output
CompileC /Users/bruce/Library/Developer/Xcode/DerivedData/Runner-cgopmhyxonoqgqbrncalhjmszkrs/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/FMDB.build/Objects-normal/x86_64/FMDatabase.o /Users/bruce/Documents/work/esky/interference/ios/Pods/FMDB/src/fmdb/FMDatabase.m normal x86_64 objective-c com.apple.compilers.llvm.clang.1_0.compiler
/Users/bruce/.pub-cache/hosted/pub.flutter-io.cn/permission_handler-4.4.0+hotfix.4/ios/Classes/strategies/NotificationPermissionStrategy.m:71:5: warning: 'UIRemoteNotificationType' is deprecated: first deprecated in iOS 8.0 - Use UserNotifications Framework's UNAuthorizationOptions for user notifications and registerForRemoteNotifications for receiving remote notifications instead. [-Wdeprecated-declarations]
UIRemoteNotificationType type = [[UIApplication sharedApplication] enabledRemoteNotificationTypes];
^
In module 'UIKit' imported from /Users/bruce/Documents/work/esky/interference/ios/Pods/Target Support Files/permission_handler/permission_handler-prefix.pch:2:
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIApplication.h:69:32: note: 'UIRemoteNotificationType' has been explicitly marked deprecated here
typedef NS_OPTIONS(NSUInteger, UIRemoteNotificationType) {
^
/Users/bruce/.pub-cache/hosted/pub.flutter-io.cn/permission_handler-4.4.0+hotfix.4/ios/Classes/strategies/NotificationPermissionStrategy.m:71:72: warning: 'enabledRemoteNotificationTypes' is deprecated: first deprecated in iOS 8.0 - Use -[UIApplication isRegisteredForRemoteNotifications] and UserNotifications Framework's -[UNUserNotificationCenter getNotificationSettingsWithCompletionHandler:] to retrieve user-enabled remote notification and user notification settings [-Wdeprecated-declarations]
UIRemoteNotificationType type = [[UIApplication sharedApplication] enabledRemoteNotificationTypes];
^
In module 'UIKit' imported from /Users/bruce/Documents/work/esky/interference/ios/Pods/Target Support Files/permission_handler/permission_handler-prefix.pch:2:
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIApplication.h:229:1: note: 'enabledRemoteNotificationTypes' has been explicitly marked deprecated here
- (UIRemoteNotificationType)enabledRemoteNotificationTypes API_DEPRECATED("Use -[UIApplication isRegisteredForRemoteNotifications] and UserNotifications Framework's -[UNUserNotificationCenter getNotificationSettingsWithCompletionHandler:] to retrieve user-enabled remote notification and user notification settings", ios(3.0, 8.0)) API_UNAVAILABLE(tvos);
^
2 warnings generated.
/Users/bruce/Documents/work/esky/interference/ios/Runner/GeneratedPluginRegistrant.m:28:9: fatal error: module 'share_extend' not found
@import share_extend;
~~~~~~~^~~~~~~~~~~~
1 error generated.
note: Using new build system
note: Planning build
note: Constructing build description
warning: The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 4.3, but the range of supported deployment target versions is 8.0 to 13.2.99. (in target 'FMDB' from project 'Pods')
warning: Mapping architecture armv7 to i386. Ensure that this target's Architectures and Valid Architectures build settings are configured correctly for the iOS Simulator platform. (in target 'image_picker' from project 'Pods')
warning: Mapping architecture arm64 to x86_64. Ensure that this target's Architectures and Valid Architectures build settings are configured correctly for the iOS Simulator platform. (in target 'image_picker' from project 'Pods')

Could not build the application for the simulator.
Error launching application on iPhone 11 Pro Max.

flutter doctor
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, v1.17.4, on Mac OS X 10.14.6 18G87, locale zh-Hans-CN)
 
[✓] Android toolchain - develop for Android devices (Android SDK version 29.0.3)
[✓] Xcode - develop for iOS and macOS (Xcode 11.3.1)
[✓] Android Studio (version 4.0)
[!] IntelliJ IDEA Ultimate Edition (version 2020.1.1)
    ✗ Flutter plugin not installed; this adds Flutter specific functionality.
    ✗ Dart plugin not installed; this adds Dart specific functionality.
[✓] VS Code (version 1.46.1)
[✓] Connected device (2 available)

! Doctor found issues in 1 category.

Exception has occurred. MissingPluginException (MissingPluginException(No implementation found for method share on channel com.zt.shareextend/share_extend))

i got this error. below is my simple code from your package example.....

class PageTwo extends StatefulWidget {
@OverRide
_PageTwoState createState() => _PageTwoState();
}

class _PageTwoState extends State {
@OverRide
Widget build(BuildContext context) {
return Scaffold(
body: Container(
child: Center(
child: Column(
children: [
RaisedButton(
onPressed: () {
ShareExtend.share("share text", "text",
sharePanelTitle: "share text title",
subject: "share text subject");
},
child: Text("share text"),
),
],
),
),
),
);
}
}

iOS crash sharing using email

On iOS 13.4.1 the plugin v1.1.5 crash with the following error when try to share a picture by email.

2020-05-07 17:26:07.168638+0200 Runner[2644:996745] -[NSNull length]: unrecognized selector sent to instance 0x1f3ef00b0
2020-05-07 17:26:07.169489+0200 Runner[2644:996745] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[NSNull length]: unrecognized selector sent to instance 0x1f3ef00b0'
*** First throw call stack:
(0x1b6ac296c 0x1b67db028 0x1b69c0dcc 0x1b6ac7048 0x1b6ac93a0 0x1c9a266e4 0x1ba57a0e4 0x1ba57ed18 0x1ba4ed890 0x1ba4edbb4 0x1ba4eea34 0x1ba4efd74 0x1ba4d28ac 0x1bb0768b0 0x1b67d6a4c 0x1bd68c55c 0x1bd68c9ac 0x1bb062210 0x1ba4abde4 0x1ba4a950c 0x1ba4adc94 0x1bb068d54 0x1ba4adbd8 0x1ba5ab2f0 0x1ba5a7b64 0x1bb068b24 0x1bb03c4cc 0x1bb03b2e4 0x1bb038974 0x1bb06a544 0x1bb06aae0 0x1bb03412c 0x1bb06b100 0x1bb033d48 0x1bb033760 0x1ba5a3f88 0x1ba5abf8c 0x1ba6c15b0 0x1ba5abf14 0x1bb068a00 0x1ba5abd64 0x1ba49c970 0x1ba58c640 0x1babccfcc 0x1babbc5f0 0x1babed980 0x1b6a3d524 0x1b6a381c4 0x1b6a38774 0x1b6a37f40 0x1c0cc8534 0x1babc3580 0x104ead76c 0x1b68b6e18)
libc++abi.dylib: terminating with uncaught exception of type NSException

What could that be?

Share fileBytes directly

When I share a file which is located on some cloud like s3, I have to download, create a file write the bytes to it and only then share it. That's acceptable, however I can't find a way to delete the file after the sharing has been complete.

Please, add a way to send file bytes directly
or
Please, make the future resolve after a file has been already shared so I can safely delete it without setting up background tasks to do it.

Does not work on iPad

Probably at least one of the constraints in the following list is one you don't want.
Try this:
(1) look at each constraint and try to figure out which you don't expect;
(2) find the code that added the unwanted constraint or constraints and fix it.
(
"<NSLayoutConstraint:0x600000fefed0 LPLinkView:0x7fa278633570.leading == UILayoutGuide:0x6000015bbb80'UIViewLayoutMarginsGuide'.leading (active)>",
"<NSLayoutConstraint:0x600000fee440 H:[LPLinkView:0x7fa278633570]-(59)-| (active, names: '|':_UIActivityContentTitleView:0x7fa278447c90 )>",
"<NSLayoutConstraint:0x600000f832f0 H:|-(0)-[_UIActivityContentTitleView:0x7fa278447c90] (active, names: '|':_UINavigationBarContentView:0x7fa2785611b0 )>",
"<NSLayoutConstraint:0x600000f81b30 _UIActivityContentTitleView:0x7fa278447c90.trailing == _UINavigationBarContentView:0x7fa2785611b0.trailing (active)>",
"<NSLayoutConstraint:0x600000feac60 'UIView-Encapsulated-Layout-Width' _UINavigationBarContentView:0x7fa2785611b0.width == 6 (active)>",
"<NSLayoutConstraint:0x600000fefde0 'UIView-leftMargin-guide-constraint' H:|-(16)-UILayoutGuide:0x6000015bbb80'UIViewLayoutMarginsGuide' (active, names: '|':_UIActivityContentTitleView:0x7fa278447c90 )>"
)

Will attempt to recover by breaking constraint
<NSLayoutConstraint:0x600000fefed0 LPLinkView:0x7fa278633570.leading == UILayoutGuide:0x6000015bbb80'UIViewLayoutMarginsGuide'.leading (active)>

Make a symbolic breakpoint at UIViewAlertForUnsatisfiableConstraints to catch this in the debugger.
The methods in the UIConstraintBasedLayoutDebugging category on UIView listed in <UIKitCore/UIView.h> may also be helpful.

Share Panel title not working on Android

Version 1.1.15 on Android.

I am using share like this:
ShareExtend.share(file.path, "file", sharePanelTitle: "Panel title", subject: "For email");

Subject works fine, however share panel title is not displaying, what it is displayed is the file's path with strange characters, as seen in the image:

WhatsApp Image 2020-04-30 at 3 05 46 PM

ShareExtendPlugin.java uses unchecked or unsafe operations. Note: Recompile with -Xlint:unchecked for details.

Every time I launch the flutter app, this warning appears to me. What is wrong with it?

development/tools/flutter/.pub-cache/hosted/pub.dartlang.org/share_extend-1.1.0/android/src/main/java/com/zt/shareextend/ShareExtendPlugin.java uses unchecked or unsafe operations. Note: Recompile with -Xlint:unchecked for details. #21

My flutter doctor -v results are as below.
✓] Flutter (Channel stable, v1.9.1+hotfix.6, on Mac OS X 10.15.1 19B88, locale en-MN)

[✓] Android toolchain - develop for Android devices (Android SDK version 29.0.2) • Android SDK at /Users/zemunkh/Library/Android/sdk • Android NDK location not configured (optional; useful for native profiling support) • Platform android-29, build-tools 29.0.2 • Java binary at: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java • Java version OpenJDK Runtime Environment (build 1.8.0_202-release-1483-b49-5587405) • All Android licenses accepted.

: java.lang.SecurityException: Permission Denial: reading

hi iam using
share_extend: ^1.1.5

iam seeting below errror in logs while trying to share photo.

Performing hot restart...
Syncing files to device Android SDK built for x86...
Restarted application in 3,257ms.
E/DatabaseUtils( 7632): Writing exception to parcel
E/DatabaseUtils( 7632): java.lang.SecurityException: Permission Denial: reading com.zt.shareextend.ShareExtendProvider uri content://kw.ltd.shadi_fitness_app.shareextend.fileprovider/%252Fdata%252Fuser%252F0%252Fkw.ltd.shadi_fitness_app%252Fcache%252FlibCachedImageData%252F0f0a29b0-9298-11ea-cbef-ddaf422651a7.jpg from pid=8584, uid=1000 requires the provider be exported, or grantUriPermission()
E/DatabaseUtils( 7632): at android.content.ContentProvider.enforceReadPermissionInner(ContentProvider.java:729)
E/DatabaseUtils( 7632): at android.content.ContentProvider$Transport.enforceReadPermission(ContentProvider.java:602)
E/DatabaseUtils( 7632): at android.content.ContentProvider$Transport.enforceFilePermission(ContentProvider.java:593)
E/DatabaseUtils( 7632): at android.content.ContentProvider$Transport.openTypedAssetFile(ContentProvider.java:507)
E/DatabaseUtils( 7632): at android.content.ContentProviderNative.onTransact(ContentProviderNative.java:307)
E/DatabaseUtils( 7632): at android.os.Binder.execTransactInternal(Binder.java:1021)
E/DatabaseUtils( 7632): at android.os.Binder.execTransact(Binder.java:994)

can we share video ?

using image_picker,we can pickVideo from photo gallery, how can we share the mp4 video file from the photo gallery?

Share files through path_provider

Is it possible to share a file, that I've exported to the application documents directory provided by the path_provider. I am asking this, because android throws me an error, if I try to do that. The error looks like this:

I/SimplePermission(20971): Checking permission : android.permission.WRITE_EXTERNAL_STORAGE
E/MethodChannel#share_extend(20971): Failed to handle method call
E/MethodChannel#share_extend(20971): java.lang.IllegalArgumentException: Failed to find configured root that contains /data/data/com.vendetta.recipe/app_flutter/file.json
E/MethodChannel#share_extend(20971): 	at android.support.v4.content.FileProvider$SimplePathStrategy.getUriForFile(FileProvider.java:738)
E/MethodChannel#share_extend(20971): 	at android.support.v4.content.FileProvider.getUriForFile(FileProvider.java:417)
E/MethodChannel#share_extend(20971): 	at com.zt.shareextend.ShareExtendPlugin.getUriForFile(ShareExtendPlugin.java:83)
E/MethodChannel#share_extend(20971): 	at com.zt.shareextend.ShareExtendPlugin.share(ShareExtendPlugin.java:62)
E/MethodChannel#share_extend(20971): 	at com.zt.shareextend.ShareExtendPlugin.onMethodCall(ShareExtendPlugin.java:42)
E/MethodChannel#share_extend(20971): 	at io.flutter.plugin.common.MethodChannel$IncomingMethodCallHandler.onMessage(MethodChannel.java:200)
E/MethodChannel#share_extend(20971): 	at io.flutter.view.FlutterNativeView.handlePlatformMessage(FlutterNativeView.java:172)

In iOS Not able to share Video With Text

ShareExtend.shareMultiple(
[playListLocalPath], "video",
subject:appRepliesData.vdeoTtl,
sharePanelTitle:appRepliesData.vdeoTtl,
extraText:appRepliesData.shareVideoContent
);

[Enhancement] Upgrade the plugin to remove deprecated things

Hi, I found this (when was creating plugin for instagram):

    // This static function is optional and equivalent to onAttachedToEngine. It supports the old
    // pre-Flutter-1.12 Android projects. You are encouraged to continue supporting
    // plugin registration via this function while apps migrate to use the new Android APIs
    // post-flutter-1.12 via https://flutter.dev/go/android-project-migration.
    //
    // It is encouraged to share logic between onAttachedToEngine and registerWith to keep
    // them functionally equivalent. Only one of onAttachedToEngine or registerWith will be called
    // depending on the user's project. onAttachedToEngine or registerWith must both be defined
    // in the same class.
    public static void registerWith(Registrar registrar) {
       ...
    }

So, we can implement onAttachedToEngine to support new Flutter. I will have a look.

Change default README

As most people using pub.dev expect to see english documentation it would be nice if the README-en.md was the default.

I found this problem, could you please do me a favor?

  • Error running Gradle:
    ProcessException: Process "/Users/virs/AndroidStudioProjects/clodra/android/gradlew" exited abnormally:

Configure project :shared_preferences
*********************************************************
WARNING: This version of connectivity will break your Android build if it or its dependencies aren't compatible with AndroidX.
See https://goo.gl/CP92wY for more information on the problem and how to fix it.
This warning prints for all Android build failures. The real root cause of the error may be unrelated.
*********************************************************

Project evaluation failed including an error in afterEvaluate {}. Run with --stacktrace for details of the afterEvaluate {} error.

FAILURE: Build failed with an exception.

  • What went wrong:
    A problem occurred configuring project ':shared_preferences'.

Could not resolve all artifacts for configuration ':shared_preferences:classpath'.
Could not resolve org.apache.httpcomponents:httpclient:4.5.6.
Required by:
project :shared_preferences > com.android.tools.build:gradle:3.4.0 > com.android.tools.analytics-library:crash:26.4.0
project :shared_preferences > com.android.tools.build:gradle:3.4.0 > com.android.tools.analytics-library:crash:26.4.0 > org.apache.httpcomponents:httpmime:4.5.6
> Could not resolve org.apache.httpcomponents:httpclient:4.5.6.
> Could not parse POM https://jcenter.bintray.com/org/apache/httpcomponents/httpclient/4.5.6/httpclient-4.5.6.pom
> Could not resolve org.apache.httpcomponents:httpcomponents-client:4.5.6.
> Could not resolve org.apache.httpcomponents:httpcomponents-client:4.5.6.
> Could not get resource 'https://dl.google.com/dl/android/maven2/org/apache/httpcomponents/httpcomponents-client/4.5.6/httpcomponents-client-4.5.6.pom'.
> Could not GET 'https://dl.google.com/dl/android/maven2/org/apache/httpcomponents/httpcomponents-client/4.5.6/httpcomponents-client-4.5.6.pom'.
> Read timed out

  • 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 34s
Command: /Users/virs/AndroidStudioProjects/clodra/android/gradlew app:properties

无法分享视频到微信以及可分享列表没有微信朋友圈

  1. 在调用起分享列表内,没有微信朋友圈
  2. 无法分享给微信朋友,但是可以分享到QQ

测试机器:oneplus 5

> flutter doctor


Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, v1.5.4-hotfix.2, on Mac OS X 10.14.4 18E226, locale zh-Hans-CN)
 
[✓] Android toolchain - develop for Android devices (Android SDK version 28.0.3)
[!] iOS toolchain - develop for iOS devices (Xcode 10.2.1)
    ✗ libimobiledevice and ideviceinstaller are not installed. To install with Brew, run:
        brew update
        brew install --HEAD usbmuxd
        brew link usbmuxd
        brew install --HEAD libimobiledevice
        brew install ideviceinstaller
    ✗ ios-deploy not installed. To install:
        brew install ios-deploy
[✓] Android Studio (version 3.3)
[!] IntelliJ IDEA Community Edition (version 2019.1.3)
    ✗ Flutter plugin not installed; this adds Flutter specific functionality.
    ✗ Dart plugin not installed; this adds Dart specific functionality.
[✓] VS Code (version 1.35.1)
[✓] Connected device (1 available)

! Doctor found issues in 2 categories.

Unhandled Exception: MissingPluginException(No implementation found for method share on channel share_extend)

Unhandled Exception: MissingPluginException(No implementation found for method share on channel share_extend)
#0 MethodChannel.invokeMethod
package:flutter/…/services/platform_channel.dart:314

#1 ShareExtend.share (package:share_extend/share_extend.dart:37:21)
#2 MallPDetailNavBarView.build.
package:Flutter/…/detail/MallPDetailNavView.dart:24
#3 _InkResponseState._handleTap
package:flutter/…/material/ink_well.dart:635
#4 _InkResponseState.build.
package:flutter/…/material/ink_well.dart:711
#5 GestureRecognizer.invokeCallback
package:flutter/…/gestures/recognizer.dart:182
#6 TapGestureRecognizer._checkUp
package:flutter/…/gestures/tap.dart:365
#7 TapGestureRecognizer.handlePrimaryPointer
package:flutter/…/gestures/tap.dart:275
#8 PrimaryPointerGestureRecognizer.handleEvent
package:flutter/…/gestures/recognizer.dart:455
#9 PointerRouter._dispatch
package:flutter/…/gestures/pointer_router.dart:75
#10 PointerRouter.route
package:flutter/…/gestures/pointer_router.dart:102
#11 _WidgetsFlutterBinding&BindingBase&GestureBinding.handleEvent
package:flutter/…/gestures/binding.dart:218
#12 _WidgetsFlutterBinding&BindingBase&GestureBinding.dispatchEvent
package:flutter/…/gestures/binding.dart:198
#13 _WidgetsFlutterBinding&BindingBase&GestureBinding._handlePointerEvent
package:flutter/…/gestures/binding.dart:156
#14 _WidgetsFlutterBinding&BindingBase&GestureBinding._flushPointerEventQueue
package:flutter/…/gestures/binding.dart:102
#15 _WidgetsFlutterBinding&BindingBase&GestureBinding._handlePointerDataPacket
package:flutter/…/gestures/binding.dart:86
#16 _rootRunUnary (dart:async/zone.dart:1136:13)
#17 _CustomZone.runUnary (dart:async/zone.dart:1029:19)

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.