A Flutter plugin for sharing files & text with other applications.

Overview

esys_flutter_share

A Flutter plugin for sharing files & text with other applications.

IMPORTANT Note for iOS

If you are starting a new fresh app, you need to create the Flutter App with flutter create -i swift (see flutter/flutter#13422 (comment)), otherwise, you will get this message:

=== BUILD TARGET flutter_inappbrowser OF PROJECT Pods WITH CONFIGURATION Debug ===
The "Swift Language Version" (SWIFT_VERSION) build setting must be set to a supported value for targets which use Swift. Supported values are: 3.0, 4.0, 4.2. This setting can be set in the build settings editor.

If you still have this problem, try to edit iOS Podfile like this (see #15):

target 'Runner' do
  use_frameworks!  # required by simple_permission
  ...
end

post_install do |installer|
  installer.pods_project.targets.each do |target|
    target.build_configurations.each do |config|
      config.build_settings['SWIFT_VERSION'] = '4.0'  # required by simple_permission
      config.build_settings['ENABLE_BITCODE'] = 'NO'
    end
  end
end

Instead, if you have already a non-swift project, you can check this issue to solve the problem: Friction adding swift plugin to objective-c project.

Usage

Import:

import 'package:esys_flutter_share/esys_flutter_share.dart';

Share text:

Share.text('my text title', 'This is my text to share with other applications.', 'text/plain');

Share file:

final ByteData bytes = await rootBundle.load('assets/image1.png');
await Share.file('esys image', 'esys.png', bytes.buffer.asUint8List(), 'image/png', text: 'My optional text.');

Share files:

final ByteData bytes1 = await rootBundle.load('assets/image1.png');
final ByteData bytes2 = await rootBundle.load('assets/image2.png');
final ByteData bytes3 = await rootBundle.load('assets/addresses.csv');

await Share.files(
    'esys images',
    {
        'esys.png': bytes1.buffer.asUint8List(),
        'bluedan.png': bytes2.buffer.asUint8List(),
        'addresses.csv': bytes3.buffer.asUint8List(),
    },
    '*/*',
    text: 'My optional text.');

Share file from url:

var request = await HttpClient().getUrl(Uri.parse('https://shop.esys.eu/media/image/6f/8f/af/amlog_transport-berwachung.jpg'));
var response = await request.close();
Uint8List bytes = await consolidateHttpClientResponseBytes(response);
await Share.file('ESYS AMLOG', 'amlog.jpg', bytes, 'image/jpg');

Check out the example app in the Repository for further information.

Comments
  • `esys_flutter_share` does not specify a Swift version

    `esys_flutter_share` does not specify a Swift version

    I am using esys_flutter_share 1.0.1 and when I was building for iOS, the error was thrown. Console shows

    Running pod install...
    CocoaPods' output:
    ↳
         Preparing
    
       Analyzing dependencies
    
       Inspecting targets to integrate
         Using `ARCHS` setting to build architectures of target `Pods-Runner`: (``)
    
       Finding Podfile changes
         A esys_flutter_share
         R share
         - Firebase
         - Flutter
         - cloud_firestore
         - connectivity
         - firebase_admob
         - firebase_core
         - google_sign_in
         - package_info
         - path_provider
         - qrcode_reader
         - shared_preferences
         - sqflite
         - url_launcher
    
       Fetching external sources
       -> Fetching podspec for `Flutter` from `.symlinks/flutter/ios`
       -> Fetching podspec for `cloud_firestore` from `.symlinks/plugins/cloud_firestore/ios`
       -> Fetching podspec for `connectivity` from `.symlinks/plugins/connectivity/ios`
       -> Fetching podspec for `esys_flutter_share` from `.symlinks/plugins/esys_flutter_share/ios`
       -> Fetching podspec for `firebase_admob` from `.symlinks/plugins/firebase_admob/ios`
       -> Fetching podspec for `firebase_core` from `.symlinks/plugins/firebase_core/ios`
       -> Fetching podspec for `google_sign_in` from `.symlinks/plugins/google_sign_in/ios`
       -> Fetching podspec for `package_info` from `.symlinks/plugins/package_info/ios`
       -> Fetching podspec for `path_provider` from `.symlinks/plugins/path_provider/ios`
       -> Fetching podspec for `qrcode_reader` from `.symlinks/plugins/qrcode_reader/ios`
       -> Fetching podspec for `shared_preferences` from `.symlinks/plugins/shared_preferences/ios`
       -> Fetching podspec for `sqflite` from `.symlinks/plugins/sqflite/ios`
       -> Fetching podspec for `url_launcher` from `.symlinks/plugins/url_launcher/ios`
    
       Resolving dependencies of `Podfile`
    
       Comparing resolved specification to the sandbox manifest
         A BoringSSL-GRPC
         A FMDB
         A Firebase
         A FirebaseAnalytics
         A FirebaseAuth
         A FirebaseAuthInterop
         A FirebaseCore
         A FirebaseDatabase
         A FirebaseFirestore
         A FirebaseInstanceID
         A Flutter
         A GTMSessionFetcher
         A Google-Mobile-Ads-SDK
         A GoogleAppMeasurement
         A GoogleSignIn
         A GoogleToolboxForMac
         A GoogleUtilities
         A Protobuf
         A Reachability
         A cloud_firestore
         A connectivity
         A esys_flutter_share
         A firebase_admob
         A firebase_core
         A gRPC-C++
         A gRPC-Core
         A google_sign_in
         A leveldb-library
         A nanopb
         A package_info
         A path_provider
         A qrcode_reader
         A shared_preferences
         A sqflite
         A url_launcher
    
       Downloading dependencies
    
       -> Installing BoringSSL-GRPC (0.0.2)
         > Copying BoringSSL-GRPC from `/Users/george/Library/Caches/CocoaPods/Pods/Release/BoringSSL-GRPC/0.0.2-2a230` to `Pods/BoringSSL-GRPC`
    
       -> Installing FMDB (2.7.5)
         > Copying FMDB from `/Users/george/Library/Caches/CocoaPods/Pods/Release/FMDB/2.7.5-2ce00` to `Pods/FMDB`
    
       -> Installing Firebase (5.17.0)
         > Copying Firebase from `/Users/george/Library/Caches/CocoaPods/Pods/Release/Firebase/5.17.0-59d55` to `Pods/Firebase`
    
       -> Installing FirebaseAnalytics (5.6.0)
         > Copying FirebaseAnalytics from `/Users/george/Library/Caches/CocoaPods/Pods/Release/FirebaseAnalytics/5.6.0-75e4b` to `Pods/FirebaseAnalytics`
    
       -> Installing FirebaseAuth (5.3.1)
         > Copying FirebaseAuth from `/Users/george/Library/Caches/CocoaPods/Pods/Release/FirebaseAuth/5.3.1-0f61e` to `Pods/FirebaseAuth`
    
       -> Installing FirebaseAuthInterop (1.0.0)
         > Copying FirebaseAuthInterop from `/Users/george/Library/Caches/CocoaPods/Pods/Release/FirebaseAuthInterop/1.0.0-0ffa5` to `Pods/FirebaseAuthInterop`
    
       -> Installing FirebaseCore (5.3.0)
         > Copying FirebaseCore from `/Users/george/Library/Caches/CocoaPods/Pods/Release/FirebaseCore/5.3.0-c0c4b` to `Pods/FirebaseCore`
    
       -> Installing FirebaseDatabase (5.1.0)
         > Copying FirebaseDatabase from `/Users/george/Library/Caches/CocoaPods/Pods/Release/FirebaseDatabase/5.1.0-23acb` to `Pods/FirebaseDatabase`
    
       -> Installing FirebaseFirestore (1.0.1)
         > Copying FirebaseFirestore from `/Users/george/Library/Caches/CocoaPods/Pods/Release/FirebaseFirestore/1.0.1-e95af` to `Pods/FirebaseFirestore`
    
       -> Installing FirebaseInstanceID (3.5.0)
         > Copying FirebaseInstanceID from `/Users/george/Library/Caches/CocoaPods/Pods/Release/FirebaseInstanceID/3.5.0-4522a` to `Pods/FirebaseInstanceID`
    
       -> Installing Flutter (1.0.0)
    
       -> Installing GTMSessionFetcher (1.2.1)
         > Copying GTMSessionFetcher from `/Users/george/Library/Caches/CocoaPods/Pods/Release/GTMSessionFetcher/1.2.1-32aec` to `Pods/GTMSessionFetcher`
    
       -> Installing Google-Mobile-Ads-SDK (7.40.0)
         > Copying Google-Mobile-Ads-SDK from `/Users/george/Library/Caches/CocoaPods/Pods/Release/Google-Mobile-Ads-SDK/7.40.0-9d1c3` to `Pods/Google-Mobile-Ads-SDK`
    
       -> Installing GoogleAppMeasurement (5.6.0)
         > Copying GoogleAppMeasurement from `/Users/george/Library/Caches/CocoaPods/Pods/Release/GoogleAppMeasurement/5.6.0-008e0` to `Pods/GoogleAppMeasurement`
    
       -> Installing GoogleSignIn (4.4.0)
         > Copying GoogleSignIn from `/Users/george/Library/Caches/CocoaPods/Pods/Release/GoogleSignIn/4.4.0-7ff24` to `Pods/GoogleSignIn`
    
       -> Installing GoogleToolboxForMac (2.2.0)
         > Copying GoogleToolboxForMac from `/Users/george/Library/Caches/CocoaPods/Pods/Release/GoogleToolboxForMac/2.2.0-ff316` to `Pods/GoogleToolboxForMac`
    
       -> Installing GoogleUtilities (5.3.7)
         > Copying GoogleUtilities from `/Users/george/Library/Caches/CocoaPods/Pods/Release/GoogleUtilities/5.3.7-111a0` to `Pods/GoogleUtilities`
    
       -> Installing Protobuf (3.6.1)
         > Copying Protobuf from `/Users/george/Library/Caches/CocoaPods/Pods/Release/Protobuf/3.6.1-1eb97` to `Pods/Protobuf`
    
       -> Installing Reachability (3.2)
         > Copying Reachability from `/Users/george/Library/Caches/CocoaPods/Pods/Release/Reachability/3.2-33e18` to `Pods/Reachability`
    
       -> Installing cloud_firestore (0.0.1)
    
       -> Installing connectivity (0.0.1)
    
       -> Installing esys_flutter_share (0.0.1)
    
       -> Installing firebase_admob (0.0.1)
    
       -> Installing firebase_core (0.0.1)
    
       -> Installing gRPC-C++ (0.0.6)
         > Copying gRPC-C++ from `/Users/george/Library/Caches/CocoaPods/Pods/Release/gRPC-C++/0.0.6-e7644` to `Pods/gRPC-C++`
    
       -> Installing gRPC-Core (1.17.0)
         > Copying gRPC-Core from `/Users/george/Library/Caches/CocoaPods/Pods/Release/gRPC-Core/1.17.0-40280` to `Pods/gRPC-Core`
    
       -> Installing google_sign_in (0.0.1)
    
       -> Installing leveldb-library (1.20)
         > Copying leveldb-library from `/Users/george/Library/Caches/CocoaPods/Pods/Release/leveldb-library/1.20-08cba` to `Pods/leveldb-library`
    
       -> Installing nanopb (0.3.901)
         > Copying nanopb from `/Users/george/Library/Caches/CocoaPods/Pods/Release/nanopb/0.3.901-2901f` to `Pods/nanopb`
    
       -> Installing package_info (0.0.1)
    
       -> Installing path_provider (0.0.1)
    
       -> Installing qrcode_reader (0.0.1)
    
       -> Installing shared_preferences (0.0.1)
    
       -> Installing sqflite (0.0.1)
    
       -> Installing url_launcher (0.0.1)
         - Running pre install hooks
       [!] Unable to determine Swift version for the following pods:
    
       - `esys_flutter_share` does not specify a Swift version and none of the targets (`Runner`) integrating it have the `SWIFT_VERSION` attribute set. Please contact the author or set the `SWIFT_VERSION` attribute in at least one of the targets that integrate this pod.
    
       /usr/local/Cellar/cocoapods/1.6.1/libexec/gems/cocoapods-1.6.1/lib/cocoapods/installer/xcode/target_validator.rb:115:in `verify_swift_pods_swift_version'
       /usr/local/Cellar/cocoapods/1.6.1/libexec/gems/cocoapods-1.6.1/lib/cocoapods/installer/xcode/target_validator.rb:37:in `validate!'
       /usr/local/Cellar/cocoapods/1.6.1/libexec/gems/cocoapods-1.6.1/lib/cocoapods/installer.rb:459:in `validate_targets'
       /usr/local/Cellar/cocoapods/1.6.1/libexec/gems/cocoapods-1.6.1/lib/cocoapods/installer.rb:138:in `install!'
       /usr/local/Cellar/cocoapods/1.6.1/libexec/gems/cocoapods-1.6.1/lib/cocoapods/command/install.rb:48:in `run'
       /usr/local/Cellar/cocoapods/1.6.1/libexec/gems/claide-1.0.2/lib/claide/command.rb:334:in `run'
       /usr/local/Cellar/cocoapods/1.6.1/libexec/gems/cocoapods-1.6.1/lib/cocoapods/command.rb:52:in `run'
       /usr/local/Cellar/cocoapods/1.6.1/libexec/gems/cocoapods-1.6.1/bin/pod:55:in `<top (required)>'
       /usr/local/Cellar/cocoapods/1.6.1/libexec/bin/pod:22:in `load'
       /usr/local/Cellar/cocoapods/1.6.1/libexec/bin/pod:22:in `<main>'
    
    Error output from CocoaPods:
    ↳
    
       [!] Automatically assigning platform `ios` with version `8.0` on target `Runner` because no platform was specified. Please specify a platform for this target in your Podfile. See `https://guides.cocoapods.org/syntax/podfile.html#platform`.
    
    Error running pod install
    Error launching application on iPhone Xʀ.```
    opened by Livinglist 12
  • Latest Instagram Version Sharing Image to Instagram Feed Doesn't Work

    Latest Instagram Version Sharing Image to Instagram Feed Doesn't Work

    Describe the bug In the latest version of instagram (133.0.0.32.120 ) it only creates problems when feeding pictures Instagram story and video feature works well but just sharing image to instagram feed doesn't work. However every feature works well in the previous version of Instagram (132.0.0.26.134 )

    Expected behavior Image file is expected to shared to feed via instagram latest version

    Screenshots Screenshot_1584892297

    Screenshot_1584892335

    Smartphone (please complete the following information):

    • Device: Android Api 28
    • Instagram Version [133.0.0.32.120]

    Additional context Please help how to solve instagram to feed image in the instagram latest version(133.0.0.32.120).

    bug 
    opened by erdoganabaci 6
  • Please specify SWIFT_VERSION

    Please specify SWIFT_VERSION

    I'm trying to use this plugin in a project where I share an image to email, but I can't do it just yet. When I enable the plugin, the project won't build for iOS. I get this output:

    - `esys_flutter_share` does not specify a Swift version and none of the targets (`Runner`) integrating it have the `SWIFT_VERSION` attribute set. Please contact the author or set the `SWIFT_VERSION` attribute in at least one of the targets that integrate this pod.
    
    opened by sbeitzel 6
  • Cannot build with Xcode 10

    Cannot build with Xcode 10

    fatal error: 'esys_flutter_share/esys_flutter_share-Swift.h' file not found #import <esys_flutter_share/esys_flutter_share-Swift.h> ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    opened by mayqiyue 6
  • Xcode build failed

    Xcode build failed

    Thank you for creating very useful plugin.

    Android build works without problem. But I had got the error below in iOS build. Is there anyone who has any idea to solve this?

    Launching lib/main.dart on iPhone XR in debug mode...
    Running pod install...
    Starting Xcode build...
    Xcode build done.                                           13.6s
    Failed to build iOS app
    Error output from Xcode build:
    ↳
        ** BUILD FAILED **
    
    
    Xcode's output:
    ↳
        === BUILD TARGET url_launcher OF PROJECT Pods WITH CONFIGURATION Debug ===
        /Users/devneko/opt/flutter/.pub-cache/hosted/pub.dartlang.org/app_review-0.0.9/ios/Classes/AppReviewPlugin.m:2:9: fatal error: 'app_review/app_review-Swift.h' file not found
        #import <app_review/app_review-Swift.h>
                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        1 error generated.
        /Users/devneko/opt/flutter/.pub-cache/hosted/pub.dartlang.org/esys_flutter_share-0.0.5/ios/Classes/EsysFlutterSharePlugin.m:2:9: fatal error: 'esys_flutter_share/esys_flutter_share-Swift.h' file not found
        #import <esys_flutter_share/esys_flutter_share-Swift.h>
                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        1 error generated.
    
    Could not build the application for the simulator.
    Error launching application on iPhone XR.
    
    opened by dotneet 5
  • Build Error D8: Program type already present: android.support.v4.app.FrameMetricsAggregator

    Build Error D8: Program type already present: android.support.v4.app.FrameMetricsAggregator

    When I try to insert this plugin, I am getting this error:

    Note: /Users/mac/flutter/.pub-cache/hosted/pub.dartlang.org/esys_flutter_share-0.0.6/android/src/main/java/de/esys/esysfluttershare/EsysFlutterSharePlugin.java uses unchecked or unsafe operations. Note: Recompile with -Xlint:unchecked for details. D8: Program type already present: android.support.v4.app.FrameMetricsAggregator

    FAILURE: Build failed with an exception.

    opened by jmall 4
  • iOS share to

    iOS share to "Save File" crashes app

    Describe the bug When I try the “save file” option on the iOS sharing intent. I can share to anything else (twitter, iMessage, dropbox, etc), and it works as expected, but if I choose “Save file”, it crashes my flutter app, even with the try/catch.

    To Reproduce

    Future<Uint8List> getCurrentImage() async {
        RenderRepaintBoundary rpb =
            boardGlobalKey.currentContext.findRenderObject();
        ui.Image img = await rpb.toImage();
        ByteData byteData = await img.toByteData(format: ui.ImageByteFormat.png);
        return byteData.buffer.asUint8List();
      }
    
      Future<void> shareImage() async {
        try {
          await Share.file(
            'Pedalboard Image',
            'pedalboard.png',
            await getCurrentImage(),
            'image/png',
          );
        } catch (e) {
          debugPrint(e.toString());
        }
      }
    

    on iOS, then choose "Save File"

    Expected behavior file is saved to device

    Smartphone (please complete the following information):

    • Device: iPhone 6s, Xr, Simulator (XR), iPad 2
    • OS: various
    bug 
    opened by johnnygizmo 3
  • Black image when sharing on whatsapp

    Black image when sharing on whatsapp

    I have a scaffol and some fields and a logo wrapped in a Screenshot widget. When i generate the file with screenshot and share it on whatsapp the image is black.

    WhatsApp Image 2019-09-16 at 12 46 44

    The code is above

    return Scaffold(
          backgroundColor: Colors.white,
          floatingActionButton: FloatingActionButton(onPressed: () async {
            await takeScreenShot();
          }, child: Icon(Icons.share),),
          body: Screenshot(
            controller: screenshotController,
            child: Padding(
              padding: const EdgeInsets.all(20.0),
              child: Column(
                crossAxisAlignment: CrossAxisAlignment.start,
                children: <Widget>[
                  Text(
                    'Rodrigo Bastos Vasconcelos'.toUpperCase(),
                    style: TextStyle(fontSize: 24.0),
                  ),
                  Text(
                    'Cientista da Computação',
                    style: TextStyle(fontSize: 18.0),
                  ),
                  Divider(
                    thickness: 2.0,
                  ),
                  Row(
                    children: <Widget>[
                      Expanded(
                        child: Column(
                          children: <Widget>[
                            Padding(
                              padding: const EdgeInsets.symmetric(vertical: 12.0),
                              child: Row(
                                children: <Widget>[
                                  CircleAvatar(child: Icon(Icons.phone_android)),
                                  SizedBox(width: 12.0,),
                                  Text('(85) 996762196')
                                ],
                              ),
                            ),
                            Padding(
                              padding: const EdgeInsets.symmetric(vertical: 12.0),
                              child: Row(
                                children: <Widget>[
                                  CircleAvatar(child: Icon(Icons.whatshot)),
                                  SizedBox(width: 12.0,),
                                  Text('(85) 996762196')
                                ],
                              ),
                            ),
                            Padding(
                              padding: const EdgeInsets.symmetric(vertical: 12.0),
                              child: Row(
                                children: <Widget>[
                                  CircleAvatar(child: Icon(Icons.email)),
                                  SizedBox(width: 12.0,),
                                  Text('[email protected]')
                                ],
                              ),
                            ),
                          ],
                        ),
                      ),
                      Expanded(
                        child: Image.asset('logo.png', width: 100.0, height: 100.0, fit: BoxFit.contain,),
                      )
                    ],
                  )
                ],
              ),
            ),
          ),
        );
      }
    
      takeScreenShot() async {
        File imageFile = await screenshotController.capture();
        Uint8List bytes = await imageFile.readAsBytes();
        await Share.file('esys image', 'esys.png', bytes.buffer.asUint8List(), 'image/png', text: 'My optional text.');
      }```
    bug 
    opened by rodrigobastosv 3
  • Flutter error when packing apk, how to solve it?

    Flutter error when packing apk, how to solve it?

    LJM:flu_app_fe vinbeeluo$ flutter build apk
    Initializing gradle...                                              4.6s
    Resolving dependencies...                                          10.6s
    注: /Library/flutter/.pub-cache/hosted/pub.flutter-io.cn/esys_flutter_share-1.0.1/android/src/main/java/de/esys/esysfluttershare/EsysFlutterSharePlugin.ava使用了未经检查或不安全的操作。
    注: 有关详细信息, 请使用 -Xlint:unchecked 重新编译。                    
    Calling mockable JAR artifact transform to create file: /Users/vinbeeluo/.gradle/caches/transforms-1/files-1.1/android.jar/e2dc5fd512a35e23c34d1e209fd43d11/android.jar with input /Users/vinbeeluo/Library/Android/sdk/platforms/android-28/android.jar
    Calling mockable JAR artifact transform to create file: /Users/vinbeeluo/.gradle/caches/transforms-1/files-1.1/android.jar/90bc6d07db5b53f4236cf7be92d2f0d0/android.jar with input /Users/vinbeeluo/Library/Android/sdk/platforms/android-27/android.jar
    
    FAILURE: Build failed with an exception.                                
    
    * What went wrong:                                                      
    Execution failed for task ':fluttertoast:verifyReleaseResources'.       
    > java.util.concurrent.ExecutionException: com.android.builder.internal.aapt.v2.Aapt2Exception: Android resource linking failed
      /Users/vinbeeluo/Desktop/Git/flu_app_fe/build/fluttertoast/intermediates/res/merged/release/values-v28/values-v28.xml:7: error: resource android:attr/dialogCornerRadius not found.
      /Users/vinbeeluo/Desktop/Git/flu_app_fe/build/fluttertoast/intermediates/res/merged/release/values-v28/values-v28.xml:11: error: resource android:attr/dialogCornerRadius not found.
      /Users/vinbeeluo/Desktop/Git/flu_app_fe/build/fluttertoast/intermediates/res/merged/release/values/values.xml:2601: error: resource android:attr/fontVariationSettings not found.
      /Users/vinbeeluo/Desktop/Git/flu_app_fe/build/fluttertoast/intermediates/res/merged/release/values/values.xml:2602: error: resource android:attr/ttcIndex not found.
      error: failed linking references.                                     
    
    
    * 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 1m 18s                                                  
    Running Gradle task 'assembleRelease'...                                
    Running Gradle task 'assembleRelease'... Done                      79.3s
    Gradle task assembleRelease failed with exit code 1
    LJM:flu_app_fe vinbeeluo$ 
    
    opened by JunAILiang 3
  • Fixing crash on iPad

    Fixing crash on iPad

    There is a bug in your code - it crashes on iPad (any recent version of iOS). See the details here:

    https://stackoverflow.com/a/25644145/995049

    This PR fixes the issue.

    opened by alexeyismirnov 3
  • Add support for other filetypes

    Add support for other filetypes

    I'm using shareImage method to share a pdf and it's working smoothly on android. but this is the error i get when i try it on ios warning: could not execute support code to read Objective-C class data in the process. This may reduce the quality of type information available. and it makes my app crash

    enhancement 
    opened by giovapanasiti 3
  •  java.lang.SecurityException: Permission Denial: reading de.esys.esysfluttershare.EsysFlutterShareFileProvider uri content

    java.lang.SecurityException: Permission Denial: reading de.esys.esysfluttershare.EsysFlutterShareFileProvider uri content

    I'm getting this error in the Android log

    java.lang.SecurityException: Permission Denial: reading de.esys.esysfluttershare.EsysFlutterShareFileProvider uri content

    I/flutter (14772): Share file
    I/flutter (14772): Share file: isDownload true
    I/flutter (14772): Share file: name: Edição 1406 - PPA 2022-2025
    I/flutter (14772): Share file: mimiType application/pdf
    I/flutter (14772): Share file: url https://appro.riodasostras.rj.gov.br/storage/riodasostrasapp/jornais/2a7da925-aeb0-43c5-8304-79a82f480de4.pdf
    E/DatabaseUtils(14772): Writing exception to parcel
    E/DatabaseUtils(14772): java.lang.SecurityException: Permission Denial: reading de.esys.esysfluttershare.EsysFlutterShareFileProvider uri content://br.gov.rj.riodasostras.riodasostrasapp.fileprovider.github.com%2Forgs%2Fesysberlin%2Fesys-flutter-share/files/Edi%C3%A7%C3%A3o%201406%20-%20PPA%202022-2025 from pid=24722, uid=1000 requires the provider be exported, or grantUriPermission()
    E/DatabaseUtils(14772):         at android.content.ContentProvider.enforceReadPermissionInner(ContentProvider.java:912)
    E/DatabaseUtils(14772):         at android.content.ContentProvider.semEnforceReadPermission(ContentProvider.java:830)
    E/DatabaseUtils(14772):         at android.content.ContentProvider$Transport.enforceReadPermission(ContentProvider.java:708)
    E/DatabaseUtils(14772):         at android.content.ContentProvider$Transport.query(ContentProvider.java:247)
    E/DatabaseUtils(14772):         at android.content.ContentProviderNative.onTransact(ContentProviderNative.java:107)
    E/DatabaseUtils(14772):         at android.os.Binder.execTransactInternal(Binder.java:1215)
    E/DatabaseUtils(14772):         at android.os.Binder.execTransact(Binder.java:1179)
    E/DatabaseUtils(14772): Writing exception to parcel
    E/DatabaseUtils(14772): java.lang.SecurityException: Permission Denial: reading de.esys.esysfluttershare.EsysFlutterShareFileProvider uri content://br.gov.rj.riodasostras.riodasostrasapp.fileprovider.github.com%2Forgs%2Fesysberlin%2Fesys-flutter-share/files/Edi%C3%A7%C3%A3o%201406%20-%20PPA%202022-2025 from pid=24722, uid=1000 requires the provider be exported, or grantUriPermission()
    E/DatabaseUtils(14772):         at android.content.ContentProvider.enforceReadPermissionInner(ContentProvider.java:912)
    E/DatabaseUtils(14772):         at android.content.ContentProvider.semEnforceReadPermission(ContentProvider.java:830)
    E/DatabaseUtils(14772):         at android.content.ContentProvider$Transport.enforceReadPermission(ContentProvider.java:708)
    E/DatabaseUtils(14772):         at android.content.ContentProvider$Transport.query(ContentProvider.java:247)
    E/DatabaseUtils(14772):         at android.content.ContentProviderNative.onTransact(ContentProviderNative.java:107)
    E/DatabaseUtils(14772):         at android.os.Binder.execTransactInternal(Binder.java:1215)
    E/DatabaseUtils(14772):         at android.os.Binder.execTransact(Binder.java:1179)
    I/ViewRootImpl@98541cf[MainActivity](14772): MSG_WINDOW_FOCUS_CHANGED 0 1
    ```
    
    
    ```dart
    Future<void> onShare(Jornal a) async {
        print('Share file');
    
        if (a.isDownload == false) {
          if (Platform.isAndroid || Platform.isIOS) {
            setState(() {
              a.isDownload = true;
              print('Share file: isDownload ${a.isDownload}');
            });
    
            var resp = await http.get(Uri.parse(a.link!));
            Uint8List bytes = await resp.bodyBytes;
            var mimiType = resp.headers['content-type']!;
            var name = '${a.edicao}.pdf';
            print('Share file: name: $name');
            print('Share file: mimiType $mimiType');
            print('Share file: url ${a.link!}');
            setState(() {
              a.isDownload = false;
            });
            await esys_share.Share.file(name, name, bytes, mimiType);
          }
        }
      }
    ```
    bug 
    opened by insinfo 1
  • Please upgrade the version for path_provider to the latest version

    Please upgrade the version for path_provider to the latest version

    Is your feature request related to a problem? Please describe. A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

    Describe the solution you'd like A clear and concise description of what you want to happen.

    Describe alternatives you've considered A clear and concise description of any alternative solutions or features you've considered.

    Additional context Add any other context or screenshots about the feature request here.

    enhancement 
    opened by coolabhi30 3
  • Using deprecated api

    Using deprecated api

    Package is using deprecated api, it will be great if newer version can be released with newer api support just to make sure that in future it doesnt create problems

    Note: D:\softwares\flutter\flutter.pub-cache\hosted\pub.dartlang.org\esys_flutter_share-1.0.2\android\src\main\java\de\esys\esysfluttershare\EsysFlutterSharePlugin.java uses or overrides a deprecated API. Note: Recompile with -Xlint:deprecation for details.

    bug 
    opened by TechRaY 2
  • Null-safety support

    Null-safety support

    Add null-safety support to the package with minimum changes.

    See issues #86 and #88

    Also update .gitignore files in example to the vastest version from Flutter templates.

    Please publish null-safety version on pub.dev so people can to upgrade their projects on Flutter 2. Thank you!

    opened by greymag 0
Releases(v1.0.2)
Owner
ESYS GmbH
ESYS GmbH
Download files from Firebase Storage with Flutter. List all images, videos, or other files from Firebase and download them.

Flutter Tutorial - Download Files From Firebase Storage Download files from Firebase Storage with Flutter. List all images, videos, or other files fro

Johannes Milke 28 Dec 4, 2022
Upload Files To Firebase Storage with Flutter. Pick images, videos, or other files from your device and upload them to Firebase.

Flutter Tutorial - Upload Files To Firebase Storage Upload Files To Firebase Storage with Flutter. Pick images, videos, or other files from your devic

Johannes Milke 30 Dec 28, 2022
Flutter plugin (android) for sharing bytes and files Offline, (Based on the android Nearby Connections API)

nearby_connections An android flutter plugin for the Nearby Connections API Currently supports Bytes and Files. Transfer Data between multiple connect

Prerak Mann 63 Nov 21, 2022
Masked text field - A flutter package for masked text field for formet your text and good UI

Masked Text Field Masked Text Field Features A package for masked text field for

Alok Dubey 7 Sep 4, 2022
Text analyzer that extracts tokens from text for use in full-text search queries and indexes.

Tokenize text, compute document readbility and compare terms in Natural Language Processing. THIS PACKAGE IS PRE-RELEASE, and SUBJECT TO DAILY BREAKIN

GM Consult Pty Ltd 5 Dec 12, 2022
A Flutter plugin to rotate, resize, move, delete text, photo or any other widget.

sticker_view A Flutter plugin to rotate, resize, move, delete any text, image or any other widget. Available Features ✅ Rotate ✅ Resize ✅ Move ✅ Layer

Gopal Dhola 14 Nov 26, 2022
Wraps Flutter shared_preferences plugin, providing a iOS Suite Name support, it's helpful for sharing data from App to Widget.

shared_preferences_ios_sn Wraps Flutter shared_preferences plugin and provides an iOS Suite Name support, it's helpful for sharing data from App to iO

null 3 Sep 14, 2022
Soft and gentle rich text editing for Flutter applications.

About Fleather Soft and gentle rich text editing for Flutter applications based on Zefyr. Clean and modern look Fleather's rich text editor is built w

Fleather 25 Dec 24, 2022
An Instagram like text editor Flutter widget that helps you to change your text style.

TextEditor An instagram like text editor widget for flutter Show some ❤️ and star the repo to support the project Features Edit TextStyle object font

Mehdi Zarepour 68 Dec 16, 2022
Grad text package - A Flutter Widget to draw gradients into text

grad_text A Flutter Widget to draw gradients into text.(Null safe) Demo Install

Karthik Sunil K 3 Jan 31, 2022
Detectable text field - Flutter Text widgets with detection features

detectable_text_field Text widgets with detection features. You can detect hasht

null 0 Feb 2, 2022
A text field that displays text on different languages based on your selection.

translatable_text_field A text field that displays text on different languages based on your selection. Its basic idea is that you place this fields i

null 0 Mar 13, 2022
A flutter plugin to show Truecaller like overlay window, over all other apps along with callback events

A flutter plugin to show Truecaller like overlay window, over all other apps along with callback events. Android Go or Android 11 & above, this plugin shows notification bubble, in other android versions, it shows an overlay window.

Venkata Sai Vamsi Penupothu 85 Dec 29, 2022
A flutter plugin for viewing PDF files in mobile app (Android & iOS)

PDF Viewer (JK) A flutter plugin for viewing PDF files in mobile app (Android & iOS) Pub.dev https://pub.dev/packages/pdf_viewer_jk Github ht

Jawad 8 Sep 30, 2021
A flutter plugin for handling PDF files

advance_pdf_viewer A flutter plugin for handling PDF files. Works on both Android & iOS. Originally forked from (https://github.com/CrossPT/flutter_pl

Abeer Iqbal 0 Dec 3, 2021
This plugin create a binding between your translations from .arb files and your Flutter app.

PROJECT MAINTENANCE PAUSED This project is no longer maintained due to the lack of time and availability. I'm a developer to and I know how frustratin

Razvan Lung 255 Dec 3, 2022
A Flutter plugin to read 🔖 metadata of 🎵 media files. Supports Windows, Linux & Android.

flutter_media_metadata A Flutter plugin to read metadata of media files. A part of Harmonoid open source project ?? Install Add in your pubspec.yaml.

Harmonoid 60 Dec 2, 2022