fetchAppInfosByIds
The fetchAppInfosByIds API is called by the super app to run a query with mini program IDs 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
typedef void(^GRVFetchAppInfosCompletionHandler)(GRVFetchAppInfosResult * _Nullable result, NSError * _Nullable error);
- (void)fetchAppInfosByIds:(NSArray<NSString *> *)appIds
category:(nullable NSString *)category
completionCallback:(GRVFetchAppInfosCompletionHandler)completionCallback;
Request parameters
Name | Type | Description | Required |
appIds | NSArray<NSString *> * | The unique ID that is assigned by Mini Program Platform to identify a mini program. You can get the ID from the Mini Program Platform console. | M |
category | NSString * | The category that mini programs belong to. Specify this parameter with the unique category ID that is assigned by Mini Program Platform. You can get the ID from the Mini Program Platform console. | O |
completionCallback | void(^)(GRVFetchAppInfosResult * _Nullable result, NSError * _Nullable error) | The callback that is used to return the query result. See completionCallback for details. | M |
completionCallback
Return type | Method | Description |
void | GRVFetchAppInfosResult * | The method that is used to return the data of mini programs. See GRVFetchAppInfosResult 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 mini program list that is returned when the query is successful. | 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 appIds = ["2102000024800001"]
let category = "1001"
GRVAppContainerLaunch.sharedInstance().fetchAppInfos(byIds: appIds, category: categoryCode, completionCallback: { (response, error) in
...
})