facebook / react-native

A framework for building native applications using React
https://reactnative.dev
MIT License
118.88k stars 24.3k forks source link

Sms via linking throwing error #34335

Closed BharatBhushan2907 closed 1 year ago

BharatBhushan2907 commented 2 years ago

Description

   let url = `sms:${data?.sender}&body=${data?.message}`;
      Linking.canOpenURL(url)
        .then((supported) => {
          if (supported) {
            Linking.openURL(url);
          } else {
            showToast('Messaging not available, 1500, 'error');
          }
        })
        .catch(() => {
          showToast('Messaging not available', 1500, 'error');
        });

this works fine for default messaging apps, but returns "Failed to start a conversation" for the google messages app on Samsung devices(android 12)

Version

0.64.2

Output of npx react-native info

System: OS: Linux 5.8 Ubuntu 20.04.3 LTS (Focal Fossa) CPU: (8) x64 11th Gen Intel(R) Core(TM) i5-1135G7 @ 2.40GHz Memory: 226.16 MB / 15.33 GB Shell: 5.0.17 - /bin/bash Binaries: Node: 14.18.0 - /usr/local/bin/node Yarn: 1.22.15 - /usr/local/bin/yarn npm: 6.14.15 - /usr/local/bin/npm Watchman: 4.9.0 - /usr/bin/watchman SDKs: Android SDK: Not Found IDEs: Android Studio: Not Found Languages: Java: 1.8.0_312 - /usr/bin/javac npmPackages: @react-native-community/cli: Not Found react: Not Found react-native: Not Found npmGlobalPackages: react-native: Not Found

Steps to reproduce

Simply use linking

Snack, code example, screenshot, or link to a repository

   let url = `sms:${data?.sender}&body=${data?.message}`;
      Linking.canOpenURL(url)
        .then((supported) => {
          if (supported) {
            Linking.openURL(url);
          } else {
            showToast('Messaging not available, 1500, 'error');
          }
        })
        .catch(() => {
          showToast('Messaging not available', 1500, 'error');
        });
github-actions[bot] commented 1 year ago

This issue is stale because it has been open 180 days with no activity. Remove stale label or comment or this will be closed in 7 days.

github-actions[bot] commented 1 year ago

This issue was closed because it has been stalled for 7 days with no activity.