PWA needs to access location when no wifi and no cellular - geolocation

My client wants a mobile-app that can run with no WiFi and no cellular network available. I think that a PWA gives them the most cost-effective way to meet their needs, accept that the app needs to know location even when there is no network available. To do this the PWA would need access to the true-GPS, i.e., the info gathered by the GPS chip talking to the satellites. It's my understanding that a PWA does not yet have this access and there is no date for when we can expect it. Could we buy or develop a native mobile app that delivered the GPS-info to my PWA? I've seen some discussion of this using Cordova, but I would like to avoid diving into that world if I can.

I put my Android into airplane-mode and took it for a walk around the block. The PWA that I had installed on the Android was still able to give me the updated location. So perhaps the discussions and complaints I see on stackoverflow, etc., regarding this not working, are out-of-date. BTW: In the navigator.geolocation options I have:
enableHighAccuracy: true
so hopefully the browser uses this as a hint to use the GPS-chip if available, and not care if there is no network available.

Related

Transfer files from PC into React Native App

Sometimes I see (mostly iOS) apps, that serve their own HTTP content, which can be accessed with browser on local network in order to transfer files, for example certain audio or video players. In Android world, this is not so much an issue, since the user can access device filesystem using USB cable, but this is not possible on iOS.
Is there any tutorial/best practice/other resource providing deeper insight into this topic? I already did some research and tried to discover some tools for this purpose, but I did not find anything describing exactly this use-case.
Could somebody give me a hint, where to get started?

how to disable wifi assist without user interaction

I have couple of URLs that has to be called(programatically) through wifi not with mobile data.
As WIFI ASSIST is on , whenever the wifi is weak ,packets get transferred through Mobile data.
I would like to stop this from happening.
As far as I have researched, there is no API to toggle wifi assist switch on and off programatically
I can find if the user has mobile data and wifi on with the help of Reachability Class I believe and I can alert the user to keep wifi assist off but this is a very bad user experience.
so I decided to look if its possible to be done with the help of iOS mobile configuration file.
But I couldn't find any keys related with wifi-assist in Apple configuration profile reference.
so I am wondering , is it possible to force wifi to be used for certain URLs.
I remember this is possible with VPN ON DEMAND we can have certain domains to be accessed via VPN.
I am wondering if same is possible for wifi as well through configuration profile
Any suggestions are welcome.
As others have mentioned, there is no way to do manipulate this setting programmatically in iOS. This is not really what you are asking, as you seem to already know the answer to this is "No".
You are asking about the configuration profile, so I am assuming these are managed devices. Unfortunately, there is no configuration profile payload I am aware of that forces the managed devices to disable Wi-Fi Assist.
Your intent, however, is a bit different than what is being asked, I believe. I think you basically have an app that communicates with a resource that is only accessible via the Wi-Fi network (likely a corporate Wi-Fi network). If the app tries to connect to the resource while on cellular, it will not be able to connect. In some cases, when the Wi-Fi signal is weak, the device tries to be helpful and switches to cellular, causing issues with the app. If we could figure out a way to force iOS to not take advantage of Wi-Fi Assist when your app is running, you would be in good shape.
If you can install this app as a managed app, there is a way to identify that the app should only be allowed to run on a Wi-Fi connection. Setting the network usage rules AllowCellularData to false should do this (see this for more details). The thing I am not sure of with this solution, is whether this simply causes the connections to fail when Wi-Fi Assist is on and active, or if it makes iOS prefer to not use Wi-Fi assist when the app is running because it cannot connect over cellular. So I think you can tell an app to only connect over WiFi, but it doesn't really give you a better solution to your user experience problem. The only think it really buys you is that your app connection won't ever try to connect when connected to cellular. There is a chance, however, if you change this value to false for your app bundle ID, it will prevent Wi-Fi Assist from enabling when your app is running. I don't have access to MDM to try it out, but you could test and see.
Ultimately, given that this is probably a corporate device situation, I think you are going to have to address this through user training. The good news is that this is a one-time step. Sure, users may have slight degradation of network performance when Wi-Fi signal is weak but cell signal is strong. This does not matter as much if these are corporate devices where the corporate apps will mostly work only on the company's Wi-Fi network.
Another solution is what you mentioned, basically using on-demand VPN to provide a connection to the internal resources. This is additional infrastructure work, and you already mentioned it, so I'm not sure if it is even an option.
Obviously, the other solution would be to expose the network resources through your firewall, which could allow you to access it over cellular. I'm suspecting this is not possible due to security constraints.
Unfortunately, there are not a lot of good options in this space. However, have hope that there is some way to do it, as Sonos appears to have done something to
allow their app to avoid switching to WiFi Assist while streaming to a local network resource: https://sonos.custhelp.com/app/answers/detail/a_id/4257/~/wi-fi-assist-and-sonos
I wonder if you could have your app open a streaming audio connection to a fixed local network resource, which would cause it to use Wi-Fi. It's a pretty crazy hack, but with a low enough bitrate audio file streaming, it might do what you need while not eating up too much of the network throughput.
Per Apple's notes on Wi-Fi Assist:
Wi-Fi Assist won't automatically switch to cellular if you're data
roaming.
Wi-Fi Assist only works when you have apps running in the
foreground and doesn't activate with background downloading of
content.
Wi-Fi Assist doesn’t activate with some third-party apps
that stream audio or video, or download attachments, like an email
app, as they might use large amounts of data.
Of course the other possible solution that you could consider is improving your Wi-Fi coverage to that the signal doesn't get bad enough for Wi-Fi Assist to be needed. I know this may not be feasible, but wanted to put it out there.
Good luck with this!
There is no public API that allows you to enable/disable "Wi-Fi Assist", and even if you find a way to do it your app will be rejected.
No you can not enable or disable WiFi by programmatically and there is no API for this.

