Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

React-Native: How to open google play store from react native app?

I am trying to find a way how to open the google play store with my application when the user is pressing a button inside of the react-native application. Is there a way how to do this?

like image 822
NinetyHH Avatar asked Oct 26 '16 12:10

NinetyHH


People also ask

How do I open Google Play From React Native app?

Question: React-Native: How To Open Google Play Store From React Native App? Use React Native Linking API In Order To Open Google Play Store From Your App. You Can Do It As Given Below, The Snippet Below Opens The Playstore Page Of Whatsapp Messenger. Replace The Package Id With Yours To Change The Application Page.

Can we deploy React Native app on Play Store?

If you are using Expo, read the Expo guide for Deploying to App Stores to build and submit your app for the Google Play Store. This guide works with any React Native app to automate the deployment process.


1 Answers

If people are too lazy to read through the annoyingly SPA dev docs of android:

market://details?id=<package_name>

In react-native land:

Linking.openURL("market://details?id=<package_name>");

Example:

Linking.openURL("market://details?id=googoo.android.btgps");

Edit: Make sure to import Linking in order to use it

import { View, Text, StyleSheet, Linking } from 'react-native';
like image 107
flaky Avatar answered Sep 28 '22 02:09

flaky