React.Native
For the App to App
flow to work properly, a correct deep link configuration is required. That means
- for Android:
Android App Links
are required: https://developer.android.com/training/app-links - for iOS:
Universal Links
are required: https://developer.apple.com/ios/universal-links/
Pure React Native
This example does not use any special library, but expects the IDP selection screen to be implemented in the app.
It implements the App to App
flow as specified by gematik in https://wiki.gematik.de/display/IDPKB/App-App+Flow.
Source: https://github.com/azuma-healthtech-public/mimoto-examples/tree/main/react-native-ce
See Android example for the overall explanation and required configuration.
App-Auth with 'native code' exchange
This example uses https://github.com/FormidableLabs/react-native-app-auth and implements the App to App
flow as specified by gematik in https://wiki.gematik.de/display/IDPKB/App-App+Flow.
Source: https://github.com/azuma-healthtech-public/mimoto-examples/tree/main/react-native-app-auth-ce
See Android example for the overall explanation and required configuration.
Code
- Request + token response + configuration: see handleAuthorize in https://github.com/azuma-healthtech-public/mimoto-examples/blob/main/react-native-app-auth-ce/App.tsx
- Code exchange: see https://github.com/azuma-healthtech-public/mimoto-examples/blob/main/react-native-app-auth-ce/android/app/src/main/java/com/appauthcodeexchange/tasks/ExchangeCodesTask.java.
This example uses a custom Android Activity for code exchange. React.Native experts most likely will find a better solution.