using webrtc code on my cordova app - javascript

Im trying to use webRTC API such as getUserMedia and RTCPeerConnection for my app which is built with the cordova framework.
I am wondering if its possible for webRTC to work on both Android and iOS since my video chat app is a hybrid app (js and html) which is supposed to manage the entire p2p video chat by itself, unlike pc versions which require a web browser for the webRTC communication.

Yes, It is possible to get them to work. Keep in mind, the architecture of cordova application is reliant on a Web View rendering of your application. That web view will need to provide the WebRTC APIs to consume in JavaScript. This thread suggest the web view in iOS 11 does not support it. In fact, it is pretty new to Safari all together. This documentation says that the latest versions of Android Web Views do have support. WebRTC is a collection of technologies that enables RTC, and there are native libraries for accomplishing this. I have seen a couple of plugins for Cordova that enable access to native code so you are not as reliant on the Web View.
cordova-plugin-iosrtc
phonertc
Good luck!

Related

Web App runs inside Webview and installed like a native App

I created a Web App(PWA) via React and Bootstrap. It runs perfectly. I planned to create an Android and another iOS Apps that have only one page with a Webview that loads my Web App via URL and ship those Apps to the customer.
My question is that there is a better and standard way to this? I heard about Hybrid Frameworks like IONIC but as I understand, IONIC Apps, Are web Apps that run on device not loaded from a URL, Is that right?
What I want is that my changes in the server affect all users and Apps installed on their devices. Because of that, I created the PWA App, not the Native App. I searched a lot but I can't reach a final decision.
Used to be I was an Android developer and had a lot of problems with shipping the latest version to the customer, Now I want to use Web-based technologies to reach Apps that works like a website.
The issue here is: you will not be able to use the devices resources if you load the PWA in a Webview. For example push notifications will not work. A PWA can be installed onto a phone and windows as an application. This will have push notification on Android and Windows but not on Mac or iOS (Safari is the new IE). You need to go Hybrid or back to Native if you need more.
You are right with IONIC. It is a wrapper for a webapp stored on the device but it allows us to use native features (push works on both Android and iOS). But you still have the distribution issue since you need to publish to the stores every version. Not even mentioning the hoops apple gets you through when you try to publish.
The good thing with IONIC is you have a single source code for multiple platforms and you can choose the library you want to build with. It used to be Angular but now you can choose ReactJS, Vue, Angular or ES. Which makes it way friendlier.
With IONIC you could build the native features and lazy load the rest as dynamic component from a url: stackoverflow question if you do not care about backward compatibility.
I did both PWA and IONIC. Both has their pros and cons.
If I do not care about iOS and Apple I would stay with PWA otherwise IONIC.

Can the Web NFC api be used in Progressive Web Applications?

I need to implement NFC (near field communication) in a PWA (progressive webapplication)
Every browser I have tested (Chrome MacOSX, Safari MacOSX, Safari iOS, Chrome for android) does not include the navigator.nfc object in navigator and it seems impossible to make use of this API: https://w3c.github.io/web-nfc/#conformance.
Is it possible to use NFC in any way in a PWA? Or do I have to develop a native application for this functionality?
Web NFC API is available only in Chrome for Android and that too when a flag is enabled(try about:flags) enabled.
Unless you are targeting your app for some internal corporate app where you can set the flag in all targeted users browser, I would recommend go with native code or wrapper(cordova or have a native app send in the details via web sockets)
This API is not making much progress since 2015 and so you can expect no magic to happen anytime soon. So don't rely on this API if you are targeting this for a critical app, especially when you cant control the end users browser settings.
From chrome 81 you can use NFC
https://blog.chromium.org/2020/02/chrome-81-near-field-communications.html

Is there any implementation of the Phonegap API using Node.js?

I have created a mobile app for Android and iOs, it used some parts of the Phonegap API (connection, FileAPI, FileTransfer, camera, audio)
The mobile app is responsive and works offline, my plan is to create a Desktop version for Windows, Linux and Mac using NodeWebkit https://github.com/rogerwang/node-webkit so I'm looking for an implementation or ideas of how to implement the Phonegap API using Node.js
As far as I know, it will be possible to implement this APIs:
Connection: Using Node dns module
FileAPI: Using Node file implementation
FileTransfer: Using the http module
Camera: Using WebRTC Chrome APIS
Audio: Using WebRTC Chrome media APIs
Do you think that the node modules mentioned are the appropriate ones? Do you know any current implementation of Phonegap APIs using Node.js?
I found this one: https://github.com/xverges/cordova-nodewebkit
The problem is that it's not active.
Try using the sails.js framework, built on node.js. You can use phonegap and bootstrap both with sails.

Communication between multiple user sessions in HTML5 using Windows Azure notification service

We are building a HTML5 application, we have a need for colloboration between two users the same way as in Google Docs two users can simultaniously edit a document and they can see each others changes.
In our case the document is never stored at server side. And we will only have HTML5 app running in IE10 on XBOX, Windows PC (7 or 8) and Windows Phone (7.5 and 8).
The users will be on same WiFi network.
Where can we find some samples to learn how we can use Windows Azure services/ Mobile services for this scenario.
Thanks,
Navneet
You are probably looking at something like this:
http://laktek.com/2010/05/25/real-time-collaborative-editing-with-websockets-node-js-redis/
For HTML5, you can use Websockets...which can be implemented in Azure using Node.js or using the SignalR (http://signalr.net/) that abstracts websockets/polling in ASP.NET and runs in Windows Azure.

How to invoke android core function in webpage with javascript?

I'm trying to learn Html5-based web application development on android OS. But what confuses me is that can Web APP completely invoke android core feature(such as retriving contacts, sending sms, using various sensors, modifying system settings, etc.), is it possible? Is there javascript framework or some other technology that can do it.
No, that is not possible as it would a serious security problem.

Categories