openApp
The openApp API is called by the super app to open mini programs with appId, the unique ID of the mini program.
Method signature
copy
void openApp(Context context, String appId, Bundle extraParams, GriverContainerAPICallBack callBack)
Request parameters
Response parameters
Field | Data type | Description | Required |
error | An object that is used to return the error code and error message when the mini program launch fails. | O |
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
Kotlin
copy
val bundle = Bundle()
bundle.putString("query", "a=b&c=d")
Griver.openApp(context, appId, bundle,
GriverContainerAPICallBack { errorCode, errorMessage ->
//return the error code and error message if the mini program launch fails
})
Java
copy
Bundle bundle = new Bundle();
bundle.putString("query", "a=b&c=d");
Griver.openApp(context, appId, bundle, new GriverContainerAPICallBack() {
@Override
public void error(int errorCode, String errorMessage) {
//return the error code and error message if the mini program launch fails
}
});