PWA push notification on IOS - javascript

I am looking for a way to send and display notifications on ios pwa apps.
I know it is not possible since the ios safari (and non of the other browsers on ios) support neither the push api nor the notification api.
I am wondering if there was a workaround to do that.
I have already taken a look at this answer, but honestly didn't understand at all.

The truth is NOT for mobile Safari, at the time I write this answer. I am doing a long research... The Apple PWA on Safari increased a lot, but is not comparable to others like Google Chrome browser. As It was said in the article:
At this point in time Apple's iPhone and iPads do not support native
push notifications. You can gracefully fallback to SMS notifications.
So, till the moment I have this resume to share:
Do Progressive Web Apps (PWA) work on iOS? YES...
Apple may wants to turn the PWA as an alternative to the Apple Store.
We still can’t open an external link in Safari
Still can’t use Push Notifications
There is a 50MB service worker cache limit
Web apps that have not been used will have their cached assets purged after 7 days
Fonts:webkit.org,developer.apple.com,brainhub.eu,love2dev.com,firt.dev

NEW:
Push API is currently in development for Safari (including iOS). It is not currently finished but should be available for testing in a Safari Technology Preview within the next few months.
OLD:
It is not possible to have Push Notifications on Safari. It's been brought up many times and has even been a topic of this years WWDC.
See the following threads:
https://developer.apple.com/forums/thread/681575
https://developer.apple.com/forums/thread/681748
If developers want push notifications in Safari we'll need to have a much louder voice. As stated in the link above, native apps got notifications in 2009, it's 2021 and Apple has not even indicated if they are willing to work on it.

Related

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

Does off-site Push notification work on Chrome or Firefox for iOS?

Looking for information on compatibility for off-site push notifications on browsers, the following picture emerges:
Most desktop browsers support it, as long as they're somehow open or running in the background
Except Edge, which has Service Workers still under development apparently
Except Safari, of which, so far, there are only rumors that some day Service Worker implementation might be considered (or you can pay USD 100 for the privilege of using their completely non-standard implementation of push notification that has nothing to do with Service Workers)
On Android, Chrome and Firefox support it
On iOS, Safari definitively doesn't support it (same as for Desktop Safari, only worse since it's for "OS X only. Notifications for websites do not appear on iOS.")
However, there are iOS versions of Chrome and Firefox, but they don't seem to be the same codebase as their Desktop/Android browsers.
Firefox for iOS, in particular, According to MDN:
Because of Apple's App Store restrictions, [...] uses the built in
iOS UIWebView on iOS, which is based on WebKit
However, being restricted to using WebKit as rendering engine doesn't necessarily mean it's unable to implement service workers, or Push notification.
In particular, in the Push Notifications page of the Mozilla/Firefox wiki, there is this sentence:
Mobile is targeting Fx45+ to for initial support. Android and iOS will
leverage Google Cloud Messaging (GCM) and Apple Push Notification
Services (APNS) respectively.
Which, of course, sounds more like a declaration of intent or possibility, than of actual implementation.
So, does Push Notification using Service Workers work on Chrome or Firefox for iOS?
Are there plans to make it work on those iOS browsers, even while it doesn't on Safari?

Browser Awareness of Bluetooth Beacons / iBeacons

