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
@@ -160,12 +160,17 @@ Add to `android/app/src/main/AndroidManifest.xml`:
160
160
</activity>
161
161
```
162
162
163
+
Notes:
164
+
- The `android:label` attribute on the `<intent-filter>` is optional. You can omit it or set any string.
165
+
- On Android 12+ (API level 31+), any Activity with an `intent-filter` must declare `android:exported="true"`.
166
+
- Use the same callback scheme string on both platforms: iOS (`CFBundleURLSchemes`) and Android (`<data android:scheme="...">`). They must match exactly.
167
+
163
168
#### Differences in MiAuth and OAuth Configuration (Key Points for App Integration)
164
169
- This configuration (registration of the URL scheme) is done on the "app side." It is not included in the library's Manifest.
165
170
- Both methods require a "custom URL scheme" to return from an external browser to the app.
166
171
- The difference lies in how to specify "where to return from the browser."
167
172
- OAuth: Since it needs to return to an HTTPS `redirect_uri` from the authorization server, `redirect.html` placed there ultimately redirects back to `yourscheme://...` for the app.
168
-
- MiAuth: The `callback` query of the authentication start URL specifies `yourscheme://...` from the beginning (no need for`https`).
173
+
- MiAuth: The `callback` query of the authentication start URL points to the app via the custom scheme only (e.g., `yourscheme://`). No`https` is needed.
169
174
170
175
##### Example of MiAuth (no persistence)
171
176
@@ -180,7 +185,7 @@ final miConfig = MisskeyMiAuthConfig(
final miRes = await miClient.authenticate(miConfig); // returns token only
188
+
final miRes = await miClient.authenticate(miConfig); // returns token (and user if available)
184
189
```
185
190
186
191
##### Example of MiAuth (with persistence via MisskeyAuthManager)
@@ -241,12 +246,12 @@ final current = await auth.currentToken();
241
246
242
247
##### How to Support Both Methods in the Same App
243
248
- By registering the same `scheme` (e.g., `yourscheme`) in iOS's `Info.plist` and Android's `AndroidManifest.xml`, it can be shared between OAuth and MiAuth.
244
-
-If you implement the OAuth `redirect.html` to redirect to`yourscheme://oauth/callback?...`, you can reuse the same path expression (`yourscheme://oauth/callback`) for MiAuth's `callback`.
249
+
-This library uses a scheme-only callback for MiAuth (e.g.,`yourscheme://`). You do not need to reuse a path like `yourscheme://oauth/callback` for MiAuth.
245
250
- For Android, matching only on the `scheme` is sufficient as shown below (the `host` and `path` are optional).
0 commit comments