You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/get-started/get-started.md
+57Lines changed: 57 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -244,6 +244,8 @@ To do that the QuickEditor needs an authorization token to perform requests on b
244
244
245
245
### 1. Let the Quick Editor handle the OAuth flow
246
246
247
+
#### 1.1 Using you own activity with `android:launchMode="singleTask"` (Recommended)
248
+
247
249
Quick Editor can handle the heavy lifting of running the full OAuth flow, so you don't have to do that. We will still need a few things from you.
248
250
First, you have to go to [OAuth docs](https://docs.gravatar.com/oauth/) and create your Application. Define the `Redirect URLs`.
249
251
@@ -311,6 +313,61 @@ When the user logs out form the app, make sure to run:
311
313
GravatarQuickEditor.logout(Email("{USER_EMAIL}"))
312
314
```
313
315
316
+
#### 1.2 Using the provided activity
317
+
318
+
If using an activity with `android:launchMode="singleTask"` is not an option, you can use the provided activity. With this option, you don't need to modify how your activities are set up.
319
+
320
+
You need to add the provided activity to your `AndroidManifest.xml`:
_Note the important difference here: the `tools:node="merge"` attribute. This is necessary to merge the intent filter with the one defined in the library._
343
+
344
+
The `GravatarQuickEditorActivity` defines an Activity Result contract that you can use to launch the Quick Editor and handle the result. Here's an example of how you can use it:
It's important to note that using the `GravatarQuickEditorActivity` you'll only receive the result of the Quick Editor when it's dismissed not instantly as with using the `@Composable` component from your `singleTask` activity (see [Section 1.1](#11-using-you-own-activity-with-androidlaunchmodesingletask-recommended)).
368
+
369
+
In the `demo-app` you can find a detailed implementation showing how to use the provided activity. See `QuickEditorTestActivity`.
370
+
314
371
#### Exclude Data Store files from Android backup (optional, but recommended)
315
372
316
373
Data Store files are subject to Android backups. Encrypted files from the backup won't work when restored on a different device so we have to exclude those files.
0 commit comments