Can you use Swift with React Native - swift

Does anyone know if it’s possible to develop a fully Native iOS and Android based Social Media Platform using React Native and Swift or Objective C to integrate a native instant messenger app into the newsfeed via a floating icon?
Our website is responsive and would make a great hybrid app using a native wrap but we are looking to stray away from web based solutions and want to try and build a fully native solution with React Native and possible Swift or Objective C. We discovered a decent IM sdk that is feature rich but is written in Objective C and Swift and wish to use this Instant Messaging Solution and attempt to match chat graphics with the rest of the app.
All thoughts, ideas and solutions are appreciated.

You can write code in Objective-C/Swift or Java for developing your own modules and to take advantage of native API for iOS or Android. But React-Native has some build-on modules that would simplify your workd just by writing JavaScript and that the magic of React-Native. It makes possible to build Apps in JavaScript that use real native elements and not just WebViews.
If you need to write your own modules in Objective-C/Swift or Java you should make use of the Bridge that implements React-Native for sharing data between Native-Code and Javascript code.
"Sometimes an app needs to access a platform API and React Native doesn't have a corresponding module yet. Maybe you want to reuse some existing Objective-C, Swift or C++ code without having to reimplement it in JavaScript, or write some high performance, multi-threaded code such as for image processing, a database, or any number of advanced extensions." from React-Native oficial website

Related

Iconic's ability to support complex web applications

Ionic was built with mobile in mind - creating a good mobile experience using web technologies. You start out with a web app, so there is the possibility to use it for all 3 platforms. However I’ve never seen anything that resembles a complex web application that uses iconic for both the web and mobile. Will it support the ability to use 3rd party controls such as complex grid controls that may only be used on the web and not in the mobile apps. I’m trying to decide if we use ionic just for mobile and have a completely separate code base for our web application. Any invites would be greatly appreciated!
Basically everything that works on the web also works on mobile devices built with Ionic.
Ionic creates a WebView where javascript code runs. you can use capacitor or cordova to manage native functionality.
So if you have web developers you can do anything you could do as "Mobile Web" but in an app.
Now you can also choose whether to use react, angular or vue.
For example using Ionic with react you can use the VirtualDom and develop exactly as if you were using react on the web.
Instead, using for example React Native you will be forced to use a set of react components (or write new ones) but you will not have the VirtualDom available.
However you can also integrate native code, which Ionic doesn't support.
There are a lot of articles online that cover the subject by comparing competitors:
From Ionic
So yes, you can use all javascript libraries!

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!

How to make shared logic usable for cross-platform native apps?

So I am currently using Xamarin for multi-platform mobile applications. I really like the way this works, and I want to improve my flow. My developers have said that they would be much faster when programming natively (i.e. Swift for iOS in XCode).
I have looked for a solution, where I can create a shared project and use it in native apps, but I have only found ways that involve programming in one language for all platforms.
Is there a way to create a shared project, which can be imported into a native application (or better, can be run together, like a shared project in Xamarin)?
The language for the shared code is not important, as long as it isn't slow.
My developers have said that they would be much faster when programming natively (i.e. Swift for iOS in XCode)
Swift can be used natively for iOS apps. RemObjects' Silver is supposed to make Swift ready for Android and .NET. I've never tested it. Try it out, it's free.
RoboVM can be used to write iOS apps in Java. I didn't try it out either.
Language mixing with Xamarin
In case you want to mix Swift code with C# code using Xamarin then you can bind Objective-C compatible Swift code and use it in iOS projects only. You are not able to execute Swift code on Android or Windows Phone! It's not possible to write platform independent business logic in Swift and and use it in a shared library or PCL with Xamarin.
You face the same restrictions for Java code on Android: You can bind JARs and use them in a Xamarin.Android project but you cannot use them on iOS or Windows Phone.
You are also unable to execute C# code in a Swift based app on iOS or in a Java based app on Android.
You can use native code in Xamarin apps via Binding Libraries. You cannot use Xamarin libraries in native apps.
If the goal is to use truly native tooling, in their standard languages (meaning not Xamarin) and still share code between iOS and Android, this can be achieved by writing your non-UI code in C++.
Here's a very interesting article about how Dropbox does exactly this.
C++ is natively supported on iOS and it is very easy to interface
between Objective-C and C++ using Objective-C++.
On Android, calling into C++ can be done through the NDK, which
reportedly is not a pleasure to use. Dropbox found Google’s meta-build
system gyp to work reasonably well. In addition, the Java Native
Interface is a pain you have to accept. But none of these issues is a
roadblock, and Steven expressed hope that Google or the community will
build better tooling support over time.
And here's a simple example of how to do this from another StackOverflow post

