Last updated:
0 purchases
flutter reach five
Flutter-ReachFive #
Installation #
Android #
Prerequisites:
In your android/app/build.gradle, update your minSdkVersion in your default config :
defaultConfig {
// others configs
minSdkVersion 21
}
copied to clipboard
In your android/app/src/main/AndroidManifest.xml, add these lines :
<manifest>
<!-- others lines... -->
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.USE_CREDENTIALS" />
</manifest>
copied to clipboard
To use the sdk in release mode, add a file android/app/proguard-rules.pro with these lines :
(Otherwise a java.lang.NullPointerException uncaught exception is thrown when initializing reachFive)
# We need to keep reachfive models from obfuscating otherwise there is
# serialization/deserialization errors when building your app in release mode
-keep class co.reachfive.identity.sdk.core.models.** {*;}
copied to clipboard
And in your android/app/build.gradle, add this line in your release buildTypes :
buildTypes {
// ...others buildTypes
release {
// ...others lines
// Add this line
proguardFiles(getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro")
}
}
copied to clipboard
iOS #
Prerequisites:
In your ios/Podfile, update your ios sdk version :
platform :ios, '13.0'
copied to clipboard
Because of an issue causing WebViewProvider session to be lost by the flutter app, you need to add this dependency override in your ios/Podfile :
target 'Runner' do
use_frameworks!
use_modular_headers!
flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__))
# Add the next line in your Podfile to use webview providers
pod 'IdentitySdkCore', :git => '[email protected]:bamlab/identity-ios-sdk.git', :tag => '6.1.0.fork'
end
copied to clipboard
Implementation login/signup with provider #
Android #
WebView Providers #
Every providers defined in your reachFive console can be accessed through a webview in your app
To use webview providers, you need to make the following changes (according to this doc)
You will need to add a callbackUrl, to your android and reachFive config
The url will have this form : {YOUR_SCHEME}://{YOUR_HOST}{YOUR_PATH_PREFIX}
This url must match the one given in your SdkConfig androidScheme
You must give this url in your SdkConfig androidScheme when initializing your reachFive instance
You need to add this url in the list of authorized callback URL in your reachFive console client
This url must match the scheme you give in the reachFive instance initialization
In your android/app/src/main/AndroidManifest.xml, add these lines :
<manifest>
<!-- others lines... -->
<activity
android:name="co.reachfive.identity.sdk.core.RedirectionActivity"
android:screenOrientation="portrait"
android:exported="true">
<intent-filter android:autoVerify="true">
<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_SCHEME}"
android:host="{YOUR_HOST}"
android:pathPrefix="{YOUR_PATH_PREFIX}" />
</intent-filter>
</activity>
</manifest>
copied to clipboard
Google Native Provider #
To configure the google native provider, you need to give the google provider creator in the ReachFiveManager initialization method and you need to follow these docs :
Android
Facebook Native Provider #
To configure the facebook native provider, you need to give the facebook provider creator in the ReachFiveManager initialization method and you need to follow these docs :
Android
iOS #
WebView Providers #
Every providers defined in your reachFive console can be accessed through a webview in your app
To use webview providers, you need to make the following changes (according to this doc)
You will need to add a callbackUrlScheme, to your ios config
The scheme will have this form : reachfive-{YOUR_CLIENTID}
You must give the iosScheme reachfive-{YOUR_CLIENTID}://callback in your SdkConfig iosScheme when initializing your reachFive instance
You need to add this url in the list of authorized callback URL in your reachFive console client
In your ios/Runner/Info.plist, add these lines :
<key>CFBundleURLTypes</key>
<array>
<dict>
<key>CFBundleTypeRole</key>
<string>Editor</string>
<key>CFBundleURLSchemes</key>
<array>
<string>reachfive-{YOUR_CLIENTID}</string>
<!-- Add your others reachfive client ids here if you wat multiple instances -->
<!-- <string>reachfive-{YOUR_OTHER_CLIENT_ID}</string> -->
</array>
</dict>
</array>
copied to clipboard
Google Native Provider #
To configure the google native provider, you need to give the google provider creator in the ReachFiveManager initialization method and you need to follow these docs :
iOS
Facebook Native Provider #
To configure the facebook native provider, you need to give the facebook provider creator in the ReachFiveManager initialization method and you need to follow these docs :
iOS
About ReachFive #
This sdk is the flutter interface implementation of the android and ios sdks of ReachFive
If you want more informations about ReachFive, here is their website
👉 About Bam #
We are a 100 people company developing and designing multiplatform applications with React Native and Flutter using the Lean & Agile methodology. To get more information on the solutions that would suit your needs, feel free to get in touch by email or through contact form!
We will always answer you with pleasure 😁
For personal and professional use. You cannot resell or redistribute these repositories in their original state.
There are no reviews.