Flutter – Sign in with Device
Cotter's Passwordless SDK authenticates your user based on their device. It allows a seamless, fast, and secure way for your user to login to your React Native App.
Last updated
Cotter's Passwordless SDK authenticates your user based on their device. It allows a seamless, fast, and secure way for your user to login to your React Native App.
Last updated
In this guide we'll allow users to Sign In with Device using Cotter's SDK.
Add to your pubspec.yaml
, then run flutter pub get
. You may need to restart your flutter for it to run pod install (stop flutter run and re run it).
For Android: Update minSdkVersion
to 18
.
Import Cotter in your lib/main.dart
, then initialize it inside HomePageState
.
Simply call the signUp
and login
functions from your login page, and you can allow your users to Sign In with Device with just 1 tap.
1. Approve login requests from a non-trusted device
You can to get your API_KEY_ID
.
Sign Up: Call cotter.signUpWithDevice
and input the user's email, phone, or username. This will create a new user in Cotter and trust the current device to allow logins. This function returns a .
Sign In: Call cotter.signInWithDevice
. If the user is logging-in , they'll automatically be approved. This function returns an .
Make sure you allow Trusted Devices Method in the .