decodeUrlContent
The decodeUrlContent API is called by the super app to decode the URL that is generated from a promotion QR code.
Method signature
copy
+ (void)decodeURLContent:(NSString *)urlContent completion:(void(^)(GRVURLContentDecodeResponse *response))completion;
Request parameters
Name | Type | Description | Required |
url | String | The URL content to be decoded. | M |
completion | iOS Block | The callback function that is invoked after the process ends. See completion for details. | M |
completion
Name | Type | Description | Required |
response | The decoding result. This parameter is required if the request succeeds. | O |
Response parameters
N/A
Sample
The following sample shows how to call the decodeUrlContent API.
copy
GRVURLContentDecoder.decodeURLContent(uriContent) { (response) in
// use the decoded URL to open a mini program
if response.success, let decodedURL = response.decodedURL {
//when decoding successed, you can open the decodeURL
//like GRVAppContainerLaunch.sharedInstance().openApp(withUrl: decodedUR
//L, extraParams: [:])
} else {
//when decoding failed, you can open the original uriContent
//like GRVAppContainerLaunch.sharedInstance().openApp(withUrl: uriConten
//t, extraParams: [:])
}
}