DITIdentity
@interface DITIdentity : NSObject
Used to identify a given peer in your network. In practice a peer may be a user, a device, or it might be some other entity in your system.
You can get up and running quickly by using a development identity and then change to using a production identity when you are preparing to deploying DittoKit to production.
-
The type of the identity.
Declaration
Objective-C
@property (nonatomic, readonly) enum DITIdentityType type;
-
The app name.
Use this to ensure that connections between devices are only established if they share the same app name.
Note that this is only set if the identity is a development identity.
Declaration
Objective-C
@property (nonatomic, readonly) NSString *_Nonnull appName;
-
The site ID.
Use this to identity different users or devices. Site IDs are persisted between sessions if using a development identity.
Site IDs should be unique and not reused by different users or devices.
Note that this is only set if the identity is a development identity.
Declaration
Objective-C
@property (nonatomic, readonly) uint32_t siteID;
-
A base64 encoded string representation of a certificate bundle.
Note that this is only set if the identity is a production identity.
Declaration
Objective-C
@property (nonatomic, readonly, nullable) NSString *certificateConfig;
-
Creates a development identity with the default app name and a random site ID.
Declaration
Objective-C
- (nonnull instancetype)init;
Return Value
The default development identity.
-
Creates a development identity with the provided app name and provided site ID.
Declaration
Objective-C
- (nonnull instancetype)initWithAppName:(nullable NSString *)appName siteID:(uint32_t)siteID;
Return Value
A development identity using either the provided app name or the default one, and the provided site ID.
-
Creates a development identity with the provided site ID and the default app name.
Declaration
Objective-C
- (nonnull instancetype)initWithSiteID:(uint32_t)siteID;
Return Value
A development identity using the default app name and the provided site ID.
-
Creates a development identity with the provided app name and a random site ID.
Declaration
Objective-C
- (nonnull instancetype)initWithAppName:(nonnull NSString *)appName;
Return Value
A development identity using the provided app name and a random site ID.
-
Creates a production identity using the provided certificate config.
Declaration
Objective-C
- (nonnull instancetype)initWithCertificateConfig: (nonnull NSString *)certificateConfig;
Return Value
A production identity using the provided certificate config.