Giter Club home page Giter Club logo

Comments (4)

mustafapolat avatar mustafapolat commented on May 26, 2024 2

You can change easily your share_URL content with text or fix it as below.

For fixing it :

In this file :
https://github.com/EstebanFuentealba/react-native-share/blob/master/android/src/main/java/cl/json/RNShareModule.java#L53:L55

Replace the code line 53-54 as below:

if (hasValidKey("share_text", options)) { intent.putExtra(Intent.EXTRA_TEXT, options.getString("share_text")); }

i hope @EstebanFuentealba consider it :)

from react-native-share.

udfalkso avatar udfalkso commented on May 26, 2024

Seems like it depends where your'e sharing it to. I find that sharing to Gmail, the share_text shows. But sharing to twitter, it doesn't. Seems like some apps use the SUBJECT field and some don't.

from react-native-share.

tgoldenberg avatar tgoldenberg commented on May 26, 2024

Yeah, kind of a let down that the text doesn't share to either Facebook or Twitter

from react-native-share.

alyssonmessias avatar alyssonmessias commented on May 26, 2024

Thanks @mustafapolat , resolved my problem. My code as below:

private Intent createShareIntent(ReadableMap options) {
    Intent intent = new Intent(android.content.Intent.ACTION_SEND);
    intent.setType("text/plain");

    String msg = "";
    String title = "Share";
    if (hasValidKey("title", options)) {
      title = options.getString("title");
      intent.putExtra(Intent.EXTRA_SUBJECT, title);
    }

    if (hasValidKey("share_text", options)) {
      msg += options.getString("share_text");
    }


    if (hasValidKey("share_URL", options)) {
      msg += "\n"+options.getString("share_URL");
    }

    intent.putExtra(Intent.EXTRA_TEXT, msg); 

    return intent;
  }

from react-native-share.

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.