Some Mini Program APIs, such as those for location, camera, and photo album access, require user authorization. The system prompts for permission before the API can be executed.
The Mini Program container supports the following extensions for API calls:
Customize prompt text and display styles.
Read and write permission configurations.
This extension is available only if Mini Program access control is enabled in the mPaaS console.
Permission configuration
The following table lists the default keys and their corresponding APIs for Mini Programs.
Permission | key | API |
Camera | camera | scan, chooseImage, chooseVideo |
Photo Album | album | saveImage, saveVideosToPhotosAlbum |
Location | location | getLocation, getCurrentLocation |
You can retrieve a dictionary of permissions that the current Mini Program has requested.

Custom display
mPaaS lets you customize the display of the permission pop-up. You can use the interface shown in the following image to configure the pop-up.

Follow these steps:
After the container is initialized, specify the delegate for the custom permission pop-up.
- (void)application:(UIApplication *)application afterDidFinishLaunchingWithOptions:(NSDictionary *)launchOptions { ... // Mini Program API access control [TAAuthorizeStorageManager shareInstance].authorizeAlertDelegate = self; ... }Implement the custom pop-up method.
#pragma mark Mini Program API access control - (void)showAlertWithTitle:(NSString *)title appName:(NSString *)appName storageKey:(NSString *)storageKey callback:(void (^)(NSInteger index))callback { if ([title length] > 0) { UIAlertView *alert = [[UIAlertView alloc] initWithTitle:title message:nil delegate:self cancelButtonTitle:@"Cancel" otherButtonTitles:@"OK", nil]; self.callback = callback; [alert show]; } } - (void)alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)buttonIndex { if (self.callback) { if (buttonIndex == alertView.cancelButtonIndex) { // The user denies authorization. The callback parameter is 0. self.callback(0); }else{ // The user grants authorization. The callback parameter is 1. self.callback(1); } } }