Skip to content
This repository was archived by the owner on May 20, 2025. It is now read-only.

Commit c0f5817

Browse files
committed
Introduce simpler getBundleUrl
1 parent 39132b0 commit c0f5817

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -771,6 +771,8 @@ Constructs the CodePush client runtime and includes methods for integrating Code
771771

772772
##### Methods
773773

774+
- __getBundleUrl()__ - Returns the path to the most recent version of your app's JS bundle file, assuming that the resource name is `index.android.bundle`. If your app is using a different bundle name, then use the overloaded verison of this method which allows specifying it. This method has the same resolution behavior as the Objective-C equivalent described above.
775+
774776
- __getBundleUrl(String bundleName)__ - Returns the path to the most recent version of your app's JS bundle file, using the specified resource name (e.g. `index.android.bundle`). This method has the same resolution behavior as the Objective-C equivalent described above.
775777

776778
- __getReactPackage()__ - Returns a `ReactPackage` object that should be added to your `ReactInstanceManager` via its `addPackage` method. Without this, the `react-native-code-push` JS module won't be available to your script.

android/app/src/main/java/com/microsoft/codepush/react/CodePush.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,10 @@ private long getBinaryResourcesModifiedTime() {
135135
}
136136
}
137137

138+
public static String getBundleUrl() {
139+
return currentInstance.getBundleUrlInternal("index.android.bundle");
140+
}
141+
138142
public static String getBundleUrl(String assetsBundleFileName) {
139143
if (currentInstance == null) {
140144
throw new CodePushNotInitializedException("A CodePush instance has not been created yet. Have you added it to your app's list of ReactPackages?");

0 commit comments

Comments
 (0)