Guides & References
Before You Start
Adding the Configuration File
AppGallery Connect provides a configuration file that stores app configurations to simplify the configuration procedure. You must add the configuration file to your project and integrate the AppGallery Connect plugin. The plugin can automatically load your app information in AppGallery Connect to your development environment.
Verify the default_storage setting under service > cloudstorage in the agconnect-services.json file.
If default_storage is not set, the Cloud Storage SDK will fail to be initialized. In this case, set this attribute to the storage instance name on the Build > Cloud Storage page.
Please download your latest config file from AGC and import it into the Assets/StreamingAssets folder. (It will change after you enable cloud storage)
Modifying the AndroidManifest File
To read and write files and access the Internet, configure the following permissions in the AndroidManifest.xml file:
If your app is integrated with the SDK for Android (API level 29 or higher), also add the following attributes to the application in AndroidManifest.xml to gain permission to access external files:
Security Rules
examples:
Attributes
The request and resource objects can help security rules obtain more request contexts for more proper control.
The following table lists all attributes in the request object.
Attribute | Type | Description |
---|---|---|
request.auth.uid | String | Unique ID obtained by a user after the user passes the authentication. |
request.path | String | Storage path of the requested resource. |
request.time | String | Server time of the request. |
request.resource | Mapping <string, string> | Information about a new file resource, which is the same as the resource object information and exists only when the write request is executed. |
The following table lists all attributes in the resource object.
Attribute | Type | Description |
---|---|---|
resource.name | String | Resource file name. |
resource.bucket | String | Storage instance name of a resource file. |
resource.contentType | String | Resource file type. |
resource.contentDisposition | String | Method of disposing of a resource file. |
resource.contentEncoding | String | Method of encoding a resource file. |
resource.contentLanguage | String | Resource file language. |
resource.size | String | Resource file size. |
resource.metadata | Mapping <string, string> | User-defined metadata of a resource file, which is in a map structure in the format of <key, value>. |
Last updated