Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

storage(android): Update The TransferUtility docs with new requirements for API 34 #7853

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion src/fragments/sdk/storage/android/getting-started.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,13 @@ Use the following steps to connect add file storage backend services to your app

```xml
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<service android:name="com.amazonaws.mobileconnectors.s3.transferutility.TransferService" android:enabled="true" />
<!-- For apps targeting API Level 28 and above: -->
<uses-permission android:name="android.permission.FOREGROUND_SERVICE"/>
<!-- For apps targeting API Level 34 and above: -->
<uses-permission android:name="android.permission.FOREGROUND_SERVICE_DATA_SYNC"/>


<service android:name="com.amazonaws.mobileconnectors.s3.transferutility.TransferService" android:foregroundServiceType="dataSync" />
```

3. **For Android Q (API 29)**: API 29 enforces scoped storage access for Android apps. To gain access to legacy external storage, enable the following application property inside `AndroidManifest.xml`:
Expand Down
15 changes: 15 additions & 0 deletions src/fragments/sdk/storage/android/transfer-utility.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -372,6 +372,21 @@ tsIntent.putExtra(TransferService.INTENT_KEY_REMOVE_NOTIFICATION, <remove-notifi
getApplicationContext().startForegroundService(tsIntent);
```

## Supporting TransferService on Upside Down Cake and above

Starting in Android Upside Down Cake (API Level 34), foreground services must supply a service type. Starting with version `2.76.1`, if `TransferService` is moved into the foreground it will specify the type `FOREGROUND_SERVICE_TYPE_DATA_SYNC`. The application must declare some additional permissions and details in `AndroidManifest.xml`.

```xml
<!-- Request permissions for foreground data sync service -->
<uses-permission android:name="android.permission.FOREGROUND_SERVICE"/>
<uses-permission android:name="android.permission.FOREGROUND_SERVICE_DATA_SYNC"/>

<!-- Update the service tag to specify the service type -->
<service
android:name="com.amazonaws.mobileconnectors.s3.transferutility.TransferService"
android:foregroundServiceType="dataSync" />
```

## Supporting Unicode characters in key-names

**Upload/download objects**
Expand Down
Loading