CurrentUser

@objcMembers
@objc(GetSocialCurrentUser)
public class CurrentUser : PrivateUser

Interface for managing current GetSocial user.

  • Update user details.

    Declaration

    Swift

    @objc(updateDetailsWith:success:failure:)
    public func updateDetails(_ userUpdate: UserUpdate, success: @escaping SuccessCallback, failure: @escaping FailureCallback)

    Parameters

    userUpdate

    Properties and their new values.

    success

    Called if user was updated.

    failure

    Called if operation failed.

Identities

  • Indicate if the user has at least one identity available.

    Declaration

    Swift

    public func isAnonymous() -> Bool
  • Add identity to current user.

    Declaration

    Swift

    @objc(addIdentity:success:conflict:failure:)
    public func addIdentity(_ identity: Identity, success: @escaping SuccessCallback, conflict: @escaping ResultCallback<ConflictUser>, failure: @escaping FailureCallback)

    Parameters

    identity

    Identity to add.

    success

    Called if identity was added.

    conflict

    Called if identity could not be added due to a conflict with other user.

    failure

    Called if operation failed.

  • Remove identity from current user.

    Declaration

    Swift

    @objc(removeIdentityByProviderId:success:failure:)
    public func removeIdentity(_ providerId: String, success: @escaping SuccessCallback, failure: @escaping FailureCallback)

    Parameters

    providerId

    The provider connected to an identity on current user. Check IdentityProviderIds class for common provider ids.

    success

    Called if identity was removed.

    failure

    Called if operation failed.

  • Refresh details of current user. Use this method if you have a Smart Flow which updates user properties.

    Declaration

    Swift

    @objc(refreshWithSuccess:failure:)
    public func refresh(success: @escaping SuccessCallback, failure: @escaping FailureCallback)