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
{{ message }}
This repository was archived by the owner on May 20, 2025. It is now read-only.
@@ -40,6 +43,7 @@ In order to ensure that your end users always have a functioning version of your
40
43
41
44
- iOS
42
45
- Android
46
+
- Windows
43
47
44
48
We try our best to maintain backwards compatability of our plugin with previous versions of React Native, but due to the nature of the platform, and the existence of breaking changes between releases, it is possible that you need to use a specific version of the CodePush plugin in order to support the exact version of React Native you are using. The following table outlines which CodePush plugin versions officially support the respective React Native versions:
45
49
@@ -286,6 +290,61 @@ public class MainActivity extends ReactActivity {
286
290
}
287
291
```
288
292
293
+
## Windows Setup
294
+
295
+
Once you've acquired the CodePush plugin, you need to integrate it into the Visual Studio project of your React Native app and configure it correctly. To do this, take the following steps:
296
+
297
+
### Plugin Installation (Windows)
298
+
299
+
1. Open the Visual Studio solution located at `windows\<AppName>\<AppName>.sln` within your app
300
+
301
+
2. Right-click the solution node in the `Solution Explorer` window and select the `Add -> Existing Project...` menu item
302
+
303
+
3. Browse to the `node_modules\react-native-code-push\windows` directory, select the `CodePush.sln` file and click `OK`
304
+
305
+
4. Back in the `Solution Explorer`, right-click the project node that is named after your app, and select the `Add -> Reference...` menu item
306
+
307
+
5. Select the `Projects` tab on the left hand side, check the `CodePush` item and then click `OK`
308
+
309
+
### Plugin Configuration (Windows)
310
+
311
+
After installing the plugin, you need to configure your app to consult CodePush for the location of your JS bundle, since it will "take control" of managing the current and all future versions. To do this, update the `AppReactage.cs` file to use CodePush via the following changes:
312
+
313
+
```c#
314
+
...
315
+
// 1. Import the CodePush namespace
316
+
usingCodePush;
317
+
318
+
publicclassMainActivity extends ReactActivity {
319
+
// 2. Update the JavaScriptBundleFile property to return the
320
+
// bundle URL from CodePush instead of staticaly from the binary
321
+
publicoverridestringJavaScriptBundleFile
322
+
{
323
+
get
324
+
{
325
+
returnCodePush.getBundleUrl();
326
+
}
327
+
}
328
+
329
+
// 3. Instantiate an instance of the CodePush runtime and add it to the list of
330
+
// existing packages, specifying the right deployment key. If you don't already
331
+
// have it, you can run "code-push deployment ls <appName> -k" to retrieve your key.
332
+
publicoverrideList<IReactPackage> Packages
333
+
{
334
+
get
335
+
{
336
+
returnnewList<IReactPackage>
337
+
{
338
+
newMainReactPackage(),
339
+
...
340
+
newCodePush("DEPLOYMENT_KEY", this)
341
+
};
342
+
}
343
+
}
344
+
...
345
+
}
346
+
```
347
+
289
348
## Plugin Usage
290
349
291
350
With the CodePush plugin downloaded and linked, and your app asking CodePush where to get the right JS bundle from, the only thing left is to add the necessary code to your app to control the following policies:
0 commit comments