RN.Linking.openURL does not pre-populate message body on Pixel devices
See original GitHub issue🐛 Bug Report
On Pixel devices, when using the url scheme sms:?body=Hello%20World
in RN.Linking.openURL(url)
, the Messages app opens, but upon choosing a message recipient, the body of the message does not get pre-populated. This url scheme works on iOS and other Android devices, populating the message body in their respective default SMS apps, but does not produce a pre-filled message body on Pixel devices.
Note: It seems to work on Pixel emulators via Android Studio but not on Pixel hardware.
To Reproduce
- Use
RN.Linking.openURL(url)
with the url schemesms:?body=Hello%20World
in your code. - Connect a Pixel device to your dev machine and make sure that you can test your code on it.
- Test the code and observe that the default messaging app opens. Select a contact or type in a recipient’s phone number.
- Observe that the text input of the default messaging app is empty.
Expected Behavior
The default messaging app on the Pixel device (likely Google Messages) opens and you are given the option to select a contact or type in a phone number to send the message to. Upon choosing the recipient, you are navigated to a conversation screen in which the text input is set to “Hello World”.
Code Example
RN.Linking.openURL("sms:?body=Hello%20World");
Environment
React Native Environment Info: System: OS: macOS 10.14.3 CPU: (8) x64 Intel® Core™ i7-7820HQ CPU @ 2.90GHz Memory: 171.01 MB / 16.00 GB Shell: 3.2.57 - /bin/bash Binaries: Node: 8.12.0 - /usr/local/bin/node Yarn: 1.9.4 - /usr/local/bin/yarn npm: 6.5.0 - /usr/local/bin/npm SDKs: iOS SDK: Platforms: iOS 12.1, macOS 10.14, tvOS 12.1, watchOS 5.1 Android SDK: API Levels: 23, 25, 26, 27, 28 Build Tools: 27.0.3, 28.0.2, 28.0.3 System Images: android-27 | Google APIs Intel x86 Atom, android-27 | Google Play Intel x86 Atom, android-28 | Google APIs Intel x86 Atom IDEs: Android Studio: 3.1 AI-173.4907809 Xcode: 10.1/10B61 - /usr/bin/xcodebuild npmPackages: react: 16.6.1 => 16.6.1 react-native: 0.57.7 => 0.57.7
Issue Analytics
- State:
- Created 5 years ago
- Reactions:5
- Comments:8
Top GitHub Comments
I ended up using https://www.npmjs.com/package/react-native-sms as I found linking with SMS links to work differently on a lot of API versions and devices.
This is not working on react native version 61.5, testing it on Android Q on Nexus emulator