question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

No enum constant cl.json.RNShareModule.SHARES.sms

See original GitHub issue

Steps to reproduce

I just created a simple application React Native like:

import React, {Component} from 'react';
import {Platform, StyleSheet, Text, View, TouchableOpacity} from 'react-native';
import Share from 'react-native-share';

const instructions = Platform.select({
  :
});

type Props = {};
export default class App extends Component<Props> {
  render() {

    const shareOptions = {
      title: 'Share Title',
      message: 'Message Body',
      // url: 'https://id.yahoo.com',
      social: 'sms'
    }

    console.log('App| on render method here...');
    
    return (
      <View style={styles.container}>
        <Text style={styles.welcome}>Welcome to React Native!</Text>
        <Text style={styles.instructions}>To get started, edit App.js</Text>
        <Text style={styles.instructions}>{instructions}</Text>
        <TouchableOpacity onPress={()=>{
          Share.shareSingle(shareOptions);
        }}>
          <View style={styles.instructions}>
            <Text>Simple Share</Text>
          </View>
        </TouchableOpacity>
      </View>
    );

  }//end of render

}//end of class

const styles = StyleSheet.create({
  container: {
    :
});

Expected behaviour

The application should show (Sharing) SMS dialog.

Actual behaviour

But, I got warning:

Possible Unhandled Promise Rejection (id: 0):
Object {
  "error": No enum constant cl.json.RNShareModule.SHARES.sms",
}

If I changed value in key social to `email’, it was working by showing Gmail Application.

Environment

  • “react”: "16.8.3:
  • “react-native”: “0.59.3” -Android PIXEL_XL_API_25 -Windows 10

react-native-share

^1.1.3: npm -v: 6.4.1

I got error on image…

Thank you in advance…

image

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:19 (4 by maintainers)

github_iconTop GitHub Comments

2reactions
mikehardycommented, Apr 22, 2019

That’s a totally different error. Looks to me like you simply don’t have anything installed that has registered for the intent you sent. Try some super basic intent anything can handle (like pure text) just to make sure your intent sending code works, and if that works then you just need to make sure you actually have an app installed that takes the intent you want (or that your intent does what you think it does with content types etc)

1reaction
mikehardycommented, Apr 12, 2019

I don’t know what to tell you - the example works - try it, then very carefully apply what it does to your project 🤷‍♂️

Read more comments on GitHub >

github_iconTop Results From Across the Web

No enum constant cl.json.RNShareModule.SHARES.sms #473
Steps to reproduce I just created a simple application React Native like: import React, {Component} from 'react'; import {Platform, ...
Read more >
java.lang.IllegalArgumentException: No enum constant found
You can introduce static method inside your Enum to check a given string is a correct Enum value. Something like this,
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found