question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

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

  1. Use RN.Linking.openURL(url) with the url scheme sms:?body=Hello%20World in your code.
  2. Connect a Pixel device to your dev machine and make sure that you can test your code on it.
  3. Test the code and observe that the default messaging app opens. Select a contact or type in a recipient’s phone number.
  4. 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:closed
  • Created 5 years ago
  • Reactions:5
  • Comments:8

github_iconTop GitHub Comments

2reactions
joeyscarimcommented, Mar 26, 2019

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.

0reactions
minuhariharancommented, Jan 9, 2020

This is not working on react native version 61.5, testing it on Android Q on Nexus emulator

Read more comments on GitHub >

github_iconTop Results From Across the Web

React Native Linking simultaneously for mail AND sms
I'd like my user to choose between those app and prefill information in the body. Linking.openURL('mailto:support@example.com?subject= ...
Read more >
Linking - React Native
Linking gives you a general interface to interact with both incoming and outgoing app links.
Read more >
React Native Clicking on a Text Hyperlink to Open It in The ...
In React Native Clicking on a Text Hyperlink to open It in Browser can be done using a React Native component called Linking....
Read more >
ArcticAI: A Deep Learning Platform for Rapid and Accurate ...
In this study, we developed an artificial intelligence (AI) platform, ArcticAI, which augments the surgical workflow to improve efficiency by ...
Read more >
Free Automated Malware Analysis Service - Hybrid Analysis
... the developer and a guarantee that the binary has not been tampered with. ... QKchrome/browser/res/activity-stream/data/content/assets/sync-devices- ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found