Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RN.Linking.openURL does not pre-populate message body on Pixel devices #23992

Closed
flavinger opened this issue Mar 18, 2019 · 8 comments
Closed
Labels
API: Linking Bug Ran Commands One of our bots successfully processed a command. Resolution: Locked This issue was locked by the bot.

Comments

@flavinger
Copy link

flavinger commented Mar 18, 2019

🐛 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(R) Core(TM) 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

@react-native-bot
Copy link
Collaborator

It looks like you are using an older version of React Native. Please update to the latest release, v0.59 and verify if the issue still exists.

The "Resolution: Old Version" label will be removed automatically once you edit your original post with the results of running `react-native info` on a project using the latest release.

@joeyscarim
Copy link

joeyscarim commented Mar 19, 2019

I can confirm this issue does exist on the latest version of React Native:

  React Native Environment Info:
    System:
      OS: macOS 10.14.3
      CPU: (4) x64 Intel(R) Core(TM) i5-6267U CPU @ 2.90GHz
      Memory: 32.57 MB / 8.00 GB
      Shell: 3.2.57 - /bin/bash
    Binaries:
      Node: 8.11.1 - /usr/local/bin/node
      Yarn: 1.10.1 - /usr/local/bin/yarn
      npm: 6.8.0 - /usr/local/bin/npm
      Watchman: 4.9.0 - /usr/local/bin/watchman
    SDKs:
      iOS SDK:
        Platforms: iOS 12.1, macOS 10.14, tvOS 12.1, watchOS 5.1
      Android SDK:
        API Levels: 23, 24, 25, 26, 27, 28
        Build Tools: 19.1.0, 23.0.1, 25.0.3, 26.0.1, 26.0.2, 26.0.3, 27.0.1, 27.0.2, 27.0.3, 28.0.0, 28.0.2, 28.0.3
        System Images: android-24 | Google Play Intel x86 Atom, android-27 | Google APIs Intel x86 Atom, android-28 | Google APIs Intel x86 Atom
    IDEs:
      Android Studio: 3.3 AI-182.5107.16.33.5264788
      Xcode: 10.1/10B61 - /usr/bin/xcodebuild
    npmPackages:
      react: 16.6.3 => 16.6.3 
      react-native: 0.58.5 => 0.58.5 
    npmGlobalPackages:
      create-react-native-app: 1.0.0
      react-native-cli: 2.0.1
      react-native-contacts-wrapper: 0.2.4
      react-native-git-upgrade: 0.2.7

@joeyscarim
Copy link

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.

@react-native-bot react-native-bot added the Ran Commands One of our bots successfully processed a command. label Apr 10, 2019
@react-native-bot
Copy link
Collaborator

I am closing this issue because it does not appear to have been verified on the latest release, and there has been no followup in a while.

If you found this thread after encountering the same issue in the latest release, please feel free to create a new issue with up-to-date information by clicking here.

@luisnaranjo733
Copy link

Looks like the repro was confirmed on the latest release but the bot wasn't smart enough to see that. Can someone file a new issue on the latest release?

@delia-m
Copy link

delia-m commented Apr 12, 2019

I still have the same issue with RN 0.59.4

@buoyad
Copy link

buoyad commented May 15, 2019

We've seen this on devices other than the pixel running android 9. The emulator works correctly.

@minuhariharan
Copy link

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

@facebook facebook locked as resolved and limited conversation to collaborators Apr 10, 2020
@react-native-bot react-native-bot added the Resolution: Locked This issue was locked by the bot. label Apr 10, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
API: Linking Bug Ran Commands One of our bots successfully processed a command. Resolution: Locked This issue was locked by the bot.
Projects
None yet
Development

No branches or pull requests

7 participants