Including a native SDK (for IOS and Android) into flutter - swift

i am currently facing the following problem and I hope someone can help me out:
I want to write an app in Flutter (yes I already compared this framework to others like React Native and Ionic) but i need to include the motiontag SDK and here is where the problem starts.
The Motion Tag SDK is only available for native App descreptive native programming language (Java/Kotlin, Swift).
Is there a way to include the SDK anyway to flutter??
Like some workaround!
Thanks for helping me out!

Flutter does have communication with native via Platform Channels, so if the sdk is just function calls you could call the function from flutter/dart , and then let the platform channel handle the call to the native function with arguments. If the sdk it's about rendering UI inside flutter then it's more complicated but it's possible as long as you use the boundaries of PlatformView . All the native plugins developed for flutter use this two methods to handle native code/UI

Related

How can I access device information without using packages in Flutter?

How can I access device information without using packages in Flutter? How can I get the information of the device where the app is installed in my Flutter app?
First, you'd be better off using packages. But if you really want/need to do it, you'd have to write platform-specific code code in the native language of the targeted platform (ie. Swift or Objective-C for iOS/Mac, Kotlin or Java for Android, etc), then use so-called platform channels to pass messages between your app and the platform-specific code.
If you'd like to get details about the device, on iOS you'd use UIDevice, on Android you'd typically want Build.
This can only be done through Method Channel

Flutter IOS & ANDROID Widgets Implementation

I wanted to ask about the implementation of IOS & Android Widgets for Flutter.
Current Scenario :
Basically, i have developed the app on android platform and now i want to convert it to IOS platform. Since this is my first app, i really need some experienced voice on some issues i am facing.
Questions :
1 - Is there any simple way to detect that the widgets currently used are of Android/IOS Platform ?
How can we know for sure that a specific widget is of Android platform and is not going to work on IOS platform and vice versa.
2 - If somehow we know for sure that the current widget we are using is of Android platform, then how can we find its equivalent widget to implement for IOS platform.
3 - Are these widgets specifically required when we are going to upload/publish to these platforms respective stores. For example in a scenario where i hadn't converted all of my android app widgets to ios widgets and when i try to publish the app for IOS store, does the IOS Store rejects that or not?
Any suggestions or help is greatly appreciated.
All standard widgets will work on iOS as is. Flutter paints the UI, rather than call the native APIs. You might use a plugin that does not support iOS, but I have not yet come across such a plugin on pub.dev.
If you want to write platform specific code, you can import dart:io and use the boolean Platform.isIOS or Platform.isAndroid.
Both the App Store and Play Store have specific requirements before your app is approved.
In case you really want to have Android specific widgets on Android devices and iOS specific widgets on iOS devices, then use the Flutter Platform Widgets package. This will exactly do that - drawing iOS buttons using the Cupertino library and Android buttons using the Android library (and most other widgets as well).
As #Mudassir mentioned in the other comment this is not a requirement. In case you go with the default widgets, you will have the same look on all devices (even web, Windows, etc.).

React native and flutter bridging

I want to invoke flutter module from react native app, does anyone know how can it be achieved? I was thinking I could call native android function from react native and then invoke flutter module from their. However I am not sure of the recommended practice
I don't think it's that easy, because Flutter is from Google and ReactNative is from Facebook, as I'm sure you know. Also, ReactNative uses JavaScript and Flutter uses Dart as its programming language.
It may work somehow, but I highly doubt it.

Does Ionic compile the Code to Native?

I've searched some times here but could't find an Answer to this.
Does someone know this and can explain how Ionic handles it?
Does Ionic compile the Code to Native? NO
Ionic is for developing Hybrid apps.
What are Hybrid apps?
Hybrid apps are essentially websites embedded in a mobile app through
what we call a webview. They are developed using HTML5, CSS, and
Javascript, and execute the same code regardless of the platform in
which they run. They can, with tools like PhoneGap and Cordova, use
the native features of a device, like GPS or camera.
What are Native apps?
Native apps are developed in the language required by the platform it
targets, Objective-C or Swift for iOS, Java for Android, etc. The code
written is not shared across platforms and their behavior varies. They
have direct access to all features offered by the platform without any
restriction.
Here is a nice article about it.
Cordova converts the project into a native which has only ONE Page, that is a WebView (WKV WEB View in iOS, etc). And all of the ionic code is run on that webview. Basically an ionic/cordova app is a website which looks like an app!

Can you add platform specific code in PhoneGap?

If I have an application build using PhoneGap is it possible to add to it platform specific code?
For instance, for an iOS version I would like to add Heatma.ps SDK.
Heatma.ps SDK is an iOS specific static library written in Objective-c.
yes you can add as much platform specific code as you want. Phonegap is just for the interaction of the platform specific code and the javascript. Its the plugin mechanism that makes Phonegap what it is. Even if you have a native app, you can add a bit of Phonegap in it by having a page somewhere which is basically a webview and is manipulated by js. Phonegap is what launches and manages the interactions of the js and the native part of the app.