Operation-related APIs
This topic introduces all operation-related APIs. Call APIs per your business requirements to realize specific operation-related services/capabilities.
Note: These APIs are applicable to all versions of the iOS SDK 2.67.0 and later. For more, see SDK release notes.
setRegionGatewayUrl API
This API is called to set the regional proxy, the gateway URL address.
Method signature
@interface IAPOperationManager : NSObject
+ (void)setRegionGatewayUrl:(NSString *)gatewayUrl;
@end
Parameters
Parameter | Data type | Required | Description |
gatewayUrl | NSString | Yes | Indicates the gateway URL address. |
Return value
N/A
Sample
IAPOperationManager.setRegionGatewayUrl("Your Gateway Url xxx")
setRegionLogUploadUrl API
This API is called to set the regional proxy, the log uploading URL address.
Method signature
@interface IAPOperationManager : NSObject
+ (void)setRegionLogUploadUrl:(NSString *)logUploadUrl;
@end
Parameters
Parameter | Data type | Required | Description |
logUploadUrl | NSString | Yes | Indicates the log uploading URL address. |
Return value
N/A
Sample
IAPOperationManager.setRegionLogUploadUrl("Your LogUpload Url xxx")
searchAppsByKeywords API
This API is called to search mini programs by keywords. Results can be paginated to support large datasets.
Method signature
@interface IAPOperationManager : NSObject
+ (void)searchAppsByKeywords:(NSString *)keywords
queryStartIndex:(NSUInteger)queryStartIndex
querySize:(NSUInteger)querySize
completionHandler:(void (^)(NSDictionary<NSString *,id> * _Nullable result, NSError * _Nullable error))completionHandler;
@end
Parameters
Parameter | Data type | Required | Description |
keywords | NSString | Yes | The search terms used to query mini programs. |
queryStartIndex | NSUInteger | Yes | The starting index for the query result. Use |
querySize | NSUInteger | Yes | The maximum number of results to return per query request. |
completionHandler | void (^)(NSDictionary<NSString *,id> * _Nullable result, NSError * _Nullable error) | Yes | A callback that is executed when the query completes. It receives either the search results or an error. For more information, refer to |
Return value
N/A
Sample
let keyWords = "Your keyWords"
let queryStart = 0
let querySize = 10
IAPOperationManager.searchApps(byKeywords: keyWords, queryStart: queryStart, querySize: querySize) { result, error in
}
fetchLaunchableGroupsWithCodes API
This API is called to retrieve details of mini service sections using their unique identifiers. It prioritizes locally cached data that is retrieved within the predefined timeframe. If cached data is outdated, fresh data will be fetched directly from the server.
Method signature
@interface IAPOperationManager : NSObject
+ (void)fetchLaunchableGroupsWithCodes:(NSArray<NSString *> *)codes
completionHandler:(void(^)(NSDictionary<NSString *, IAPLaunchableGroup *> * _Nullable groups, NSError * _Nullable error))completionHandler;
@end
Parameters
Parameter | Data type | Required | Description |
codes | NSArray<NSString *> *) | Yes | An array of unique codes that are assigned by Mini Program Platform to identify mini service sections. |
completionHandler | void(^)(NSDictionary<NSString *, IAPLaunchableGroup *> * _Nullable groups, NSError * _Nullable error) | Yes | A callback that is executed when the request completes. It receives either the section details or an error. For more information, refer to |
Return value
N/A
Error codes
Error code | Error message | Further action |
10100 | API is banned | Occurs due to operational misconfiguration. Please contact overseas_support@service.alibaba.com for help. |
10102 | Paramaters are invalid | Check the Parameters table to ensure all parameter types are correct and that all required parameters are specified. |
20100 | Error message varies based on the specific error. | Typically occurs when the API call is successful but the response indicates a failure (the success field is |
Sample
let codes = ["MINI_SERVICE_MAIN_PAGE"]
IAPOperationManager.fetchLaunchableGroups(withCodes: codes) { groups, error in
}
fetchLaunchableGroupsWithCodesNoCache API
This API is called to retrieve details of mini service sections using their unique identifiers. It directly fetches data from the server.
Method signature
@interface IAPOperationManager : NSObject
+ (void)fetchLaunchableGroupsWithCodesNoCache:(NSArray<NSString *> *)codes
completionHandler:(void(^)(NSDictionary<NSString *, IAPLaunchableGroup *> * _Nullable groups, NSError * _Nullable error))completionHandler
@end
Parameters
Parameter | Data type | Required | Description |
codes | NSArray<NSString *> *) | Yes | An array of unique codes that are assigned by Mini Program Platform to identify mini service sections. |
completionHandler | void(^)(NSDictionary<NSString *, IAPLaunchableGroup *> * _Nullable groups, NSError * _Nullable error) | Yes | A callback that is executed when the request completes. It receives either the section details or an error. For more information, refer to |
Return value
N/A
Error codes
Error code | Error message | Further action |
10100 | API is banned | Occurs due to operational misconfiguration. Please contact overseas_support@service.alibaba.com for help. |
10102 | Paramaters are invalid | Check the Parameters table to ensure all parameter types are correct and that all required parameters are specified. |
20100 | Error message varies based on the specific error. | Typically occurs when the API call is successful but the response indicates a failure (the success field is |
Sample
let codes = ["MINI_SERVICE_MAIN_PAGE"]
IAPOperationManager.fetchLaunchableGroups(withCodesNoCache: codes) { groups, error in
}