Skip to content
This repository has been archived by the owner on Feb 22, 2023. It is now read-only.

[local_auth] Update README for Android Integration #3348

Merged
merged 4 commits into from
Dec 18, 2020
Merged
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
6 changes: 5 additions & 1 deletion packages/local_auth/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 1.0.0-nullsafety.1

* Update README for Android Integration.

## 1.0.0-nullsafety

* Migrate to null safety.
Expand Down Expand Up @@ -182,4 +186,4 @@

## 0.0.1

* Initial release of local authentication plugin.
* Initial release of local authentication plugin.
38 changes: 37 additions & 1 deletion packages/local_auth/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,42 @@ opposed to Activity. This can be easily done by switching to use
`FlutterFragmentActivity` as opposed to `FlutterActivity` in your
manifest (or your own Activity class if you are extending the base class).

Update your MainActivity.java:

```java
import android.os.Bundle;
import io.flutter.app.FlutterFragmentActivity;
import io.flutter.plugins.flutter_plugin_android_lifecycle.FlutterAndroidLifecyclePlugin;
import io.flutter.plugins.localauth.LocalAuthPlugin;

public class MainActivity extends FlutterFragmentActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
FlutterAndroidLifecyclePlugin.registerWith(
registrarFor(
"io.flutter.plugins.flutter_plugin_android_lifecycle.FlutterAndroidLifecyclePlugin"));
LocalAuthPlugin.registerWith(registrarFor("io.flutter.plugins.localauth.LocalAuthPlugin"));
}
}
```

OR

Update your MainActivity.kt:

```kotlin
import io.flutter.embedding.android.FlutterFragmentActivity
import io.flutter.embedding.engine.FlutterEngine
import io.flutter.plugins.GeneratedPluginRegistrant

class MainActivity: FlutterFragmentActivity() {
override fun configureFlutterEngine(flutterEngine: FlutterEngine) {
GeneratedPluginRegistrant.registerWith(flutterEngine)
}
}
```

Update your project's `AndroidManifest.xml` file to include the
`USE_FINGERPRINT` permissions:

Expand Down Expand Up @@ -172,4 +208,4 @@ app resumes.
For help getting started with Flutter, view our online
[documentation](http://flutter.io/).

For help on editing plugin code, view the [documentation](https://flutter.io/platform-plugins/#edit-code).
For help on editing plugin code, view the [documentation](https://flutter.io/platform-plugins/#edit-code).
2 changes: 1 addition & 1 deletion packages/local_auth/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: local_auth
description: Flutter plugin for Android and iOS device authentication sensors
such as Fingerprint Reader and Touch ID.
homepage: https://github.com/flutter/plugins/tree/master/packages/local_auth
version: 1.0.0-nullsafety
version: 1.0.0-nullsafety.1

flutter:
plugin:
Expand Down