All Projects → fabiocaccamo → Fcuuid

fabiocaccamo / Fcuuid

Licence: mit
iOS UUID / Universally Unique Identifiers library as alternative to UDID and identifierForVendor. 📱

Projects that are alternatives of or similar to Fcuuid

Zkudid
Generate and save permanent UDID with IDFV and keychain in iOS device.
Stars: ✭ 159 (-88.54%)
Mutual labels:  keychain, uuid
fuse-device
Use the basic Device functions such as UUID and current localization from Fuse
Stars: ✭ 13 (-99.06%)
Mutual labels:  device, uuid
Modernavplayer
ModernAVPlayer is a persistence AVPlayer wrapper
Stars: ✭ 179 (-87.09%)
Mutual labels:  persistence, pod
MSession
A simple and sophisticated session and authentication solution written in Swift
Stars: ✭ 26 (-98.13%)
Mutual labels:  keychain, session
mst-persist
Persist and hydrate MobX-state-tree stores (in < 100 LoC)
Stars: ✭ 75 (-94.59%)
Mutual labels:  persistence, session
Xyuuid
iOS14 UUID KeyChain DeviceInfo IDFA UDID
Stars: ✭ 301 (-78.3%)
Mutual labels:  keychain, uuid
Tothepenny
A budget tracker app for iOS
Stars: ✭ 82 (-94.09%)
Mutual labels:  icloud
Ghostunnel
A simple SSL/TLS proxy with mutual authentication for securing non-TLS services
Stars: ✭ 1,296 (-6.56%)
Mutual labels:  keychain
Echo360
Commandline tool for automated downloads of echo360 videos hosted by university
Stars: ✭ 81 (-94.16%)
Mutual labels:  uuid
Swiftassetspickercontroller
A simple assets picker controller based on iOS 8 Photos framework. Supports iCloud photos and videos. It's written in Swift.
Stars: ✭ 81 (-94.16%)
Mutual labels:  icloud
Lychee
The most complete and powerful data-binding library and persistence infra for Kotlin 1.3, Android & Splitties Views DSL, JavaFX & TornadoFX, JSON, JDBC & SQLite, SharedPreferences.
Stars: ✭ 102 (-92.65%)
Mutual labels:  persistence
Nim ios uikit
网易云信 iOS UI 组件,提供聊天界面,文本消息,图片消息,语音消息,视频消息,地理位置消息,自定义消息(阅后即焚)等消息示例。#推荐客户得比特币,首次推荐得0.02BTC,连续推荐得0.03BTC/单,上不封顶。点击参与https://yunxin.163.com/promotion/recommend
Stars: ✭ 1,326 (-4.4%)
Mutual labels:  pod
Hibernate Performance
Samples for "Hibernate performance tuning" talk
Stars: ✭ 87 (-93.73%)
Mutual labels:  persistence
Tupl
The Unnamed Persistence Library
Stars: ✭ 83 (-94.02%)
Mutual labels:  persistence
Hardchoice
有时候作抉择真的很痛苦,Swift写的生活类APP
Stars: ✭ 90 (-93.51%)
Mutual labels:  icloud
Authenticationintro
Stars: ✭ 82 (-94.09%)
Mutual labels:  session
Slowpoke
Low-level key/value store in pure Go.
Stars: ✭ 98 (-92.93%)
Mutual labels:  persistence
Cistern
Ruby API client framework
Stars: ✭ 81 (-94.16%)
Mutual labels:  persistence
Uuid Random
Fastest UUID with cryptographic PRNG for JS
Stars: ✭ 87 (-93.73%)
Mutual labels:  uuid
Unissist
⛑ A ~300b unistore helper to persist your data using equally tiny storage adapters
Stars: ✭ 94 (-93.22%)
Mutual labels:  persistence

FCUUID Pod version Pod platforms Pod license

iOS UUID library as alternative to the old good UDID and identifierForVendor. This library provides the simplest API to obtain universally unique identifiers with different levels of persistence.

