VGBaseClient

@interface VGBaseClient: NSObject

@property (weak) id<VGBaseClientDelegate> delegate;

- (instancetype)initWithConfig:(VGClientInitConfig *)config
NS_SWIFT_NAME(init(_:));

- (void)setConfig:(VGClientConfig *)config;

/**
 Create a session using an authToken and a sessionId.
 
 - Parameters:
    - authToken: The user authentication token.
    - sessionId: (Optional) The ID of the session to reconnect to.
    - callback: The callback that will be executed on completion.
 It will specify either the `error` occurred (if any) or the `sessionId` (on success).
 */
- (void)createSession:(nonnull NSString *)authToken sessionId:(NSString * _Nullable)sessionId callback:(void (^)(NSError * _Nullable error, NSString * _Nullable sessionId))callback
NS_SWIFT_ASYNC(3);

/**
 Create a session using an authToken.
 
 - Parameters:
    - authToken: The user authentication token.
    - callback: The callback that will be executed on completion.
 It will specify either the `error` occurred (if any) or the `sessionId` (on success).
 */
- (void)createSession:(nonnull NSString *)authToken callback:(void (^)(NSError * _Nullable error, NSString * _Nullable sessionId))callback
NS_SWIFT_ASYNC(2);

/**
 * Delete session with an error callback
 * @param callback callback with the error of the deleteSession
 * @code [myNXNClient deleteSession:(void (^)(NSError * _Nullable)];
 */
- (void)deleteSession:(void (^)(NSError * _Nullable error))callback
NS_SWIFT_ASYNC(1);

/**
 * Refresh the current session with token
 * @param authToken user authentication authToken
 * @param callback callback with the error of the refreshSession
 * @code [myNXNClient refreshSession:(NSString *)authToken callback:(void (^)(NSError * _Nullable))]
 */
- (void)refreshSession:(nonnull NSString *)authToken callback:(void (^)(NSError * _Nullable error))callback
NS_SWIFT_ASYNC(2);

/**
 This method is used to retrieve the details of a specific conversation.
 
 - Parameters:
    - conversationIdOrName: The ID or name of the conversation.
    - callback: A function to be called upon completion of the method.
 It takes in two parameters:
 [Error] If an error occurs, this will contain information about the error. If the method is successful, this will be nil.
 [Conversation] If the method is successful, this will contain the requested conversation. If an error occurs, this will be nil.
*/
- (void)getConversation:(nonnull VGConversationIdOrName)conversationIdOrName callback:(nonnull void (^)(NSError * _Nullable error, VGConversation * _Nullable conversation))callback
NS_SWIFT_NAME(getConversation(_:callback:))
NS_SWIFT_ASYNC(2);

/**
 This method is used to retrieve a user object based on the provided user ID or name.
 
 - Parameters:
    - userIdOrName: The user ID or name of the user to retrieve.
    - callback: A function to be called upon completion of the method.
 It takes in two parameters:
 [Error] If an error occurs, this will contain information about the error. If the method is successful, this will be nil.
 [User] If the method is successful, this will contain the requested user. If an error occurs, this will be nil.
*/
- (void)getUser:(nonnull VGUserIdOrName)userIdOrName callback:(nonnull void (^)(NSError * _Nullable error, VGUser * _Nullable user))callback
NS_SWIFT_NAME(getUser(_:callback:))
NS_SWIFT_ASYNC(2);

+ (enum VGPushType) vonagePushType:(nullable NSDictionary *)dict;

/**
 * Register Device VoIP and Device Tokens for Push
 * @param voipToken VoIP token used for VoIP push and CallKit
 * @param deviceToken device token for push notifications
 * @param isSandbox are tokens for sandbox APNS push environment (default production)
 * @param callback with the error and success with deviceId of the registerVoipToken:withDeviceToken
 * @code [vonageClient registerVoipToken:(NSData * _Nonnull) withDeviceToken:(NSData * _Nullable) isSandbox:(Boolean * _Nullable) callback:(void (^)(NSError * _Nullable, NSString * _Nullable))]
 */
- (void)registerVoipToken:(NSData * _Nullable)voipToken withDeviceToken:(NSData * _Nullable)deviceToken isSandbox:(BOOL)isSandbox callback:(nonnull void (^)(NSError * _Nullable error, NSString * _Nullable deviceId))callback
NS_SWIFT_ASYNC(4);

/**
 * Register Device VoIP and Device Tokens for Push
 * @param voipToken VoIP token used for VoIP push and CallKit
 * @param deviceToken device token for push notifications
 * @param callback with the error and success with deviceId of the registerVoipToken:withDeviceToken
 * @code [vonageClient registerVoipToken:(NSData * _Nonnull) withDeviceToken:(NSData * _Nullable) callback:(void (^)(NSError * _Nullable, NSString * _Nullable))]
 */
- (void)registerVoipToken:(NSData * _Nullable)voipToken withDeviceToken:(NSData * _Nullable)deviceToken callback:(nonnull void (^)(NSError * _Nullable error, NSString * _Nullable deviceId))callback
NS_SWIFT_ASYNC(3);

