You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
1. For opening the app store or play store the app should be live.
67
-
2. It might not be able to open the app store or play store in simulator. You can try it in physical device.
68
-
3. If you are using the same code base for both android and ios than you can detect the platform and provide the appId.
69
-
4. You can find a sample app from here [app-upgrade-react-native-demo-app](https://github.com/appupgrade-dev/app_upgrade_react_native_demo_app)
70
-
r. Read detailed blog on how to integrate from here [How to upgrade/force upgrade React Native app](https://appupgrade.dev/blog/how-to-force-upgrade-react-native-app)
import {appUpgradeVersionCheck} from 'app-upgrade-react-native-sdk';
79
76
@@ -109,6 +106,74 @@ export default function App() {
109
106
);
110
107
}
111
108
109
+
```
110
+
### Note:
111
+
1. For opening the app store or play store the app should be live.
112
+
2. It might not be able to open the app store or play store in simulator. You can try it in physical device.
113
+
3. If you are using the same code base for both android and ios than you can detect the platform and provide the appId.
114
+
4. You can find a sample app from here [app-upgrade-react-native-demo-app](https://github.com/appupgrade-dev/app_upgrade_react_native_demo_app)
115
+
5. Read detailed blog on how to integrate from here [How to upgrade/force upgrade React Native app](https://appupgrade.dev/blog/how-to-force-upgrade-react-native-app)
116
+
117
+
### Example with store other than app store or play store.
118
+
If you want users to redirect to store other than app store or playstore. You can add these additional parameters **preferredAndroidMarket** see the example below.
119
+
```
120
+
import {appUpgradeVersionCheck, PreferredAndroidMarket } from 'app-upgrade-react-native-sdk';
121
+
122
+
.....
123
+
124
+
const App: () => Node = () => {
125
+
126
+
const xApiKey = "MDNmNmZkNDEtNmNkMi00NzY3LThjOWEtYWYxMGFjZWQ0ZjI2"; // Your project key
127
+
const appInfo = {
128
+
appId: 'com.android.com' or 'id1549468967', // Your app url in play store or app store
129
+
appName: 'Wallpaper app', // Your app name
130
+
appVersion: '1.0.0', // Your app version
131
+
platform: 'android', // App Platform, android or ios
132
+
environment: 'production', // App Environment, production, development
133
+
appLanguage: 'es' //Your app language ex: en, es etc. Optional.
134
+
preferredAndroidMarket: PreferredAndroidMarket.AMAZON // or PreferredAndroidMarket.HUAWEI or PreferredAndroidMarket.OTHER If not provided default is Google playstore. Optional
135
+
};
136
+
137
+
appUpgradeVersionCheck(appInfo, xApiKey);
138
+
139
+
return (
140
+
<SafeAreaView style={backgroundStyle}>
141
+
...
142
+
</SafeAreaView>
143
+
);
144
+
};
145
+
146
+
```
147
+
148
+
If you want to redirect user to some other android market place you can use the following example:
149
+
```
150
+
import {appUpgradeVersionCheck, PreferredAndroidMarket } from 'app-upgrade-react-native-sdk';
151
+
152
+
.....
153
+
154
+
const App: () => Node = () => {
155
+
156
+
const xApiKey = "MDNmNmZkNDEtNmNkMi00NzY3LThjOWEtYWYxMGFjZWQ0ZjI2"; // Your project key
157
+
const appInfo = {
158
+
appId: 'com.android.com' or 'id1549468967', // Your app url in play store or app store
159
+
appName: 'Wallpaper app', // Your app name
160
+
appVersion: '1.0.0', // Your app version
161
+
platform: 'android', // App Platform, android or ios
162
+
environment: 'production', // App Environment, production, development
163
+
appLanguage: 'es' //Your app language ex: en, es etc. Optional.
0 commit comments