Accept MitID, NemID, Swedish BankID, Norwegian BankID and more logins in your Expo (React-Native) app
npm install @criipto/verify-expoAccept MitID, NemID, Swedish BankID, Norwegian BankID and more logins in your Expo (React-Native) app with @criipto/verify-expo.
@criipto/verify-expo supports app switching for Swedish BankID and Danish MitID.
Switchback from the Danish MitID mobile application will only work if you are using a universal link / app link as your redirect_uri.
Enable switchback on android by adding the following to your app.json:
```
"plugins": [
["@criipto/verify-expo", {
"androidAppLinks": [
"https://..."
]
}]
]
#### Expo Go
Danish MitID on Android will not work with Expo Go due to the use of createTask: false. You must use a build to test, for instance with npx expo run:android
Using npm
`sh`
npm install @criipto/verify-expo
Setup the Criipto Verify SDK by wrapping your application in CriiptoVerifyProvider:
`jsx
// src/App.jsx
import { StyleSheet, Text, View, Button } from 'react-native';
import {CriiptoVerifyProvider, useCriiptoVerify} from '@criipto/verify-expo';
import LoginButton from './LoginButton.jsx';
export default function App() {
return (
clientID="{YOUR_CRIIPTO_APPLICATION_CLIENT_ID}"
>
);
}
// src/LoginButton.jsx
export default function LoginButton() {
const {login, claims, error} = useCriiptoVerify();
const handlePress = async (acrValues) => {
// The generated redirectUri must be registered as an allowed URL on your application via the Criipto Dashboard.
// Use a https:// universal/app link if you wish to support appswitch with Danish MitID
const redirectUri = Linking.createURL('/auth/criipto');
const result = await login(acrValues, redirectUri);
};
return (
<>
{error ? (
) : null}
{claims ? (
) : null}
>
)
}
`
`sh
#in root
npm link
#in example
npm link @criipto/verify-expo
npm start
``
Learn more about Criipto and sign up for your free developer account at criipto.com.