Here’s an open source library submitted by Fabio Caccamo providing a very simple API for obtaining unique identifiers with different persistence levels. There’s also an optional feature alloying to share UUIDs created for all devices of the same user.
Included are methods for grabbing a uuid each time an app is launched, installed, every session and more.
This listing from the readme shows the available methods in FCUUID and their persistence levels:
+(NSString *)uuid;
//changes each time the app gets launched (persistent to session)
+(NSString *)uuidForSession;
//changes each time the app gets installed (persistent to installation)
+(NSString *)uuidForInstallation;
//changes each time all the apps of the same vendor are uninstalled (this works exactly as identifierForVendor)
+(NSString *)uuidForVendor;
//changes only on system reset, this is the best replacement to the good old udid (persistent to device)
+(NSString *)uuidForDevice;
//returns the list of all uuidForDevice of the same user
//in this way it’s possible manage guest accounts across multiple devices easily.
+(NSArray *)uuidsOfUserDevices;
You can find FCUUID on Github here.
A great alternative to using identifierForVendor.
- A Tool To Automatically Keep Your Xcode Storyboards And Code In Sync To Avoid Runtime Failure
- Apps Using UDIDs Being Rejected By Apple – Here’s How To Generate Replacements Quickly
- Tutorial: Use Photoshop To Create Levels For Your Corona SDK Games
- iOS Library For Easily Creating Prototype RESTful Web Services For Easier Development
- Library For Working With Dates Providing Helpers For Formatting, Parsing, Validation And Manipulation
Original article: Open Source iOS Library For Obtaining Unique Identifiers With Different Persistence Levels
©2014 iOS App Dev Libraries, Controls, Tutorials, Examples and Tools. All Rights Reserved.