openAppWithUrl
The openAppWithUrl API is called by the super app to open a mini program with its URL.
Method signature
func openApp(withUrl urlStr: String, extraParams: [String: Any]?, error: ()) throws -> UIViewController?
Request parameters
Name | Type | Description | Required |
urlStr | String | The scheme URL of the mini program. The URL should use the HTTP or HTTPs protocols and include the _ariver_appid, _ariver_path, and _ariver_version query string parameters. | M |
extraParams | [String: Any]? | This parameter is used to pass startup parameters to IAPMini Program SDK to customize the behavior of a mini program during startup. See Startup parameters for details. | O |
Response parameters
N/A
Error codes
Error code | Error message | Description | Further action |
90002 | GRV_CONTAINER_NOT_INITIALIZED | IAPMiniProgram SDK is not initialized. | Initialize the SDK. |
90003 | GRV_CONTAINER_ERROR_UNKNOWN | Parameter error. | Refer to the Request parameters table and check if all parameter types are correct and if all required parameters are specified. |
Sample
do {
let url = "xxx"
let extraParams = ["query": "a=b&c=d"]
let viewController = try GRVAppContainerLaunch.sharedInstance().openApp(withApppId: url, extraParams: extraParams, error: ())
} catch {
}