Giter Site home page Giter Site logo

Comments (6)

asleepace avatar asleepace commented on July 28, 2024 2

@alinz hey I forked the repo and have it working for iOS, I'll submit a PR once we get it working for Android too.

from react-native-share-extension.

alinz avatar alinz commented on July 28, 2024

@asleepace, Don't use the data method to grab the data for video, instead get the path of the video. And also share extension meant to be use to do one thing and one simple tasks. If you need to do more complex operation, you should prompt the user to go back to your main app and load the content there for further processing.

from react-native-share-extension.

asleepace avatar asleepace commented on July 28, 2024

@alinz awesome, thanks I will try that out! Also is there any way to determine the type before hand so I can either use the video url or get the data?

from react-native-share-extension.

vbashiri avatar vbashiri commented on July 28, 2024

My problem is slightly different, but the outcome is the same. There problem is when I click on share button in safari or anywhere else the app will freeze, but when I change background of view in MainInterface.storyboard to solid black, the view will be rendered. A black page will be appeared and because of that touches not working and it looks like the app is frozen. So, view will rendered but the react native will not start. Where I go wrong and how I fix it.

from react-native-share-extension.

OmarBasem avatar OmarBasem commented on July 28, 2024

@asleepace @vbashiri Did anybody find a solution please?

from react-native-share-extension.

asleepace avatar asleepace commented on July 28, 2024

@RAMON90 yes in the ShareModule.java I modified the processIntent() method to the following:

    public WritableMap processIntent() {
        WritableMap map = Arguments.createMap();

        List<String> values = new ArrayList<>();
        String type = "";
        String action = "";

        Activity currentActivity = getCurrentActivity();

        if (currentActivity != null) {
            Intent intent = currentActivity.getIntent();
            action = intent.getAction();
            type = intent.getType();
            if (type == null) {
                type = "";
            }
            if (Intent.ACTION_SEND.equals(action) && !type.equals("")) {
                if ("text/plain".equals(type)) {
                    values.add(handleSendText(intent)); // Handle text being sent
                } else {
                    values.add(handleSendFile(intent)); // Handle single file being sent
                }
            } else if (Intent.ACTION_SEND_MULTIPLE.equals(action) && !type.equals("")) {
                values.addAll(handleSendMultipleFiles(intent)); // Handle single image being sent

            } else {
                // not ACTION_SEND or ACTION_SEND_MULTIPLE (will not happen)
                // do nothing
            }
        } else {
            // null activity
            // do nothing
        }

        WritableArray files = Arguments.createArray();
        for (String value : values) {
            WritableMap file = Arguments.createMap();
            file.putString("type", type);
            file.putString("value", value);
            files.pushMap(file);
        }
        map.putArray("files", files);

        return map;
    }

from react-native-share-extension.

Related Issues (20)

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.