objective C iOS Device ID in iOS7 - ios

I want to ask that whether objective C can obtain a unique device ID of the Device. "uniqueIdentifier" is deprecated in iOS7 and I try to use "identifierForVendor" but it gives me a different ID after the app is re-installed. I want to find a stable device ID after the app is re-install, and even the iOS is changed. In the early version of iOS, we can use MAC address to achieve such goal. But now, in iOS7, the MAC address is no longer available. How can i find a stable device ID of the iOS device in iOS7?
Maybe using Keychain to store the "identifierForVendor" value is a good approach. But will it still be the same after the whole iOS is re-installed?

iOS does not allow you to identify a device universally anymore. That is the basic idea behind removing access to UDID and Mac address.
You need to change the design of your application to adapt to these new circumstances.

in my case i used keyChain to save first generated UUID then i used it as unique device id it still persistent even if after uninstalling the app

Related

Using UIRequiredDeviceCapabilities in Info.plist to limit compatible devices

If I only want my application to run on certain iPhone/iPad models, is it appropriate to specify for instance that my app needs ARKit to achieve this even if my app does not actually use anything from ARKit?
Is there another way to go about this? Also, even after making this change, my app still builds for devices it shouldn’t like the iPhone 5s simulator. Is the device restriction a change that occurs only on the app store?
UIRequiredDeviceCapabilities lets you declare the hardware or specific capabilities that your app needs in order to run.
UIRequiredDeviceCapabilities can be used as a dictionary in Info.plist with a capability as key and its value as YES/NO.
It does not seem to have any impact on simulators but when run on a device it although compiles but shows a prompt and does not run:
It looks like you can use a capability to restrict the device even if you are not actually using that capability in code anywhere.
Apple has mentioned here that AppStore uses this key to prevent users from installing the app.
Also, we can not use this key to restrict any device in a update. It looks like any intended restriction needs to be included in the first app version:
Important: All device requirement changes must be made when you submit
an update to your binary. You are permitted only to expand your device
requirements. Submitting an update to your binary to restrict your
device requirements is not permitted. You are unable to restrict
device requirements because this action will keep customers who have
previously downloaded your app from running new updates.
EDIT:
The device capability restriction seems to work even if that particular capability is not available fo the iOS version. To test this, I have set the deployment target as iOS 9.3 and tested on a iPhone 6 device with iOS 10.3.3 version. It still showed me the popup. Here, arkit and nfc are available for iOS 11 onwards.
References:
https://developer.apple.com/library/content/documentation/DeviceInformation/Reference/iOSDeviceCompatibility/DeviceCompatibilityMatrix/DeviceCompatibilityMatrix.html
https://developer.apple.com/library/content/qa/qa1397/_index.html

unique identifier for a device with cordova on iOS

I'm searching for a good way to identify a device on iOS with my cordova application. I'm using device.uuid but it's not a good identifier because after a new installation or update it creates a new uuid. I thought about hashing the mac address of the device but it seems to me like there is no way getting the mac address of a device on iOS.
So how can I identify a device on iOS?

How do iOS apps know your region?

In the pc world they can only use one identifier which is IP address, but I just recently discovered iOS apps use 2 or more criteria to find your region. I found something called advertising identifier that those apps are using. Can anybody explain the concept please? What kind of identifier is this and how can I mask my device?
UDID, UUID, MAC Address,IDFA-identifierForIdentifier,IDFV-identifierForVendor
But unfortunately, all of the above indicates that the device identification number unique in IOS7 in either banned, or reinstall the program after two acquired identifier is not the same.
IOS system because the data are stored in sandBox inside, once you delete App, sandBox would cease to exist. Fortunately, there is one exception, that is, keychain (keychain).

Reading/writing Device Name characteristic of BLE Device in iOS 7

I want to rename the device name of BLE Device. In iOS 6.1.3, I am able to write the "Device Name" Characteristic of Generic Access Profile Service. But in iOS 7 and later, CBPeripheral is unable to discover the Generic Access Profile Service(1800).
My Question is that Is it possible to read/write Device Name characteristic of BLE Device in iOS 7? If it is possible, then how can I do that? If apple has removed this support in iOS7 and greater, then what is alternate to do this?
iOS prevents that Service from being usable by a developer. Section 3.12 (page 24) documents the fact iOS does not let a developer use that Service (and a couple others) https://developer.apple.com/hardwaredrivers/BluetoothDesignGuidelines.pdf
I ended up making a custom Characteristic that an app could write to. The firmware would handle that write request and then update the device name and advertising packet. It's seems hacky, but I wasn't able to find a better solution. It's unfortunate that iOS blocks this because it makes it impossible to make a device that is compatible with other apps unless someone makes a separate 'custom device name' standard or something...

How to identify an Enterprise (corporate) iOS device from an app?

I'm working on some apps for distribution through the Enterprise program onto company iPads (so I / the company has complete control over them). What is the "correct", if there is one, way to identify the device that the apps are running on, in the context of corporate owned devices?
CFUUIDCreate as recommended here UIDevice uniqueIdentifier Deprecated - What To Do Now? won't work, as the id has to be the same across several apps.
Right now How can I programmatically get the MAC address of an iphone looks like the best way, but I'm very new to Apple stuff and would like to know if there is a better way.
The iPads are for warehouse use, and id'ing the device is to id which warehouse that iPad is assigned to.
We are using OpenUDID in our projects for persistent cross-app identifier as a drop-in replacement for deprecated UDID.
Usage:
#include "OpenUDID.h"
NSString* openUDID = [OpenUDID value];
I run an enterprise program as well and you're right, the new UUID pieces Apple provides aren't useful. Not only are they not the same across apps but they aren't the same if the user deletes and redownloads your enterprise app.
Since you're not distributing through the App Store, you won't get shut down for using the [UIDevice uniqueIdentifier] and it still does work in iOS today. I personally send that and the MAC address and cross my fingers that this will continue to work in future releases. It's possible that Apple starts returning #"" or some other null string for the UUID in the future so be prepared.
With iOS7 (beta) UIDevice uniqueIdentifier now behaves like identifierForVendor. i.e. The ID will differ for each app and also will be reset when the app is reinstalled.

Resources