UUID is unique? iphone - iphone

Can i save an UUID in an external database in order to check if the user posts his message only one time from his iphone? I have searched and i have found that there is no way to save a NSString value after the app has been deleted. Am i right?

When an app is deleted, all of its data is deleted too. You could store the UUID on a remote server, however the iPhone's UUID will be the same regardless of how many times your app is deleted and reinstalled.
Note that this can be a security concern as your remote server may recognize a device which has been wiped and sold.

You can save an encrypted NSString in the keychain, and that string will survive the app being deleted. However the user can still securely wipe their phone to clear the keychain. Or log in from multiple iOS devices on their same iTunes account. Or exchange their device for another new device at an Apple store if there is some sort of warranty problem, etc.

Related

Encryption of credit card information on iOS application scenario

We want to encrypt credit card informations and save on our server. The encrypt/decrypt keys will be saved on the user's iPhone. But if the user reinstalls the app, we will have lost the keys and we will have no way to decode the card informations.
We want to find a way to save keys on any other safe places. Any suggestions on this issue?
Keychain data stays in place after an app gets deleted. You could eventually rely on this to store the keys (also, this is the most secure place where you can store them).
References:
How to find out WHEN a user bought the app / installed it for the first time (possible without UDID?)
https://forums.developer.apple.com/message/112814

How i can send a message to a specific device with identifierForVendor or openUDID?

I'm writing an app that manage accounts stored in a server,like any other social app. What i wanna do is to forbid a double login with the same account in two devices. So when a user will log to my app i have to log out any other devices that is logged with the same credentials. To identify the device i use openUDID for ios<6 and identifierForVendor for ios>=6. The devices id are stored in the server db. There's a way to take this id and send a notification/messagge to the related device? I know that i can simply check the actual device id and the stored id to know if is the same device...it's not enough, i need to send a notification to the device. How i can do?
The only way to send a message to an other device is through APNS.
Take a look at this tutorial -> http://www.raywenderlich.com/32963/apple-push-notification-services-in-ios-6-tutorial-part-2

Restrict iCloud contact/calendar sync

I am working on an application in which we have provided option for remote contact, calendar, etc wiping. The functionality is working fine until we had discovered about iCloud.
Now when we send wipe command from web to device, it deletes all the contacts from the device as expected. But, if user has iCloud account set and is ON for contacts, when contacts are deleted because of our application's wipe command, contact application will inform iCloud about it which in term will delete all the contacts of user from iCloud.
When user sends wipe and he might have initially had setup iCloud account, he may not be aware about this side effect.
Is there any workaround we can restrict the iCloud deleting?
I'm not sure this make sense. Deleting the contacts without deleting them from iCloud would not work because the device would simply download them again from iCloud.
Are you trying to create a type of MDM app?

Pressist CFUUIDRef After App Deleted

Recently apple has reject apps that uses the unique device identifier (UDID), in my app i am creating once aCFUUIDRef for each device on the first time, which works great.
in my app i am giving to a new user 10 clicks on a button (some service), when i am creating a device id for the first time it sends to the server and this id is now have credit of 10 clicks.
the problem is when the user delete my app it generate a new identifier.
how can i write some file to the iphone withe an identifier lets say for example "MyCustomDeviceID"
and when a user download the app i am checkin if this file is existing, if it does i am getting the saved parameter and if it doesn't i am creating the identifier and then creating the document.
i got to have some way to leave a mark on the iphone.
ideas will be appreciated!
Assuming that you can convert a CFUUIDRef into an NSString, you can store it in the keychain. Items stored in the keychain persist across app deletes. Check out PDKeychainBindingsController for reference.
On iOS you have no "shared space" where save data and maintain it after the application deletion. You have to do it in other ways:
you can enable iCloud for your app and save your id using NSUbiquitousKeyValueStore.
You can save your identifier in NSUserDefaults, so if the app is deleted and then reinstalled it will be available in the backup. (obviously the user have to restore from backup)
Or you can associate the identifier to a nominal account. (you have to create a system where the user can do a registration and login with this nominal account)

Are push notification tokens unique across all apps for a single device?

I will have multiple applications on the app store and 1 urban airship account to send push notifications to all of these devices. What I want to know is if each Apple device has the same "push token" across all applications? This is more of a database architecture thing so that I don't duplicate a push token many times if one single device uses many of my apps.
If each Apple device generates a unique push token for each application it has installed my architecture needs to change.
Device tokens are not exactly unique per device; they're unique per operating system installation. So if a user buys a new device but does not restore from backup, then they'll get a new device token. And if a device is wiped, it will get a new device token, so the new user doesn't get the old user's messages.
In addition, there are different tokens returned for development apps using the sandbox and distribution apps using the production system.
Since a single user might have your app installed on multiple devices legally (iPhone and iPad, for instance), it will be much safer to have a many to many relationship between users and device tokens, to be on the safe side.
And since you mentioned Urban Airship, you might find that our alias feature helps for this sort of thing; you can assign a non-unique alias to the different tokens in our end, and then we'll keep track of the mapping between your users and their device tokens. See the registration and push parts of the UA documentation.
Edit: An update because I saw some more upvotes on this old answer. As of iOS 7, device tokens are unique for each application, even on the same device.
According to apple latest doc:
Never cache device tokens in your app; instead, get them from the system when you need them. APNs issues a new device token to your app when certain events happen. The device token is guaranteed to be different, for example, when a user restores a device from a backup, when the user installs your app on a new device, and when the user reinstalls the operating system. Fetching the token, rather than relying on a cache, ensures that you have the current device token needed for your provider to communicate with APNs. When you attempt to fetch a device token but it has not changed, the fetch method returns quickly.
For more info check apple doc