Apple ID retrievable from App download within Cocoa Touch - cocoa-touch

Hi
I'm working on an iphone app that needs to be maintain a somewhat unique identifier per download. Is there a way to retrieve either the Apple ID used to download the App or another identifier I can use to link all devices with that download to a remote database/service?
Basically I want a single instance of my custom-generated data sitting on whatever device is linked to a certain Apple ID. If iTunes signs any App that you download, using that checksum would also be an option.
Any thoughts?

If you use IAP(In App Purchase), you can tie a users purchase to a single receipt, and verify that receipt against Apple's servers.
For App store purchases, as opposed to IAP, Apple allows, and pretty much forces a developer to allow their App store apps to run identically on as many devices as a customer can put their iTunes account on, with no information available to the app about whether this was the customer's first install or their Nth. If that business model doesn't work for you, don't put the app for sale in the App store.

As far as I am aware, there is absolutely no way to get access to the current signed-in Apple ID on the device. Your only real option is to maintain your own username/login combo that the user has to enter on each device they own.

I don't believe you can get the Apple ID, but you can however get the current device's ID via the UIDevice uniqueIdentifier method.
For example:
UIDevice *ourDevice = [UIDevice currentDevice];
NSString *uniqueIdentifier = [ourDevice uniqueIdentifier];
However, you should note the following (emphasis mine) from the above linked document:
A device’s unique identifier
(sometimes abbreviated as UDID for
Unique Device Identifier) is a hash
value composed from various hardware
identifiers such as the device serial
number. It is guaranteed to be unique
for each device. The UDID is
independent of the device name. For
devices that use a SIM (subscriber
identity module) card, the UDID is
independent of the SIM card.
For user security and privacy, you
must not publicly associate a device’s
unique identifier with a user account.
You may use the UDID, in conjunction
with an application-specific user ID,
for identifying application-specific
data on your server.

Related

How to Block Multiple Logins /Sign Up?

So, I have an App where the user needs to sign up to access the app. I'm planning to run an offer where user can order that item only once in a day. But I have the doubt that he may change login Id (if have multiple emails) and can place the order with Different ID's.
I'm thinking of registering the device with an email id:
Pros: - Not able to login with a different email Id.
Cons: - Not able to use the app on a different device ( if changed) as it may give an error email Id already registered with another device.Which leads to deregister from the previous device (Chances device may not be available).Or raise a ticket which is time-consuming. this may lead to customer loss.
Have also, read about IP tracking, Phone number, and Credit card details but not satisfied with the answers (somebody already raised for same). So what will be a good method to avoid multiple logins/sign up from the same device?
You can get the MAC adress from device using WifiInfo.getMacAddress()

How to obtain the existing Google Analytic clientId on OS X and/or Windows for use with Google Measurement Protocol

We are extending our analytic coverage to include actions on our Desktop apps for Windows and Mac OSX.
The Google Measurement Protocol is simple enough to use:
https://developers.google.com/analytics/devguides/collection/protocol/v1/
Is there a way that we can extract the existing Google client-id, that is, the id generated by Google and generally stored in a cookie on the computer that uniquely and anonymously identifies the client?
For clarity - you would typically use Javascript to extract it in a web-page as follows;
https://developers.google.com/analytics/devguides/collection/analyticsjs/cookies-user-id?hl=en#getting_the_client_id_from_the_cookie
How do you do the same using a language such as Swift or Objective-C on OS X, or MFC/C++ on Windows.
The client id is generated by the Javascript tracking code (or the SDK respectively). So if you use the measurement protocol there is no pre-existing client id that you could extract.
The good news is that you can generate your own. Google Analytics isn't critical w/r/t what it accepts as client id, any string will do - however to serve it's intended purpose it must be unique, so a UUID is recommended.
The best way to do this would be to use the User ID feature of Google Analytics. This feature lets you send your own ID instead of using the randomly generated Client ID (that is stored in a cookie).
So if the user visits your website and identifies themselves (e.g. logs in), then you would sent their "customer ID" using the User ID feature. Then, if that user goes on to install your desktop application and also identifies themselves (by logging in again), then you would use the measurement protocol to send the same "customer ID". You would do this by using the &uid measurement protocol parameter. Google Analytics will then identify this as the same user an you will basically get x-device behaviour in GA. This will allow you to figure out that campaign A drove a website visit as well as an eventual desktop app download.

SMS Retriever API - phone picker source

Does Google's SMS Retriever API get the list of phone numbers from the SIM lines on the user's device (which means that it's similar to TelephonyManager), or from the user's Google Play account?
I'm the product manager at Google for this API. Yes, as of the latest version of Play Services, the Phone Selector shows both the phone number for the device from the TelephonyManager (if it can be parsed as as a valid phone number) as well as recent phone numbers for the active Google Accounts on the device.
This is not directly addressed from the docs but if we infer from this statement in the Obtain the user's phone number:
Often, it is the best user experience to use the hint picker to prompt
the user to choose from the phone numbers stored on the device and
thereby avoid having to manually type a phone number
we can deduce that SMS Retriever API gets the contacts from your device.
Update
Please look at #Steven Soneff's answer
The numbers are retrieved from Smart Lock for Passwords on Android. They are retrieved if the user already stored it using Smart Lock else they will be empty. You may also ask the user to store the number for future use-cases using Smart Lock for Passwords.

Save data on iOS device permenatly

I want to save data on device itself that would be persistent even after deleting the app and installing it again (data can even be one int/date).
According to my knowledge it is impossible because each app can store data only on it's sandbox (I know I can use iCloud etc. but I don't want any services user can not have or give the app specific permissions).
As to my understanding the only option to do that is to store it on my server.
But, Apple doesn't allow to send UDID or any other specific device ID and I can't get the iTunes ID. I know I can use any other ID like Facebook ID but the app doesn't have it and that would make a really bad user experience.
I've download apps that does just that successfully (saving data specifically to my device that been recovered even after deletion and without the need to enter any ID or login process). How do they do it? Do they send UDID to some server and apple miss that or there is a way to save data outside the app sandbox?
Well there is the KeyChain, which can store data the would kept even if you delete the app.
We do that too in our app:
Basiclly we create an UDID of our own and store that on the device (in the keychain).
Combined with user id that gives us all we need on the server side to identify the user and his device. We don't store any other app data on the device, all is server managed.
You could pack your data up, store it in the documents folder for your app, and back up your device to the cloud or iTunes. you can then do a restore to get it back. You just can't do anything on your phone between the backup and the restore. Just saying.

Allow user to create account on one device and use that account on others

I want to make an application that has some views for information display. If I install my app on my iPhone then it should display the info. If I then install that app on my iPad then the app should recognize the device and display the info related to my account.
Is there any way to find the single user of two devices without the user's iTunes credentials, or is it possible to generate a key that can identify the common user of both devices?
No, currently there is no way to associate multiple devices to a single user owning those devices given the information you've provided.
However, if you added, "the information I want to display in the views, pertains to the same user account in Game Center for both devices", then you could use the player's identifier from Game Kit API.
https://developer.apple.com/game-center/
This is being added well after the fact, but:
You could use iCloud APIs to accomplish this. These are distinct from iTunes credentials, but obviously the same type of prerequisite in that the user must have an account and it's not under your control.