Is it possible to get a unique identifier for an ios device from a browser, in a controlled environment? - ios

This is (a very simplified version of) the scenario with which I am faced:
I have an existing web application which manages jobs. We are now purchasing a number of ios devices (iphones and ipads) and I need the web application to know which specific device (regardless of the user) is updating information through the web application (as well as getting the GPS co-ordinates, but I think I have that covered with the geolocation API).
I have control of all the devices, they will all come to me before being distributed and will return to me periodically, so I can modify/restrict etc., but I can't jailbreak.
I have no experience of ios, but if there is a way to do this without needing an app, that would be the best choice.

You can use HTML5 storage to create and save a GUID the first time user accesses your website and send it with subsequent requests.

Related

Persistent call detection on iOS

I have written an Android application which, even after termination, still runs a service that listens for phone state transitions. This way, the application was able to detect new phone calls and trigger a certain event, for example the dialog partner's number was stored in a database.
Now I am eager to implement this application on iOS as well, but I cannot figure out if it is even possible to listen for phone calls in a similar way. For all I know so far about iOS, whenever my application is terminated by either the user or the OS, it is not possible anymore to detect new phone calls.
Is there any way I can achieve this, or have I already reached a dead end?
EDIT: As it was said to be too broad:
I want to detect both incoming and outgoing calls at any time. It there a way to do this on iOS 10? I do not want code, I just want to know if it is possible.
Please investigate further App Sandbox principe that Apple is using.
In short:
App Sandbox is Based on a Few Straightforward Principles By limiting
access to sensitive resources on a per-app basis, App Sandbox provides
a last line of defense against the theft, corruption, or deletion of
user data, or the hijacking of system hardware, if an attacker
successfully exploits security holes in your app. For example, a
sandboxed app must explicitly state its intent to use any of the
following resources using entitlements:
Hardware (Camera, Microphone, USB, Printer) Network Connections
(Inbound or Outbound) App Data (Calendar, Location, Contacts) User
Files (Downloads, Pictures, Music, Movies, User Selected Files) Access
to any resource not explicitly requested in the project definition is
rejected by the system at run time. If you are writing a sketch app,
for example, and you know your app will never need access to the
microphone, you simply don’t ask for access, and the system knows to
reject any attempt your (perhaps compromised) app makes to use it.
On the other hand, a sandboxed app has access to the specific
resources you request, allows users to expand the sandbox by
performing typical actions in the usual way (such as drag and drop),
and can automatically perform many additional actions deemed safe,
including:
Invoking Services from the Services menu Reading most world readable
system files Opening files chosen by the user The elements of App
Sandbox are entitlements, container directories, user-determined
permissions, privilege separation, and kernel enforcement. Working
together, these prevent an app from accessing more of the system than
is necessary to get its job done.

How to de-duplicate notifications between native and progressive web app?

If I have both a native app and a progressive web app using web push notifications powered by service worker, is there a way to prevent a user from receiving duplicate notifications if they opt in to receiving notifications from the web site and also have the app installed?
In short - there is no easy way to do this today.
There is a discussion on Chrome here on this: https://code.google.com/p/chromium/issues/detail?id=402223
The last comment from October 2015:
For now the safest minimal solution is for sites to provide an easy
opt out mechanism (which we strongly recommend you do anyway!) so
users can turn off notifications from one platform
Another possible heuristic based solution is to take some measure for
which interface (web or native) the user most often uses (or most
recently used) and only send to that. Combined with grouping these
devices by rough screen size should give a pretty good approximation.
The issue is that if the user has two similar sized devices and uses
native on one and web on the other then notifications will only be
delivered to one, which is an edge case.
We've also been discussing building an API so sites can tell whether
their corresponding native app is installed to avoid this case, but
need to start discussing that with other browser vendors to see if
they'd be supportive.

How to detect Tablets in ASP.NET MVC Application

In ASP.NET MVC application how can I detect whether the user is using the Tablet device or the Mobile device?
Please I am looking for a no media queries solution.
There is nothing built-in for ASP.Net (you can test Request.UserAgent, but you need to know more info about specific device), you could detect the device client-side(with the help of something like web.wurfl.io) then parametrize your controllers, otherwise, if you are looking for a pure server-side solution, you could try WURFL => Wireless Universal Resource FiLe
WURFL is a Device Description Repository (DDR), i.e. a framework that
enables applications to map HTTP requests to a description of the
capability of the mobile device that requests the page. In this
regard, WURFL pre-dates the time when the DDR term was coined and
could arguably be caracterized as the first DDR. In the last year,
WURFL role has expended from being a DDR for mobile devices to being a
framework to detect every HTTP client worth recognizing.
Thanks to WURFL, mobile web sites and application can:
programmatically abstract away devices differences
avoid the need to modify applications whenever a new device ships
avoid the need to track new devices on the market
WURFL is a global database of all devices and the API to tap that
information programmatically.

Calculate cellular data usage per application

How to get data consumption of individual iOS application (i.e. if a device has 10 applications which consumes data, I want to know how much data each application consumes)
Short answer: you can't.
Long answer: all iOS applications are executed in a sandboxed environment, limiting the access that you have to data from another applications to avoid malicious behavior. The only way that you could obtain this information is if iOS had a public API that provided that information (it doesn't) or if the other applications published their information somewhere reachable from your application.

Sharing information between apps

There are two applications. How can they share information? Can we use a common database for them? Perhaps we can pass parameters from one application to another?
You cannot directly share any resources; every app is in its own "sandbox" and cannot access the resources of any any other app.
You can send data back and forth between apps a couple of ways, however.
If you want everything to stay on the device then you can implement application:openURL:sourceApplication:annotation: in both apps and provide a custom URL handler for both. The user will experience the device switching between the apps as they launch each other.
If you are willing to use a server and internet connection, then both apps can read and write the same server resource. When each app launches or becomes active, it can check for updated information on the server.

Resources