How to Open Google Play Store from your React Native App

If you have tried native Android application development then you might know that opening or interact with other apps is done with Intents. In React Native, we use its Linking API to interact with other apps.

Use react native Linking API in order to open the 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.

Linking.openURL("market://details?id=com.whatsapp");

Following is the complete code where the play store is opened when the button is pressed.

import React from 'react';
import {View, Button, Linking} from 'react-native';

const App = () => {
  return (
    <View style={{flex: 1, justifyContent: 'center', alignItems: 'center'}}>
      <Button
        title="Click to Open"
        onPress={() => Linking.openURL('market://details?id=com.whatsapp')}
      />
    </View>
  );
};

export default App;

I hope this react native tutorial to open google play store is helpful for you.

Similar Posts

One Comment

Leave a Reply