It's possible to retrieve the UUIDs created for all devices of the same user, in this way with a little bit of server-side help it's possible manage guest accounts across multiple devices easily.

Requirements & dependencies

  • iOS >= 5.0
  • ARC enabled
  • Key-value storage enabled (target / Capabilities / iCloud / Key-value storage)
  • Security.framework
  • UICKeyChainStore
  • (optional) - Key-value storage enabled -> Target / Capabilities / iCloud / Key-value storage enabled if you want to share uuidsOfUserDevices values across multiple devices using the same iCloud account.
  • (optional) - KeyChain sharing enabled (entitlements and provisioning profile) if you need to share the same uuidForDevice / uuidsOfUserDevices values across multiple apps with the same bundle seed.

Installation

CocoaPods:

pod 'FCUUID'

Swift Package Manager:

  1. File > Swift Packages > Add Package Dependency
  2. Add https://github.com/fabiocaccamo/FCUUID
  3. Select "Up to Next Major" with "1.0.0"

Manual install:

Optional setup:

It is recommended to do the setup in applicationDidFinishLaunchingWithOptions method.

  • Add an observer to the FCUUIDsOfUserDevicesDidChangeNotification to be notified about uuids of user devices changes.
  • If necessary, migrate from a previously used UUID or UDID using one of the migrations methods listed in the API section (it's recommended to do migration before calling uuidForDevice or uuidsForUserDevices methods). Keep in mind that migration works only if the existing value is a valid uuid and uuidForDevice has not been created yet.
  • Call any class method to enforce iCloud sync.

API

Get different UUIDs (each one with its own persistency level)

//changes each time (no persistent)
+(NSString *)uuid;

//changes each time (no persistent), but allows to keep in memory more temporary uuids
+(NSString *)uuidForKey:(id<NSCopying>)key;

//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;
//or
#import "UIDevice+FCUUID.h"
[[UIDevice currentDevice] uuid];

Get the list of UUIDs of user devices

//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;

Migrate from a previously stored UUID / UDID Before migrating an existing value it's recommended to debug it by simply passing commitMigration:NO and logging the returned value. When you will be ready for committing the migration, use commitMigration:YES. After the migration, any future call to uuidForDevice will return the migrated value.

//these methods search for an existing UUID / UDID stored in the KeyChain or in UserDefaults for the given key / service / access-group
+(NSString *)uuidForDeviceMigratingValue:(NSString *)value commitMigration:(BOOL)commitMigration;
+(NSString *)uuidForDeviceMigratingValueForKey:(NSString *)key commitMigration:(BOOL)commitMigration;
+(NSString *)uuidForDeviceMigratingValueForKey:(NSString *)key service:(NSString *)service commitMigration:(BOOL)commitMigration;
+(NSString *)uuidForDeviceMigratingValueForKey:(NSString *)key service:(NSString *)service accessGroup:(NSString *)accessGroup commitMigration:(BOOL)commitMigration;

Check if value is a valid UUID

+(BOOL)uuidValueIsValid:(NSString *)uuidValue;

Persistence

  • yes
  • - no
  • * read notes below
PERSISTS App memory App relaunch Reset Advertising Identifier App reinstall System reboot System upgrade System reset
uuid - - - - - - -
uuidForKey:key - - - - - -
uuidForSession - - - - - -
uuidForInstallation - - -
uuidForVendor - * - -
uuidForDevice **

*(persists only if the user have not uninstalled all apps of the same vendor)

**(persists only if the user restores a device backup which includes also keychain's data)

FAQ

How can I share the device uuid between two apps?

You must have KeyChain sharing enabled (entitlements and provisioning profile) and your apps identifiers must have the same bundle seed.

What happens if I call uuidForDevice on 2 different devices using same iCloud account and iCloud Keychain?

You will obtain 2 different uuid(s), and if you call uuidsOfUserDevices you will obtain a list containing the uuids of both devices.

When I reboot / upgrade / reset my device system, will device uuid change?

Please check the persistence table above.

Support development

Donate

License

Released under MIT License.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].