Publish IOS App to Appstore with SSID ( wifi) discovery/connect through app

I was trying to get a specific info before a IOS App development task which I searched but couldn't find anything relevant.
Wanted to know whether this requirement restricts (non compliance issue as per publish guidelines) the app to be published in App Store with features as below
User scans and lists all available wifi connections in a tableview
Selects one of the Wifi connection and connects on button click
Stores the password and SSID for future connections.
Would there be any compliance issue related to the same functionalities when submitting to IOS app store. One of my colleague have advised me about the same but not able to explain why? Which I tried to find out searching the internet, but too specific to find anything relevant. Deeply appreciate an Expert advise on this.
Thanks in advance.
I can't find anything in the Review Guidelines that would object your app idea: https://developer.apple.com/app-store/review/guidelines
A couple of areas where you should have a more detailed look:
2.5.1 Apps may only use public APIs.
2.5.9 Apps that alter the functions of standard switches, such as the Volume Up/Down and Ring/Silent switches, or other native user
interface elements or behaviors will be rejected.
5.1 Privacy
Technically, I'm not sure if it's even possible to change the WIFI not via the settings app, so I'd have a look their first. (https://apple.stackexchange.com/questions/1592/is-there-an-ipod-app-to-easily-switch-wifi-on-and-off)
I don't believe I've ever seen an app or a way to change SSID outside the Settings app. I explored a way to detect network changes, connects, disconnects, which work fine while the app is running. I was never able to influence how the user connected, just that a change happened. It also falls apart pretty quickly when the user backgrounds the app. Trying to keep a background task open long enough to poll the current connection fails pretty fast.
I wish Apple would provide some system level notification of Wifi connect events. This could be very useful to developers that want a little more control than Background App Refresh events.

can ios safari access bluetooth device?

I'm working on a location related project. I found that iOS has iBeacon which can help the app to get the location data. I want to know if iOS Safari does have the access to it? Or any other similar bluetooth device which can be accessed?
Not yet. There is a proposal in W3C for a "web-bluetooth" specification which has been partly implemented in the chrome , opera and chrome-for-android browsers, although they need to be activated by the users in a somewhat convoluted manner. Like all these things, it'll take time for the committees to spin their wheels and for the browser makers to decide if they want to support it , and then implement it.
MDN docs: https://developer.mozilla.org/en-US/docs/Web/API/Web_Bluetooth_API
Apple don't have this built in to Safari (yet), however there is a Web Browser app called WebBLE that implements 'Web Bluetooth' mentioned by Shayne.
Currently the app only supports a subset of the standard, but it's more than enough for most tasks. It's also Open Source so you could add it to a WebView in your own app if needed.
Having said all that, currently I don't believe Web Bluetooth supports accessing Advertising data - so while you can connect to Bluetooth LE devices and interact with them, you may not be able to get the actual Advertisements (which is kind of the point of iBeacon).

test GPS without service provider

While I found a question asked for android (http://stackoverflow.com/questions/3189188/gps-location-without-service) I couldn't find one for iOS so I thought I'd ask it. Especially since it seems to be possible in Android (see link).
I'm wondering if there's anyway to get location without a service provider. For example, I have access to an older iPhone 3GS but clearly don't want to pay any fees just to test my location services code.
I'm thinking that since location should be determinable via WIFI then maybe the only difference would be the increased precision of GPS. Maybe that'll be enough.
I actually got the answer by posting at Apple's devforums.
Basically, Location Services are independent of GPS - the APIs are identical regardless of device.
Which makes sense. Essentially, the only difference with actual GPS-based location is precision.
What fees are you worried about ? If it's mobile data charges then just switch off mobile data - the gps will still work fine!

Resources