singleShare f Messenger, SMS , SnapChat on Android not working thowing the following error message.
Error => {"error": "key 'social' missing in options"}
Same issue here
If you write 'messenger' instad of using Share.Social.MESSENGER will work. I don't know why MESSENGER is not defined in constants of this library
I think I have figured that out , why MESSENGER, SMS , and SNAPCHAT was not working because of index.js social object
https://github.com/react-native-community/react-native-share/blob/master/index.js#L162
I have changed to
static Social = {
FACEBOOK: NativeModules.RNShare.FACEBOOK || 'facebook',
PAGESMANAGER: NativeModules.RNShare.PAGESMANAGER || 'pagesmanager',
TWITTER: NativeModules.RNShare.TWITTER || 'twitter',
WHATSAPP: NativeModules.RNShare.WHATSAPP || 'whatsapp',
INSTAGRAM: NativeModules.RNShare.INSTAGRAM || 'instagram',
INSTAGRAM_STORIES: NativeModules.RNShare.INSTAGRAM_STORIES || 'instagram-stories',
GOOGLEPLUS: NativeModules.RNShare.GOOGLEPLUS || 'googleplus',
EMAIL: NativeModules.RNShare.EMAIL || 'email',
PINTEREST: NativeModules.RNShare.PINTEREST || 'pinterest',
LINKEDIN: NativeModules.RNShare.LINKEDIN || 'linkedin',
...(Platform.OS === 'android' && {
SMS: NativeModules.RNShare.SMS || 'sms',
MESSENGER: NativeModules.RNShare.MESSENGER || 'messenger',
SNAPCHAT: NativeModules.RNShare.SNAPCHAT || 'snapchat',
})
};
This would solve the problem
Most helpful comment
I think I have figured that out , why MESSENGER, SMS , and SNAPCHAT was not working because of index.js social object
https://github.com/react-native-community/react-native-share/blob/master/index.js#L162
I have changed to
static Social = {
FACEBOOK: NativeModules.RNShare.FACEBOOK || 'facebook',
PAGESMANAGER: NativeModules.RNShare.PAGESMANAGER || 'pagesmanager',
TWITTER: NativeModules.RNShare.TWITTER || 'twitter',
WHATSAPP: NativeModules.RNShare.WHATSAPP || 'whatsapp',
INSTAGRAM: NativeModules.RNShare.INSTAGRAM || 'instagram',
INSTAGRAM_STORIES: NativeModules.RNShare.INSTAGRAM_STORIES || 'instagram-stories',
GOOGLEPLUS: NativeModules.RNShare.GOOGLEPLUS || 'googleplus',
EMAIL: NativeModules.RNShare.EMAIL || 'email',
PINTEREST: NativeModules.RNShare.PINTEREST || 'pinterest',
LINKEDIN: NativeModules.RNShare.LINKEDIN || 'linkedin',
...(Platform.OS === 'android' && {
SMS: NativeModules.RNShare.SMS || 'sms',
MESSENGER: NativeModules.RNShare.MESSENGER || 'messenger',
SNAPCHAT: NativeModules.RNShare.SNAPCHAT || 'snapchat',
})
};
This would solve the problem