Is there a way to make a browser aware of iBeacon devices in its proximity?
Similar to the way HTML5 Geolocation is working...
If not would this be something that can be achieved with a browser plug-in that can provide the detail to be consumed by javascript?
Unfortunately, no. No web browsers have implemented any bridges between beacon detection and JavaScript.
I don't think a plugin approach is possible on mobile browsers (either iOS or Android), because neither browser supports asynchronous communication between external apps and JavaScript in Mobile Safari / Mobile Chrome. The best you could do is have a custom app that responds to a beacon, then launches a web page in the browser. But I realize that isn't what you are asking for.
If you want to build a native app with JavaScript, you can use Cordova (aka PhoneGap) and use plugins that provide beacon support. My company has one for our ProximityKit beacon framework:
https://github.com/RadiusNetworks/proximitykit-plugin-cordova
There is also a Cordova plugin that has basic beacon support here:
https://github.com/petermetz/cordova-plugin-ibeacon
This looks promising (2016), Google Chrome developers site showing a desktop browser feature as a work in progress.
https://developers.google.com/web/updates/2015/07/interact-with-ble-devices-on-the-web?hl=en
Even though the Web Bluetooth API specification is not finalized yet,
the Chrome Team is actively looking for enthusiastic developers (I
mean you) to try out this work-in-progress API and give feedback on
the spec and feedback on the implementation.
Web Bluetooth API is currently available to be enabled experimentally
on your origin in Origin Trials, or locally on your machine using an
experimental flag. The implementation is partially complete and
currently available on Chrome OS, Chrome for Android M, Linux, and
Mac.
Go to chrome://flags/#enable-web-bluetooth, enable the highlighted
flag, restart Chrome and you should be able to scan for and connect to
nearby Bluetooth devices, read/write Bluetooth characteristics,
receive GATT Notifications and know when a Bluetooth device gets
disconnected.
https://github.com/WebBluetoothCG/web-bluetooth/blob/gh-pages/implementation-status.md
There's a W3C specification for this Web Bluetooth, but there's no support yet: http://caniuse.com/#search=bluetooth.
If you decide to write a Phonegap plugin implementing this spec will be a good starting point.

SignalR on mobile web?

I'm evaluating SignalR technology for use in our new product (mobile web application for the broad audience, among other things it needs a real-time chat on some pages).
I've followed the guide to create a very basic chat demo.
Then I deployed the demo on my IIS, and started chatting to myself.
All clients were on the same WiFi network.
Desktop browsers worked more or less OK.
However, Safari on iOS 4.2, and IE on WP7.10 - they both sucked.
Sometimes nothing happened when I pressed the "post" button.
Sometimes outgoing messages were sent OK to the desktop firefox, however there was no incoming messages.
Maybe I'm missing something obvious? Maybe I need jquery mobile instead of the normal one? Maybe I should just tune the IIS/web.config/whatever, and the SignalR will flourish and start to work flawlessly even through the crappy mobile internet?
Or does it mean that since it doesn't work even while on WiFi within a single hop from the web server, I should throw SignalR away and just write some JavaScript to poll a JSON endpoint for new messages?
Thanks in advance!
I have been developing an app with phonegap (that means that uses the Safari browser) and SignalR for Android and IPhone. The major issue I had was with iOS 6.x because SignalR did not connect with default config. I have found a workaround for that and I had explained it here. Let me know if you find it useful.
This code will simulate a connect, check for messages, disconnect and wait 5 secs to solve the iOS issue.
In js add
$.connection.hub.start({ transport: 'longPolling' }).done(function (myHubConnection) { });
and in Application_Start() add
GlobalHost.Configuration.ConnectionTimeout = TimeSpan.FromSeconds(1);
Microsoft.AspNet.SignalR.Transports.LongPollingTransport.LongPollDelay = 5000;
RouteTable.Routes.MapHubs();
Not all mobile browsers (e.g. android, opera mini) support websockets. You'll find a nice chart of supporting browsers at http://www.hanselman.com/blog/YourUsersDontCareIfYouUseWebSockets.aspx

web application development with j2me

The main reason I'd like to use j2me is that one of its main advantages is that it can access the phone's resources through its various APIs. However, due to newer phones having web browsers like Safari, Opera, and Windows IE, it would be advantageous to build a web application so a user wouldn't have to download some software onto their phone. Is there a way I could build a web application that can also acquire resource information about the phone? Or maybe have j2me converted to Javascript (if that's even possible)?
You can make a link that would send an SMS, but other than that, there's no cross-platform api for accessing phone internals from browser, as far as I know.
So, if you've got to access phone's resources, you'll have to write a real app.
The webkit engine on recent Series60 phones has been given access to at least some phone resources.
Nokai calls it Web Runtime or WRT.
http://www.forum.nokia.com/Resources_and_Information/Documentation/

Categories