问题
I need to open whatsup with a preloaded message, like this:
Linking.openURL('whatsapp://send?text==%C2%A1Hola!%20Quiero%20realizar%20una%20consulta.&phone=5493416931539').catch(err => console.error('An error occurred', err));
I receive the error message: "{"framestopop:1,code:EUNSPECIFIED"}"
I've tried with .catch(() => null);
but doesn't work neither.
回答1:
You need to use the below code
import { Linking } from ‘react-native’;
shareToWhatsAppWithContact = (text, phoneNumber) => {
Linking.openURL(`whatsapp://send?text=${text}&phone=${phoneNumber}`);
}
来源:https://stackoverflow.com/questions/50928633/cannot-linking-openurl-whatsup-message-in-react-native