openUrl
The openUrl API is called by the super app to open a mini program with its URL.
Method signature
copy
function openUrl(
url: string,
extra?: {
extraParams?: Map<string, any>;
success?: (success: BaseSuccess) => void;
error?: (error: BaseError) => void;
}
)
Request parameters
Field | Data type | Required | Description |
url | string | Yes | 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. |
extra | Object | No | An extended attribute that is used to provide additional information if necessary. The included parameters are:
|
Response parameters
N/A
Result codes
Result code | Result message | Description | Further action |
1000 |
| The SDK opens the mini program successfully. | N/A |
2000 | The result message varies depending on the error that occurs. | The SDK encounters an error when attempting to open the mini program. | Refer to the result message for specific actions. |
Sample
copy
import { openUrl } from 'iapminiprogram-rn';
import type { BaseSuccess, BaseError } from 'iapminiprogram-rn';
function openMiniUrl(url: string) {
openUrl(url, {
success: (success: BaseSuccess) => {
},
error: (error: BaseError) => {
},
});
}