Android App Development
iOS App Development
Flutter App Development
Cross Platform App Development
Hire on-demand project developers and turn your idea into working reality.
Big thanks to Webkul and his team for helping get Opencart 3.0.3.7 release ready!
Deniel Kerr
Founder. Opencart
Top Partners
Flutter provides different dependencies for achieving different features in your Flutter app. But there are some libraries that might not be available in Flutter or might not be as good as native SDKs. So, we Integrate native SDKs in Flutter project.
Today, I am going to integrate the native iOS SDK “Folio Reader kit” in a flutter project using the method channel. There are different libraries available in flutter for opening an epub file but this one fits my requirement.
You can also read more about Flutter app development services from Mobikul.
Now, let’s check how can we integrate native SDK in a Flutter project.
Create a new flutter project & add a button on the screen.
Now we are going to use Platform Channel to communicate between UI & platform.
A platform channel is a flexible messaging API between a Flutter app and the platform hosting the app. It’s how you can communicate with native and 3rd-party APIs.
From the official doc: “Messages are passed between the client (UI) and host (platform) using platform channels.“
Define a channel name on the dart side:
Invoke the channel when required, i.e on the tap of the button.
We have added an ebook for extension .epub in our flutter project assets. Now, we will pass this ebook path in our method as an argument & will use this on our iOS side.
Add iOS-specific Implementation:
Add folio reader SDK pod in your pod file & run the command “pod install”. You can get this SDK from this git link: https://github.com/FolioReader/FolioReaderKit
Now add this code to your App Delegate & import Folio Reader Kit.
We have fetched the path of the asset in swift & used it to open our book using the Folioreader Kit in FlutterView Controller & present our reader screen.
In this article, I have explained how to integrate native SDKs in flutter project.
Thanks for reading this article ❤
If I got something wrong 🙈, let me know in the comments. I would love to improve.
For more interesting blogs check out here – https://mobikul.com/blog/
Your email address will not be published. Required fields are marked*
Name*
Email*
Save my name email and website in this browser for the next time I comment.
We use cookies to personalize your experience. By continuing to visit this website you agree to our use of cookies. Learn more about privacy policy
Name
Email
Subject
Enquiry or Requirement
If you have more details or questions, you can reply to the received confirmation email.