How to get Unique ID of Windows Phone? - windows-phone-7.1

I want to get the IMEI number of my Windows Phone in my application. How can I programatically access it? If IMEI won't get in my application, then how to access MAC address of my phone. In my application, the administrator can block some devices from accessing the server resources using a unique ID. So I want to get the UniqueID programatically and manually from phone.
Now I can access a DeviceUniqueID from my app but don't show it in the phone.
I can access FirmwareVersion and HardwareVersion both programatically and manually. They are shown in phone as firmware revision number and hardware revision number. Are they unique?

You can get a device id via:
DeviceExtendedProperties.GetValue("DeviceUniqueId")
(In the Microsoft.Phone.Info namespace)
Bear in mind the warnign from the documentation:
A unique hash for the device. This value will be constant across all applications and will not change if the phone is updated with a new version of the operating system. Applications should not use this to identify users because the device ID will remain unchanged even if ownership of the device is transferred.
You will also need to declare in your manifest that you require capability ID_CAP_IDENTITY_DEVICE

Related

Get unique device ID on iOS with Google Tag Manager

I'm trying to get the Device ID via Google Tag Manager but got an error on iOS. After a quick search it seems that Apple blocked this.
Moreover, it seems that using idfa is not recommended (can lead to troubles to validate the app) and sometimes lead to unexpected errors.
What are my options here ?
Get the device ID via code and somehow (I don't know hate btw) push it to the data layer to retrieve it later via GTM ?
Find another unique ID ?
What would you suggest ?
Apple has blocked developers of using any kind of unique device id, like uniqueIdentifier, mac address, etc...
As you noted using the IDFA for this might get you in trouble, you are only allowed to use this for advertisement purpose.
There is the identifierForVendor, this ID is shared between all app from one developers. This ID will not change wil the user has any app on his device from the same developer.
The last option is to create a unique ID yourself and store this in the keychain where only you app(s) can access it.
I all cases you will have to push the value into tag manager yourself.

Swift, I want to get phone number(not udid) and email from device [duplicate]

This question already has answers here:
Programmatically get own phone number in iOS
(9 answers)
Closed 7 years ago.
all
I'm developing app and it contains function which gets phone number and email from device.
I've looked at some samples on internet but all of them are about unique id.
How can i get phone number and email from device?
Is there anybody who has experience in this area?
Apple has removed access to this data from inside your app. You may not access the user's phone number from the device. You instead must require them to enter it in a text field or something.
"For security reasons, iPhone OS restricts an application (including
its preferences and data) to a unique location in the file system.
This restriction is part of the security feature known as the
application's "sandbox." The sandbox is a set of fine-grained controls
limiting an application's access to files, preferences, network
resources, hardware, and so on."
The device's phone number is not available within your application's
container. You will need to revise your application to read only
within your directory container and resubmit your binary to iTunes
Connect in order for your application to be reconsidered for the App
Store.
This is not possible from the iOS APIs, you will need to query the user for phone number or discover it through other means.

Unique device identifier iOS 7 for give away purposes

I read a few threads and it seems like the UDID is deprecated. I also checked out CFUUIDCreate() but that's not really what I'm looking for.
I'm planning to do give aways in my app, so the only information I need from the user is the email address and a unique identifier of the device. I don't want the user to be able to simply reinstall the app and re-register for the give away. The easiest way would be to send some kind of device identifier together with the email address.
Any suggestions?
EDIT: Can I use the MAC address for this purpose? Any other ideas?
EDIT2: Nevermind, that's deprecated aswell...
EDIT3: I think I found something: How to generate unique identifier which should work in all iOS versions?
EDIT4: I'm using the solution in the link above, it works great!
Apple no longer allowes access to UDID from public APIs.
Perhaps you can use a web service to tell the device by it's IP, etc. Although there may be a way to mislead it, it will be better than using nothing.
Another solution would be using iCloud, only a few users would actually make the effort to make a new account.
Whatever you do, remember to make sure you don't break Apple's AppStore guidelines:
https://developer.apple.com/appstore/resources/approval/guidelines.html
(see "20. Contests, sweepstakes, lotteries, raffles, and gambling")
See a list of possible identifications below. Only the CFUUID provides you an unique identifier, but when you reinstall the app the ID is regenerated.
You may save the mail address of the user who received a giveaway in a separate online db.
UDID
unique and permanent device identification
(deprecated)
CFUUID / NSUUID
Random-ID, which is not bound to the device
is for each installed app different
only persistent till you delete the app
Advertising Identifier
for all apps identically
can be changed by the user
can be globally turned off
Identifier for Vendor (IDFV)
identically for all apps of one developer
MAC adress
cannot be used
no identification of a device, because the API returns the same MAC address for all devices

Get Contacts out of Address Book who also use the application

I'm developing my first iPhone-application in Xcode and I was wondering if it is possible to get the contacts out of the Address Book of the iPhone who also use the application?
So what I need is a way to generate a unique ID based on the information in the Address Book, so that the ID that will be constructed for the same person will be the same on every iPhone where the application is used.
This way, I can use this ID as a primary key in the database I use to hold data that needs to be shared among users.
If I can construct this idea, I can also compute the ID for every Address Book member and check them against the ID's in my database to see who uses the app. But how can I construct such a unique ID?
I am not sure.. accessing phone number in iPhone allowed or not ... as far as I know its not possible .. but in your application you can ask user to enter the his mobile number and then you can make phone number as unique ID... whatsapp is using the same thing ...
For getting phone number check this ..
How can I get the phone number of my iPhone device?
Programmatically get own phone number in iOS
How to get the phone number programatically

How can i generate device specific unique number in Rhomobile

I need to send a unique number per device to server to trace the application install and create its specific device number.
When i use to generate the unique number by some logic, and make it to store in the local db, but on uninstalling and again installing the application, the generated number is different.
So i'm not able to get the data for that device been used previously.
Do we have some way to make/generate this unique number ?
You should be using the System property to get some unique number rather than generating unique number by some complex logic.
You can use the System.get_property() and get the phone_id which will be unique for all device even after uninstalling and reinstalling.
System.get_property("phone_id")
Check the whole list of properties here http://docs.rhomobile.com/rhodesapi/system-api#getproperty
Yes, the above methods will work only for android, In Recent iPhones (after 5.0) we cant acces s the device unique-id(uuid) through the program.

Resources