No enum constant cl.json.RNShareModule.SHARES.sms
See original GitHub issueSteps 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…
Issue Analytics
- State:
- Created 4 years ago
- Comments:19 (4 by maintainers)
Top 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 >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
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)
I don’t know what to tell you - the example works - try it, then very carefully apply what it does to your project 🤷♂️