Skip to content

Commit

Permalink
Add launchAppStore() method to Launcher
Browse files Browse the repository at this point in the history
  • Loading branch information
Jason Lai committed Jul 29, 2014
1 parent 01daa03 commit ec45035
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/android/JSCommandDispatcher.java
Original file line number Diff line number Diff line change
Expand Up @@ -257,6 +257,12 @@ public void launcher_launchApp(JSCommand command, JSONObject args) throws JSONEx
device.getLauncher().launchAppWithInfo(appInfo, params, command.getAppLaunchListener());
}

@CommandMethod
public void launcher_launchAppStore(JSCommand command, JSONObject args) throws JSONException {
String appId = args.optString("appId");
device.getLauncher().launchAppStore(appId, command.getAppLaunchListener());
}

@CommandMethod
public void launcher_launchBrowser(JSCommand command, JSONObject args) throws JSONException {
String url = args.optString("url", null);
Expand Down
7 changes: 7 additions & 0 deletions src/ios/ConnectSDKCordovaDispatcher.m
Original file line number Diff line number Diff line change
Expand Up @@ -408,6 +408,13 @@ - (void) launcher_closeApp:(JSCommand*)command
[device.launcher closeApp:launchSession success:command.success failure:command.failure];
}

- (void) launcher_launchAppStore:(JSCommand*)command
{
NSString* appId = command.args[@"appId"];

[device.launcher launchAppStore:appId success:command.appLaunchSuccess failure:command.failure];
}

- (void) launcher_launchBrowser:(JSCommand*)command
{
NSString* urlString = command.args[@"url"];
Expand Down
10 changes: 10 additions & 0 deletions www/ConnectSDK.js
Original file line number Diff line number Diff line change
Expand Up @@ -1432,6 +1432,16 @@ registerDeviceInterface("launcher",
responseWrapper: wrapLaunchSession
},

/**
* @method
* @param {string} appId
* @success {launchCallback}
*/
launchAppStore: {
args: ["appId"],
responseWrapper: wrapLaunchSession
},

/**
* @method
* @param {string} url
Expand Down

0 comments on commit ec45035

Please sign in to comment.