AR and VR libraries for react js - augmented-reality

AR and VR libraries for react js. can some one guide me what we should use for AR and VR for react js?
some solution to use in map or anywhere required.

Related

Can I use apple libraries like CoreML and PencilKit with react-native apps?

I really want to make use of the pencil kit in my react-native application. I just want to know whether I can do it. If yes, then how?
TLDR: Doesn't exist as of 2/6/2021 and you will need to write bridge code between react native (js) and native (swift/ObjC). There are big performance limitations with this approach. I recommend you create a native Swift based app for your project.
I was also curious if this is available.
For those willing to use Swift, here's the sample shown during the demo.
For those that want to use PencilKit / CoreML native libraries from React native you need need to write bridge code between Javascript (please use typescript) and the native code.
Here's more information on bridging and a guide.
For me, I will be building a note taking app and it needs to be performant. Despite being a react / react native developer I will be choosing Swift to build this project due to performance concerns.
Last point to make is that you can use react native and native together. But this is more of a headache than an enabler. AirBnB used this for some time but moved away from this approach.
For anyone new to React Native, it's a great platform. I personally like to use it for simple applications (not graphically intensive). You can also use it with the Expo tooling which speeds up prototyping but be warned some functionalities are not available bluetooth is one example.
Yes I Did it.
I created a native view for iOS Pencil Kit in React Native with Swift.
You can check basic examples for native module in my Repo

Is it possible to use NativeScript's WebView as a WebMap in a hybrid app?

For example, the WebView will load a local map.html
This map.html will have a map loaded on it via main-page.js, so this JS file will by both Native and WebView elements.
On top of this WebView map will be a floating native button that pans the map to your location.
Is this flow possible in NativeScript? A JS file that controls both native elements and a WebView
If possible, how is this integration achieved? Does it need some complex setup?
Is this flow recommended? Would it cause any major performance issues?
It's absolutely possible to have a WebView and place native button over it. But you can't control everything within single JS file, you have to use nativescript-webview-interface plugin to interact between WebView and native functions.
If you ask about performance, WebView is never great not just with NativeScript but in general. Imagine how you would feel when using your Google Maps within Chrome of your Android, that's going to be the user experience. Almost every map apis got native libraries for iOS & Android, at least {N} has plugins for Google Map and Mapbox, so I would recommend that.

Is possible to use React Native *only for UI* and the logic in .NET?

I need to create a multi-platform app for web, ios, android and partially desktop.
I wish to use .NET/F#, but the UI is a complication. I have tried Xamarin.Forms and it is too limited to me. I could live to use React Native but I don't wanna to code the full app in javascript, instead, I wish to use F# for all the logic and web backend, and use react only for the UI in mobile.
But I wonder how?
How feed data to the UI and react to events there?
P.D: If nativescript make this possible I'm all ears. I'm still not rule out xamarin for it, but forms is too limited and the nature of the apps and so far think react native is the closer to my needs.
There's already a sample of this, because the entry file of the Fable React Native demo is a pure JS file that calls the JS generated by Fable. You just need to extend this pure JS layer and import the code generated by Fable when needed.

How can I call native ios api from cocos2d html5 with javascript binding project?

Can cocos2d html5 with javacript binding project for ios call ios native api? I am looking for the way to access the ios device camera, photos, etc.
Nope. The whole point of the JS API is to have a common subset of the API that works across all platforms (on the web you can't access the camera or a photo library), with the exception of the most commonly needed features like input.
You can write the camera etc code in Objective-C. You can then expose your methods as JS bindings as needed.
You can wrap the Cocos2d-html5 project in Cordova, then use the Cordova methods to call all the native functionality you mention

Using Protocol buffers in PhoneGap - iOS

I have used the c++ google protobuf classes in iOS using the native app approach, i.e. using Xcode, objective c, cocoa etc.
Now, I want to migrate to hybrid apps and I have explored the options on web, and according to my requirements i'm down to PhoneGap and Titanium. That will require me to use JavaScirpt, HTML5 (JavaScript only in Titanium as per my understanding) jQuery etc.
My question is, HOW am i supposed to access the my c++ protobuf classes from javascript. (i have no expertise in JavaScript).
I am also open to opinions on which hybrid-app framework to use.
Lords of web-dev....guide me.
With PhoneGap, if there is a phone feature that the PhoneGap APIs do not currently expose, or if you have some specialised native algorithm / function that you wish to access, then you need to write a plugin.
PhoneGap plugins provide a standardised mechanism for packing native code and accessing its functionality via JavaScript. See the PhoneGap Plugin Development Guide.
Personally I think PhoneGap is the best hybrid framework, it had been around for a while, is well documented, and has a healthy community.
This is an old question, but you can always use the 100% JavaScript implementation of ProtoBuf in your JavaScript code. It works well, and you can even precompile the .proto file if you want.
In Cordova it would be better to create a plug-in, but if you don't have time or skill to do that, the linked code works well.

Resources