RLMSyncCredential

@interface RLMSyncCredential : NSObject

An opaque credential representing a specific Realm Object Server user.

  • An opaque credential token containing information that uniquely identifies a Realm Object Server user.

    Declaration

    Objective-C

    @property (readonly, nonatomic) RLMCredentialToken _Nonnull token;

    Swift

    var token: String { get }
  • The name of the identity provider which generated the credential token.

    Declaration

    Objective-C

    @property (readonly, nonatomic) RLMIdentityProvider _Nonnull provider;

    Swift

    var provider: RLMIdentityProvider { get }
  • A dictionary containing additional pertinent information. In most cases this is automatically configured.

    Declaration

    Objective-C

    @property (readonly, nonatomic) NSDictionary<NSString *, id> *_Nonnull userInfo;

    Swift

    var userInfo: [String : Any] { get }
  • Construct and return a credential from a Facebook account token.

    Declaration

    Objective-C

    + (nonnull instancetype)credentialWithFacebookToken:
        (nonnull RLMCredentialToken)token;

    Swift

    convenience init(facebookToken token: String)
  • Construct and return a credential from a Google account token.

    Declaration

    Objective-C

    + (nonnull instancetype)credentialWithGoogleToken:
        (nonnull RLMCredentialToken)token;

    Swift

    convenience init(googleToken token: String)
  • Construct and return a credential from an iCloud account token.

    Declaration

    Objective-C

    + (nonnull instancetype)credentialWithICloudToken:
        (nonnull RLMCredentialToken)token;

    Swift

    convenience init(iCloudToken token: String)
  • Construct and return a credential from a Realm Object Server username and password.

    Declaration

    Objective-C

    + (nonnull instancetype)credentialWithUsername:(nonnull NSString *)username
                                          password:(nonnull NSString *)password
                                           actions:
                                               (RLMAuthenticationActions)actions;

    Swift

    convenience init(username: String, password: String, actions: RLMAuthenticationActions)
  • Construct and return a special credential representing a token that can be directly used to open a Realm. The identity is used to uniquely identify the user across application launches.

    Declaration

    Objective-C

    + (nonnull instancetype)credentialWithAccessToken:
                                (nonnull RLMServerToken)accessToken
                                             identity:(nonnull NSString *)identity;

    Swift

    convenience init(accessToken: String, identity: String)
  • Construct and return a credential with a custom token string, identity provider string, and optional user info. In most cases, the convenience initializers should be used instead.

    Declaration

    Objective-C

    - (nonnull instancetype)initWithCustomToken:(nonnull RLMCredentialToken)token
                                       provider:
                                           (nonnull RLMIdentityProvider)provider
                                       userInfo:(nullable NSDictionary *)userInfo;

    Swift

    init(customToken token: String, provider: RLMIdentityProvider, userInfo: [AnyHashable : Any]? = nil)