Configuration
Configure your project
The following steps describe how to configure our native Android and iOS SDKs for your Flutter project.
Android
- Modify
android/app/build.gradle
1.1. Add to android section:
1.2. Add to android -> defaultConfig section:
- Add to
android/app/proguard-rules.pro
- Add to
android/build.gradle [allprojects.repositories]
- Setup the Onegini config: Generate a
OneginiConfigModel
andkeystore.bks
with SDK Configurator.
More information HERE, section: Running the SDK Configurator.
- Setup the
SecurityController
( not required).
In order to change security options you should create your own instance of SecurityController and handle it to the plugin. By default security options brought from com.onegini.mobile.SecurityController.
More information HERE, section: SecurityController.
- In your
MainActivity
class, in theonCreate()
method you must addOneginiConfigModel
andSecurityController
.
- OneWelcome plugin uses deep links for communication between WEB pages and your app.
Modify android/app/src/main/AndroidManifest.xml
. Add <intent-filter>
to your MainActivity
(pic.3) for listening browser redirects. scheme="oneginiexample"
should be changed to your from OneginiConfigModel
(will be provided by onegini-sdk-configurator)
IOS
- The OneWelcome plugin is uploaded to the OneWelcome Artifactory repository. In order to let CocoaPods use an Artifactory repository you need to install a specific plugin.
gem install cocoapods-art
- The OneWelcome repository is not a public repository. You must provide credentials in order to access the repo. Create a file named
.netrc
in your Home folder (~/) and add the following contents to it:
- Replace the and with the credentials that you use to login to <support.onegini.com>.
- The Onegini CocoaPods repository must be added to your local machine using the following command:
pod repo-art add onegini htps://repo.onewelcome.com/artifactory/api/pods/cocoapods-public
- In order to update the Repository you must manually perform an update:
pod repo-art add onegini https://repo.onewelcome.com/artifactory/api/pods/cocoapods-public
- Add next to ios/Podfile (before app target):
- Run
pod install
- Add
SecurityController.h
andSecurityController.m
as described HERE to native's part of code.
Linking Native Code
For iOS we require an additional step to link native code in the xCode project.
IOS >= 12.0
Run this command in your project main folder: cd ios && pod install