iOS: Polyfill NFC web API - is it even possible? - javascript

I'm facing migrating my iOS Cordova based app to PWA. The primary issue is that it is using NFC scanner. I have started to wonder if there is any way to polyfill NFC web API on iOS / Safari? It seems that official support will not happend soon...
At the moment I'm thinking of creating some kind of "service" that would host native NFC API over some communication channel.
A bit more detailed:
Create an app/service that would be a proxy for native NFC API.
The app should receive scan requests send scan results over browser reachable interface (Sockets?).
At PWA side I think it could be nicely packed into NFC web API shape.
Native app would be required to install with my PWA. But can also be considered general proxy for PWA class apps.
I'm not familiar with iOS programming and architecture but it seems there are some basic flaws of this concept. So here are my questions to iOS devs :)
Is is possible to implement and run continually some kind of service like TCP / sockets server?
Do you have an idea which layer would be suitable to handle communication between NFC proxy and PWA?
Maybe you have some alternatives to proposed approach?
IT Man

Related

Is there a way to stream your webcam to your android app using Webrtc?

Is there a way to stream your webcam to your android app using Webrtc?
Yes there is, the main concept should be:
Use socket.io for Realtime communication between clients. https://socket.io/
Use peerJS to wrap webRTC on the browser. https://peerjs.com/
Of course Node.js, and express should be part of the development too.
You should find many tutorials on the web for this.
Yes, I did an app that uses WebRTC for screen sharing
My work is based on this repo, please take a look

WebRTC support for android

I wanted to build video calling app using webRTC and went through lot of websites searching for that but found nothing, just disappointment as most of websites provided the steps for the web and the other said to visit this link "https://webrtc.org/native-code/development/" for native android sdk of webRTC, which shows 404 error. I just want to know, google don't provide native android sdk?. So, I can't build native android app with webRTC or there is some other method to use webRTC. And if not what's some other way to make video calling app?
Old site moved to: https://webrtc.github.io/webrtc-org/native-code/android/
Not happy with the new site as well tbh.

Solution for identify mobile devices by mobile browser

I'm wondering it's possible to identify android device by web app running on mobile web browser? And this solution have to still working after change or upgrade web browser on this phone.
My second doubt is web app can working offline on phone showing PDF presentations saved in local storage (disk). When I have internet connection I can manually sync presentations (some are removed and some are downloaded).
If PWA app can work like I described above or in this case we need to use (hybrid) mobile app ?
PWAs allow to cache assets and make them available to the users even when they are offline. There are some functionalities that only Native Apps have (eg. access to a device contacts), but they are very close under many other aspects.
I wrote an article about Service Workers and caching strategies where I explain how to cache static assets as well as HTTP GET calls. It is part of a series about PWAs, so you might find it useful to get more insights about this technology.
Have a look at the website what web can do today to have a list of WEB APIs currently available:
I do not know the detail of your requirements, but maybe you do not even need to implement an hybrid app and simply create a PWA.

Websocket server and Mobile clients

I have a Tomcat based server which serves as a Websocket end point (used javax.websocket) for my web based JS app. I am serving out json based data (queried from my database) via the web sockets. I am not using websockets to serve out HTML/JS pages.
Now we are building a native mobile app of our JS web app. There doesnt seem to be good native support for Websockets on Android and ios.
I would like to keep the server code base common to both JS client and the mobile client.
What would be your suggestion for such a situation? Write a different server for mobile clients?
I found this http://www.elabs.se/blog/66-using-websockets-in-native-ios-and-android-apps. They suggest SocketRocket for ios and https://github.com/TooTallNate/Java-WebSocket for Android.
I have never heard of these people / companies. Not sure of their antecedents and if their apps are bug free.
Any suggestions would be welcome.
I'm not sure if this is the answer you are looking for, but I tried this once, and decided to use a webpage that uses the websocket. Each app will display a webview accessing the page. All recent iOS SDK versions support this, but only the newer (4.4+) Androids will.
If you do not want to use webviews, I recommend Tavendo Autobahn for Android. I had a problem that my server's websocket would disconnect all the time. I had to implement a reconnection routine every couple of seconds on the app.
Hope it helps :)
I'm using this library on android for websockets https://github.com/codebutler/android-websockets
Works good with Spring WebSockets.
Sorry for messy answer, I'm in hurry, write in comments if u have questions

Push Notifications/Messaging in HTML5 web App

I am looking to integrate Push Notification in my Jquery mobile web App using PhoneGap for Android. Is there any solution to put cloud messaging in web app like push notification.
My app is based on getting friends location and checked in new location so i was looking for messaging or push notification in web app.
i am also read about http://www.html5rocks.com/en/tutorials/eventsource/basics/
but this was not helpful for me.
If real time Push Notification not possible in HTML5 web app Please let me about asynchronous messaging like offline messaging in my app.
I recently implemented realtime messaging with the WebSocket protocol, it is easy to implement, very performant and it supports encryption.
Try Urban Airship. You get 1 million free push notifications every month.
It is also working with Phonegap.
Link: http://docs.urbanairship.com/build/phonegap.html
ScaleDrone allows pushing to (and from) PhoneGap and web. It will use Websockets if possible and other technologies when Websockets are unavailable.
There is an API for this: http://www.w3.org/TR/2014/WD-push-api-20141007/, but I wouldn't count on platform support here. However, since you are using PhoneGap, you can integrate your app with native cloud messaging. Here's a tutorial.
Push Notification can be implemented. If you are using Phonegap, PushPlugin ia a good available option. This plugin is for use with Cordova, and allows your application to receive push notifications on Amazon Fire OS, Android, iOS, Windows Phone and Windows8 devices. ALso it is free to use.
The Android implementation uses Google's GCM (Google Cloud Messaging) service.
For detailed implementation guide using Android refer Android section in this link.
Hope it will answer your question. this is late answer here, can be helpful to you as well as others looking for similar kind of solution.

Categories

Resources