Skip to content

Commit

Permalink
Merge branch 'master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
MikhailSuendukov authored Jan 18, 2024
2 parents 3f92f71 + 99c8c4e commit 357cbea
Show file tree
Hide file tree
Showing 7 changed files with 35 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
import com.facebook.react.bridge.JavaScriptModule;
import com.facebook.react.bridge.NativeModule;
import com.facebook.react.bridge.ReactApplicationContext;
import com.facebook.react.devsupport.DevInternalSettings;
import com.facebook.react.devsupport.interfaces.DevSupportManager;
import com.facebook.react.modules.debug.interfaces.DeveloperSettings;
import com.facebook.react.uimanager.ViewManager;

import org.json.JSONException;
Expand Down Expand Up @@ -152,12 +152,12 @@ private boolean isLiveReloadEnabled(ReactInstanceManager instanceManager) {
if (instanceManager != null) {
DevSupportManager devSupportManager = instanceManager.getDevSupportManager();
if (devSupportManager != null) {
DevInternalSettings devInternalSettings = (DevInternalSettings)devSupportManager.getDevSettings();
Method[] methods = devInternalSettings.getClass().getMethods();
DeveloperSettings devSettings = devSupportManager.getDevSettings();
Method[] methods = devSettings.getClass().getMethods();
for (Method m : methods) {
if (m.getName().equals("isReloadOnJSChangeEnabled")) {
try {
return (boolean) m.invoke(devInternalSettings);
return (boolean) m.invoke(devSettings);
} catch (Exception x) {
return false;
}
Expand Down
5 changes: 3 additions & 2 deletions android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@

buildscript {
repositories {
jcenter()
google()
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:1.3.0'
Expand All @@ -15,6 +16,6 @@ buildscript {
allprojects {
repositories {
mavenLocal()
jcenter()
mavenCentral()
}
}
2 changes: 1 addition & 1 deletion docs/api-js.md
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ The `codePush` decorator accepts an "options" object that allows you to customiz

* __minimumBackgroundDuration__ *(Number)* - Specifies the minimum number of seconds that the app needs to have been in the background before restarting the app. This property only applies to updates which are installed using `InstallMode.ON_NEXT_RESUME` or `InstallMode.ON_NEXT_SUSPEND`, and can be useful for getting your update in front of end users sooner, without being too obtrusive. Defaults to `0`, which has the effect of applying the update immediately after a resume or unless the app suspension is long enough to not matter, regardless how long it was in the background.

* __updateDialog__ *(UpdateDialogOptions)* - An "options" object used to determine whether a confirmation dialog should be displayed to the end user when an update is available, and if so, what strings to use. Defaults to `null`, which has the effect of disabling the dialog completely. Setting this to any truthy value will enable the dialog with the default strings, and passing an object to this parameter allows enabling the dialog as well as overriding one or more of the default strings. Before enabling this option within an App Store-distributed app, please refer to [this note](https://github.com/microsoft/react-native-code-push#user-content-apple-note).
* __updateDialog__ *(UpdateDialogOptions)* - An "options" object used to determine whether a confirmation dialog should be displayed to the end user when an update is available, and if so, what strings to use. Defaults to `null`, which has the effect of disabling the dialog completely. Setting this to any truthy value will enable the dialog with the default strings, and passing an object to this parameter allows enabling the dialog as well as overriding one or more of the default strings. Before enabling this option within an App Store-distributed app, please refer to [this note](https://github.com/microsoft/react-native-code-push#app-store).

The following list represents the available options and their defaults:

Expand Down
23 changes: 23 additions & 0 deletions docs/setup-windows.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,29 @@ void App::OnLaunched(activation::LaunchActivatedEventArgs const& e)
...
```
#### Plugin Configuration (Windows) C#
1. add name space `Microsoft.CodePush` to `App.xaml.cs`
2. add app version and deployment key to `configMap` at the start of your app's `OnLaunched` method in `App.xaml.cs`.
```c#
using Microsoft.CodePush;
...
protected override void OnLaunched(LaunchActivatedEventArgs e)
{
Microsoft.CodePush.ReactNative.CodePushConfig.SetHost(Host);
IDictionary<string, string> configMap = new Dictionary<string, string>();
configMap.Add("appVersion", "1.0.0");
configMap.Add("deploymentKey", "deployment key");
Microsoft.CodePush.ReactNative.CodePushConfig.Init(configMap);
...
}
...
```


### Plugin Installation and Configuration for React Native Windows lower than 0.60

#### Plugin Installation (Windows)
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "react-native-code-push",
"version": "8.1.0",
"version": "8.1.1",
"description": "React Native plugin for the CodePush service",
"main": "CodePush.js",
"typings": "typings/react-native-code-push.d.ts",
Expand Down
2 changes: 1 addition & 1 deletion test/test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -307,7 +307,7 @@ class RNProjectManager extends ProjectManager {
}
mkdirp.sync(projectDirectory);

return TestUtil.getProcessOutput("npx react-native init " + appName + " --version 0.71.3", { cwd: projectDirectory, timeout: 30 * 60 * 1000 })
return TestUtil.getProcessOutput("npx react-native init " + appName + " --version 0.71.3 --install-pods", { cwd: projectDirectory, timeout: 30 * 60 * 1000 })
.then((e) => { console.log(`"npx react-native init ${appName}" success. cwd=${projectDirectory}`); return e; })
.then(this.copyTemplate.bind(this, templatePath, projectDirectory))
.then<void>(TestUtil.getProcessOutput.bind(undefined, TestConfig.thisPluginInstallString, { cwd: path.join(projectDirectory, TestConfig.TestAppName) }))
Expand Down

0 comments on commit 357cbea

Please sign in to comment.