Installation
- Add InsForge dependencies to your project
- Maven Central
- GitHub Packages
build.gradle.kts:
- Initialize InsForge SDK
- Enable Logging (Optional)
Use
NONE or ERROR in production to avoid exposing sensitive data in logs.Android Initialization
- Add Chrome Custom Tabs dependency to your
build.gradle.kts:
- Initialize InsForge SDK (With Chrome Custom Tabs and Session Storage)
- Use Jetpack DataStore for Session Storage (Optional)
from()
Get a bucket instance for file operations.Example
upload()
Upload a file with a specific path/key.Parameters
path(String) - File path/key in the bucketdata(ByteArray) - File content as bytesoptions(DSL block, optional) - Upload options
UploadOptions
Example
Upload from Android Uri
Developers can use the following function to upload files from an Android Uri:uploadWithAutoKey()
Upload a file with auto-generated unique key.Parameters
filename(String) - Original filename (used for extension detection)data(ByteArray) - File content as bytesoptions(DSL block, optional) - Upload options
Example
download()
Download a file as ByteArray.Example
delete()
Delete a file from storage.Example
createSignedUrl()
Create a signed URL for temporary access to a file.Parameters
path(String) - File path in the bucketexpiresIn(Int) - Expiration time in seconds