Follow this guide to integrate Portal into your Flutter App.
MethodChannel
enables sending messages that correspond to method calls. On the platform side, MethodChannel
on Android (MethodChannelAndroid) enable receiving method calls and sending back a result. These classes allow you to develop a platform plugin with very little ‘boilerplate’ code.
You can check the Flutter official documentation for platform channels.\
You can check our Portal Flutter example.
Portal Android SDK
to the Android project, you can follow this Android setup guide.MainActivity.kt
located under android > app > src > main > kotlin in the project navigation.your.bundle.identifier/portal
. Below the channel name and some method names are defined.
MainActivity.kt
, configure channel and methods handling like this.
FlutterResult
which is expected to be passed from Flutter side as a completion handler.
You will also need to define this implementation in your native iOS code as well for the code to work on both iOS and Android. Refer to this guide for iOS specific instructions.
MethodChannel
String
identifier initializePortal
. The call might fail, so wrap the invokeMethod
call in a try-catch statement.
initializePortal
to initialize portal is ready to be called. You can call it from Flutter side passing the apiKey to initialize Portal.