Protocols

The following protocols are available globally.

NXMClientDelegate

  • Undocumented

    See more

    Declaration

    Objective-C

    @protocol VGBaseClientDelegate <NSObject>
    // Connection API
    - (void) client:(VGBaseClient*)client didReceiveSessionErrorWithReason:(VGSessionErrorReason)reason;
    // Optional Base Client Delegate methods
    @optional
    - (void) clientWillReconnect:(VGBaseClient*)client;
    - (void) clientDidReconnect:(VGBaseClient*)client;
    @end
  • Undocumented

    See more

    Declaration

    Objective-C

    @protocol VGLogger <NSObject>
    
    @property (readonly) NSString* name;
    @property (readonly) VGLoggingLevel minLogLevel;
    @property (readonly) NSArray<VGTopicGroup> * topics;
    
    - (void) didReceiveLogWithLogLevel:(VGLoggingLevel)logLevel
                              andTopic:(VGTopic*)topic
                            andMessage:(NSString*)message
    NS_SWIFT_NAME(didReceiveLog(logLevel:topic:message:));
    
    @end

VGVoiceClientAPI

  • Undocumented

    See more

    Declaration

    Objective-C

    @protocol VGVoiceClientAPI <NSObject>
    
    // Outbound Call API
    - (void) serverCall:(ServerCallCallback)callback NS_SWIFT_ASYNC(1);
    - (void) serverCall:(nullable NSDictionary *)context callback:(ServerCallCallback)callback NS_SWIFT_ASYNC(2);
    
    // Inbound Call API
    - (void) answer:(VGCallId)callId callback:(VonageErrorCallback)callback NS_SWIFT_ASYNC(2);
    - (void) reject:(VGCallId)callId callback:(VonageErrorCallback)callback NS_SWIFT_ASYNC(2);
    
    // Push API
    - (nullable VGCallId) processCallInvitePushData:( NSDictionary * _Nonnull )dict;
    
    // Call Leg API
    - (void) getLeg:(VGLegId)leg callback:(GetLegCallback)callback
    NS_SWIFT_NAME(getLeg(_:callback:))
    NS_SWIFT_ASYNC(2);
    
    
    /**
     This method is used to retrieve a list of conversations that the user is a member of.
     
     - Parameters:
        - callId: The id of the call
        - callback: A callback function to be called upon completion of the method.
     It takes in two parameters:
     [Error] An exception object, if an error occurred during the fetch.
     [VGVoiceLegsPage] It will contain the list of legs and the cursors for the next and previous page of results, if the fetch was successful.
    */
    - (void)getCallLegs:(VGCallId)callId
                    callback:(nonnull void (^)(NSError * _Nullable error, VGVoiceLegsPage * _Nullable legsPage))callback
    NS_SWIFT_NAME(getCallLegs(_:callback:))
    NS_SWIFT_ASYNC(2);
    
    /**
     This method is used to retrieve a list of conversations that the user is a member of.
     
     - Parameters:
        - callId: The id of the call
        - parameters: An optional [GetCallLegsParameters] object containing the parameters for the request.
        - callback: A callback function to be called upon completion of the method.
     It takes in two parameters:
     [Error] An exception object, if an error occurred during the fetch.
     [VGVoiceLegsPage] It will contain the list of legs and the cursors for the next and previous page of results, if the fetch was successful.
    */
    - (void)getCallLegs:(VGCallId)callId
                    parameters:(VGGetCallLegsParameters * _Nullable)parameters
                    callback:(nonnull void (^)(NSError * _Nullable error, VGVoiceLegsPage * _Nullable legsPage))callback
    NS_SWIFT_NAME(getCallLegs(_:parameters:callback:))
    NS_SWIFT_ASYNC(3);
    
    /**
     Tests whether this device and network can carry a call, and reports why not.
    
     Places a short test call over the exact route a real call takes, streaming real microphone audio to
     Vonage's media server and measuring what comes back. Nothing rings, and the test leg is hung up as soon
     as it ends. Needs a session and microphone permission, and cannot run during a call: a call that starts
     during the test stops it. The test leg may be billed as a few seconds of in-app voice.
    
     - Parameters:
        - options: How long to sample audio for and to wait for media to connect; nil for the defaults.
        - callback: Receives an error only when the test could not run at all. Every check that ran,
     failures included, is in the report; its `json` is the form to send to Vonage support.
    */
    - (void)connectivityReport:(VGConnectivityReportOptions * _Nullable)options
                      callback:(nonnull void (^)(NSError * _Nullable error, VGConnectivityReport * _Nullable report))callback
    NS_SWIFT_NAME(connectivityReport(_:callback:))
    NS_SWIFT_ASYNC(2);
    
    /// Stops a running connectivity report, whose callback then receives the `diagnostics:error:cancelled` error.
    - (void)cancelConnectivityReport;
    
    
    
    // Call Action API
    - (void) reconnect:(VGCallId)callId callback:(VonageErrorCallback)callback NS_SWIFT_ASYNC(2) NS_SWIFT_NAME(reconnectCall(_:callback:));
    - (void) hangup:(VGCallId)callId callback:(VonageErrorCallback)callback NS_SWIFT_ASYNC(2);
    - (void) hangup:(VGCallId)callId reason:(nullable NSString *)reasonText code:(nullable NSString *)reasonCode callback:(VonageErrorCallback)callback NS_SWIFT_ASYNC(4);
    - (void) say:(VGCallId)callId text:(NSString *)text callback:(VonageErrorCallback)callback NS_SWIFT_ASYNC(3);
    - (void) say:(VGCallId)callId text:(NSString *)text level:(nullable NSNumber*)level loop:(nullable NSNumber*)loop queue:(BOOL)queue voiceName:(nullable NSString*)voiceName ssml:(BOOL)ssml callback:(VonageErrorCallback)callback NS_SWIFT_ASYNC(8);
    - (void) mute:(VGCallId)callId callback:(VonageErrorCallback)callback NS_SWIFT_ASYNC(2);
    - (void) unmute:(VGCallId)callId callback:(VonageErrorCallback)callback NS_SWIFT_ASYNC(2);
    - (void) enableEarmuff:(VGCallId)callId callback:(VonageErrorCallback)callback NS_SWIFT_ASYNC(2);
    - (void) disableEarmuff:(VGCallId)callId callback:(VonageErrorCallback)callback NS_SWIFT_ASYNC(2);
    - (void) enableNoiseSuppression:(VGCallId)callId callback:(VonageErrorCallback)callback NS_SWIFT_ASYNC(2);
    - (void) disableNoiseSuppression:(VGCallId)callId callback:(VonageErrorCallback)callback NS_SWIFT_ASYNC(2);
    - (void) sendDTMF:(VGCallId)callId withDigits:(NSString *)digits callback:(VonageErrorCallback)callback NS_SWIFT_ASYNC(3);
    
    /**
     * Register Device VoIP Token for Voip push
     * @param voipToken VoIP token used for VoIP push and CallKit
     * @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 [voiceClient registerVoipToken:(NSData * _Nonnull)voipToken isSandbox:(Boolean * _Nullable) callback:(void (^)(NSError * _Nullable))]
     */
    - (void)registerVoipToken:(nonnull NSData *)voipToken isSandbox:(BOOL)isSandbox callback:(nonnull void (^)(NSError * _Nullable error, NSString * _Nullable deviceId))callback NS_SWIFT_ASYNC(3);
    /**
     * Register Device VoIP Token for Voip push
     * @param voipToken VoIP token used for VoIP push and CallKit
     * @param callback with the error and success with deviceId of the registerVoipToken:withDeviceToken
     * @code [voiceClient registerVoipToken:(NSData * _Nonnull) callback:(void (^)(NSError * _Nullable))]
     */
    - (void)registerVoipToken:(nonnull NSData *)voipToken callback:(nonnull void (^)(NSError * _Nullable error, NSString * _Nullable deviceId))callback NS_SWIFT_ASYNC(2);
    
    // Call Media API
    @property (class, nonatomic) BOOL isUsingCallKit;
    #if TARGET_OS_IOS
    + (void) enableAudio:(AVAudioSession *)audioSession;
    + (void) disableAudio:(AVAudioSession *)audioSession;
    #endif
    @end

VGVoiceClientDelegate