0

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.

Sh. Pavel
  • 1,584
  • 15
  • 28
Guille
  • 370
  • 2
  • 7
  • 21

1 Answers1

1

You need to use the below code

import { Linking } from ‘react-native’;
shareToWhatsAppWithContact = (text, phoneNumber) => {
 Linking.openURL(`whatsapp://send?text=${text}&phone=${phoneNumber}`);
}
Ahmed Ali
  • 2,574
  • 2
  • 23
  • 38