Skip to content

Commit

Permalink
Published 1.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
ThexXTURBOXx committed Aug 20, 2022
1 parent 4dfe274 commit 330ab0b
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 24 deletions.
29 changes: 14 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -88,18 +88,18 @@ In order to capture the callback url, the following `activity` needs to be added

```xml
<manifest>
<application>

<activity android:name="com.linusu.flutter_web_auth_2.CallbackActivity" >
<intent-filter android:label="flutter_web_auth_2">
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data android:scheme="YOUR_CALLBACK_URL_SCHEME_HERE" />
</intent-filter>
</activity>

</application>
<application>

<activity android:name="com.linusu.flutter_web_auth_2.CallbackActivity" >
<intent-filter android:label="flutter_web_auth_2">
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data android:scheme="YOUR_CALLBACK_URL_SCHEME_HERE" />
</intent-filter>
</activity>

</application>
</manifest>
```

Expand All @@ -110,9 +110,8 @@ On the Web platform an endpoint needs to be created that captures the callback U
```html
<!DOCTYPE html>
<title>Authentication complete</title>
<p>Authentication is complete. If this does not happen automatically, please
close the window.
<script>
<p>Authentication is complete. If this does not happen automatically, please close the window.
<script>
window.opener.postMessage({
'flutter-web-auth-2': window.location.href
}, window.location.origin);
Expand Down
11 changes: 9 additions & 2 deletions flutter_web_auth_2/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,14 @@ final response = await http.post('https://www.googleapis.com/oauth2/v4/token', b
final accessToken = jsonDecode(response.body)['access_token'] as String;
```

## Upgrading from `flutter_web_auth`

If you used `flutter_web_auth` correctly (and without extra hackage) before, it should be sufficient to replace the following strings *everywhere* (yes, also in `AndroidManifest.xml` for example):
- `FlutterWebAuth` -> `FlutterWebAuth2`
- `flutter_web_auth` -> `flutter_web_auth_2`

If you are still unsure or something is not working as well as before, please [open a new issue]().

## Setup

Setup works as for any Flutter plugin, expect the Android and Web caveats outlined below:
Expand Down Expand Up @@ -102,8 +110,7 @@ On the Web platform an endpoint needs to be created that captures the callback U
```html
<!DOCTYPE html>
<title>Authentication complete</title>
<p>Authentication is complete. If this does not happen automatically, please
close the window.
<p>Authentication is complete. If this does not happen automatically, please close the window.
<script>
window.opener.postMessage({
'flutter-web-auth-2': window.location.href
Expand Down
6 changes: 2 additions & 4 deletions flutter_web_auth_2/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,8 @@ environment:
dependencies:
flutter:
sdk: flutter
flutter_web_auth_2_platform_interface: #TODO: when published: ^1.0.0
path: ../flutter_web_auth_2_platform_interface
flutter_web_auth_2_windows: #TODO: when published: ^1.0.0
path: ../flutter_web_auth_2_windows
flutter_web_auth_2_platform_interface: ^1.0.0
flutter_web_auth_2_windows: ^1.0.0
flutter_web_plugins:
sdk: flutter

Expand Down
2 changes: 1 addition & 1 deletion flutter_web_auth_2_windows/README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# flutter_web_auth_2_windows

Windows implementation for the `flutter_web_auth_2` package.
Windows implementation of the flutter_web_auth_2 plugin platform interface.

## [See here for flutter_web_auth_2](https://pub.dev/packages/flutter_web_auth_2)
3 changes: 1 addition & 2 deletions flutter_web_auth_2_windows/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,7 @@ dependencies:
ffi: ^2.0.1
flutter:
sdk: flutter
flutter_web_auth_2_platform_interface: #TODO: when published: ^1.0.0
path: ../flutter_web_auth_2_platform_interface
flutter_web_auth_2_platform_interface: ^1.0.0
url_launcher: ^6.1.5
win32: ^2.7.0

Expand Down

0 comments on commit 330ab0b

Please sign in to comment.