Skip to content

Commit

Permalink
Get update folder method (#1323)
Browse files Browse the repository at this point in the history
* Exposed current update path.

* Check for null

* API reference update
  • Loading branch information
Anna Kocheshkova authored and alexandergoncharov-zz committed Jun 25, 2018
1 parent da56a35 commit 201735e
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
import org.json.JSONObject;

import java.io.File;
import java.io.NotActiveException;
import java.util.ArrayList;
import java.util.List;

Expand Down Expand Up @@ -159,6 +158,14 @@ long getBinaryResourcesModifiedTime() {
}
}

public String getPackageFolder() {
JSONObject codePushLocalPackage = mUpdateManager.getCurrentPackage();
if (codePushLocalPackage == null) {
return null;
}
return mUpdateManager.getPackageFolderPath(codePushLocalPackage.optString("packageHash"));
}

@Deprecated
public static String getBundleUrl() {
return getJSBundleFile();
Expand Down
2 changes: 2 additions & 0 deletions docs/api-android.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,4 +57,6 @@ As an alternative to constructors *you can also use `CodePushBuilder`* to setup

- __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.

- __getPackageFolder()__ - Returns the path to the current update folder.

- __overrideAppVersion(String appVersionOverride)__ - Sets the version of the application's binary interface, which would otherwise default to the Play Store version specified as the `versionName` in the `build.gradle`. This should be called a single time, before the CodePush instance is constructed.

0 comments on commit 201735e

Please sign in to comment.