fetchApps
The fetchApps API is called by the super app to run a query with GRVFetchAppsParameter to asynchronously fetch a list of mini programs that are launched to their app. This API provides a pagination capability to return the data.
Method signature
- (void)fetchApps:(GRVFetchAppsParameter *)parameters
completionCallback:(void(^)(GRVFetchAppsResponse * _Nullable, NSError * _Nullable))completionCallback;
Request parameters
Name | Type | Description | Required |
parameters | An object that is used to set query conditions of mini programs. | M | |
completionCallback | void(^)(GRVFetchAppsResponse * _Nullable, NSError * _Nullable) | A callback function that is used to return the query result. See completionCallback for details. | M |
completionCallback
Return type | Method | Description |
void | GRVFetchAppsResponse * | The method that is used to return the data of mini programs. See GRVFetchAppsResponse for details. |
void | NSError ** | The method that is used to return the error code and error message. See Error codes for details. |
Response parameters
Name | Type | Description | Required |
result | The result that is returned for the query. åŠ errorcode+message | O | |
error | NSError * | The error code and error message that are returned when the query fails. | O |
Error codes
Error code | Error message | Description | Further action |
2 | INVALID_PARAMETER | Parameter error. | Refer to the Request parameters table and check if all parameter types are correct and if all required parameters are specified. |
3 | UNKNOWN_ERROR | Server fluctuations. | Retry the request. If the problem persists, please contact overseas_support@service.alibaba.com for assistance. |
10104 | NETWORK_ERROR | Network error. | Check the network connection and try again. |
Sample
let parameter = GRVFetchAppsParameter()
parameter.queryStartIndex = 0
parameter.querySize = 10
parameter.sortDescriptor = GRVAppIdSortDescriptorKey
parameter.ascending = true
parameter.category = "1001"
GRVAppContainerLaunch.sharedInstance().fetchApps(parameter) { response, error in
...
}