【问题标题】:Cannot Linking. openURL whatsup message in react native无法链接。反应原生的openURL whatsup消息
【发布时间】:2018-11-28 10:20:36
【问题描述】:

我需要打开带有预加载消息的 whatsup,如下所示:

Linking.openURL('whatsapp://send?text==%C2%A1Hola!%20Quiero%20realizar%20una%20consulta.&phone=5493416931539').catch(err => console.error('An error occurred', err));

我收到错误消息:"{"framestopop:1,code:EUNSPECIFIED"}"

我已尝试使用 .catch(() => null);,但也没有用。

【问题讨论】:

    标签: javascript reactjs react-native hybrid-mobile-app whatsapp


    【解决方案1】:

    你需要使用下面的代码

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

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2018-09-27
      • 2018-05-27
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多