/**
 * Unregister the device push and or VOIP token
 * @param deviceId device id returned from the registerDevicePushToken method
 * @param callback callback with the error of the refreshSession
 * @code [myNXNClient unregisterDeviceTokensByDeviceId:(nonnull NSString *)deviceId callback:(void (^)(NSError * _Nullable))]
 */

- (void)unregisterDeviceTokensByDeviceId:(nonnull NSString *)deviceId callback:(nonnull void (^)(NSError * _Nullable error))callback  
NS_SWIFT_ASYNC(2);


@end

Undocumented

  • Undocumented

    Declaration

    Objective-C

    @property (weak) id<VGBaseClientDelegate> delegate
  • Undocumented

    Declaration

    Objective-C

    - (instancetype)initWithConfig:(VGClientInitConfig *)config
    NS_SWIFT_NAME(init(_:));
  • Undocumented

    Declaration

    Objective-C

    - (void)setConfig:(VGClientConfig *)config;
  • Create a session using an authToken and a sessionId.

    Declaration

    Objective-C

    - (void)createSession:(nonnull NSString *)authToken
                sessionId:(NSString *_Nullable)sessionId
                 callback:(nonnull void (^)(NSError *_Nullable,
                                            NSString *_Nullable))callback;
  • Create a session using an authToken.

    Declaration

    Objective-C

    - (void)createSession:(nonnull NSString *)authToken
                 callback:(nonnull void (^)(NSError *_Nullable,
                                            NSString *_Nullable))callback;
  • Delete session with an error callback

    Declaration

    Objective-C

    - (void)deleteSession:(nonnull void (^)(NSError *_Nullable))callback;

    Parameters

    callback

    callback with the error of the deleteSession “` [myNXNClient deleteSession:(void (^)(NSError * _Nullable)];

  • Refresh the current session with token

    Declaration

    Objective-C

    - (void)refreshSession:(nonnull NSString *)authToken
                  callback:(nonnull void (^)(NSError *_Nullable))callback;

    Parameters

    authToken

    user authentication authToken

    callback

    callback with the error of the refreshSession “` [myNXNClient refreshSession:(NSString *)authToken callback:(void (^)(NSError * _Nullable))]

  • This method is used to retrieve the details of a specific conversation.

    Declaration

    Objective-C

    - (void)getConversation:(nonnull VGConversationIdOrName)conversationIdOrName
                   callback:(nonnull void (^)(NSError *_Nullable,
                                              VGConversation *_Nullable))callback;
  • This method is used to retrieve a user object based on the provided user ID or name.

    Declaration

    Objective-C

    - (void)getUser:(nonnull VGUserIdOrName)userIdOrName
           callback:
               (nonnull void (^)(NSError *_Nullable, VGUser *_Nullable))callback;
  • Undocumented

    Declaration

    Objective-C

    + (enum VGPushType) vonagePushType:(nullable NSDictionary *)dict;
  • Register Device VoIP and Device Tokens for Push

    Declaration

    Objective-C

    - (void)registerVoipToken:(NSData *_Nullable)voipToken
              withDeviceToken:(NSData *_Nullable)deviceToken
                    isSandbox:(BOOL)isSandbox
                     callback:(nonnull void (^)(NSError *_Nullable,
                                                NSString *_Nullable))callback;

    Parameters

    voipToken

    VoIP token used for VoIP push and CallKit

    deviceToken

    device token for push notifications

    isSandbox

    are tokens for sandbox APNS push environment (default production)

    callback

    with the error and success with deviceId of the registerVoipToken:withDeviceToken “` [vonageClient registerVoipToken:(NSData * _Nonnull) withDeviceToken:(NSData * _Nullable) isSandbox:(Boolean * _Nullable) callback:(void (^)(NSError * _Nullable, NSString * _Nullable))]

  • Register Device VoIP and Device Tokens for Push

    Declaration

    Objective-C

    - (void)registerVoipToken:(NSData *_Nullable)voipToken
              withDeviceToken:(NSData *_Nullable)deviceToken
                     callback:(nonnull void (^)(NSError *_Nullable,
                                                NSString *_Nullable))callback;

    Parameters

    voipToken

    VoIP token used for VoIP push and CallKit

    deviceToken

    device token for push notifications

    callback

    with the error and success with deviceId of the registerVoipToken:withDeviceToken “` [vonageClient registerVoipToken:(NSData * _Nonnull) withDeviceToken:(NSData * _Nullable) callback:(void (^)(NSError * _Nullable, NSString * _Nullable))]

  • Unregister the device push and or VOIP token

    Declaration

    Objective-C

    - (void)unregisterDeviceTokensByDeviceId:(nonnull NSString *)deviceId
                                    callback:(nonnull void (^)(NSError *_Nullable))
                                                 callback;

    Parameters

    deviceId

    device id returned from the registerDevicePushToken method

    callback

    callback with the error of the refreshSession “` [myNXNClient unregisterDeviceTokensByDeviceId:(nonnull NSString *)deviceId callback:(void (^)(NSError * _Nullable))]