Is Titanium's HTML5 (and JS) really native?

I'm a little confused about this. Titanium is bragging about being able to style with CSS, program with javascript and create with HTML5, whilst making the final product native to the platform. How is this possible? If I'm writing in JS/HTML/CSS then won't they be run within the browser? Making them non-native?
See jhaynie's explanation of how the Titanium Mobile SDK is used to compile to native code. In essence, the Titanium Mobile SDK creates a mapping between their APIs in javascript and the native APIs of the target platform.
Titanium code are written in core JavaScript and code is then converted into native code(i.e. objective c or java) But when you use HTML and CSS into titanium you need to render them into "WebView" a browser without address bar. So in that sense titanium is completely native.
You code a Titanium Mobile app in js using their API that 'bridges' your code to the native API.
You don't use html/css at all unless you want to include a webview with local content.
It's possible you are looking at old documentation. Titanium used to use HTML/CSS/JavaScript for creating applications which did not use native UIs but as of 0.9 is more of a JavaScript abstraction of a generic mobile device. This means you won't be using HTML or CSS to build your app and the process bears little resemblance to building a web app. Other tools like PhoneGap use the web app model in place of a native UI.
That said, you can create a web view (in-app web browser) in Titanium which you can use to show HTML5 content if you so desire. Also, as of Titanium 1.5, you can also use a CSS-style language called JSS to separate your JavaScript application model from your content.
Apple iOS has a "WebView" which is basically a browser window under control of the program. They take your code, plop it in to a WebView and wrap some infrastructure around it, and compile and ship it as a "native" program.

PhoneGap vs. Titanium

PhoneGap and Titanium allow you build native iPhone Apps based on HTML and JavaScript.
Has anyone gained experience with both? What are the differences?
There is a pretty lengthy discussion about PhoneGap VS Titanium (and Corona) on StackOverflow already that might be useful.
One of the big differences is that PhoneGap is MIT licensed and Titanium is (just recently changed) Apache licensed.
This article is a good summary of the practical and philosophical differences. Note its from an Appcelerator evangelist, but I still think its pretty impartial. In fact I think he shares Titanium more warts that I probably would :).
http://developer.appcelerator.com/blog/2012/05/comparing-titanium-and-phonegap.html
It's probably worth following the current Apple/Adobe spat, in which Mr Jobs has put the future of products that aren't written in language XYZ in the balance. OS 4 SDK states:
Applications may only use Documented APIs in the manner prescribed by Apple and must not use or call any private APIs. Applications must be originally written in Objective-C, C, C++, or JavaScript as executed by the iPhone OS WebKit engine, and only code written in C, C++, and Objective-C may compile and directly link against the Documented APIs (e.g., Applications that link to Documented APIs through an intermediary translation or compatibility layer or tool are prohibited).
I believe Titanium is affected by this.
Well..! this is not certain that which is better to implement the project.
Both technologies are new and having their pros & cons as well.
Titanium says to keep native environment with the help of java Script Based framework, on the other hand the phoneGap provides everything inside the WebView, you only need to put your web based project having index.html inside the WWW folder, found in the project directory structure of the Project.
So if you comfortable with Web Works, phoneGap is suitable in this case otherWise you should go with Titanium.Its easier to use and fully facilitated.
Unfortunately Titanium is not opensource anymore. You can develop apps freely but You have to buy Indie account to publish an app to appstore which cost some money.
PhoneGap is a free and open source framework that allows you to create mobile apps using web APIs for any platforms (iOS, android,windows, Blackberry etc) you think of.
Titanium: Is a cross platform, where in the code you write in JS and Titanium API's will be converted to native code and look and feel of the app will be same as native apps.
PhoneGap: Is a hybrid platform, where in you write the code using web technologies like JS, HTML and CSS. Which uses web views present in the native devices to render the UI. Look and feel is not same as native apps.