Skip to content

Commit 1f7c903

Browse files
Windows plugin configuration steps in C# (microsoft#2072)
Configuration steps for react native windows apps that uses C# as base native language Co-authored-by: velimir-jankovic <[email protected]>
1 parent 2b37595 commit 1f7c903

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

docs/setup-windows.md

+23
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,29 @@ void App::OnLaunched(activation::LaunchActivatedEventArgs const& e)
3333
...
3434
```
3535
36+
#### Plugin Configuration (Windows) C#
37+
38+
1. add name space `Microsoft.CodePush` to `App.xaml.cs`
39+
40+
2. add app version and deployment key to `configMap` at the start of your app's `OnLaunched` method in `App.xaml.cs`.
41+
42+
```c#
43+
using Microsoft.CodePush;
44+
45+
...
46+
protected override void OnLaunched(LaunchActivatedEventArgs e)
47+
{
48+
Microsoft.CodePush.ReactNative.CodePushConfig.SetHost(Host);
49+
IDictionary<string, string> configMap = new Dictionary<string, string>();
50+
configMap.Add("appVersion", "1.0.0");
51+
configMap.Add("deploymentKey", "deployment key");
52+
Microsoft.CodePush.ReactNative.CodePushConfig.Init(configMap);
53+
...
54+
}
55+
...
56+
```
57+
58+
3659
### Plugin Installation and Configuration for React Native Windows lower than 0.60
3760

3861
#### Plugin Installation (Windows)

0 commit comments

Comments
 (0)