VGVoiceClientAPI
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:(NSString *)leg callback:(GetLegCallback)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);
// 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
Swift
protocol VGVoiceClientAPI : NSObjectProtocol
Undocumented
-
Undocumented
Declaration
Objective-C
- (void) serverCall:(ServerCallCallback)callback NS_SWIFT_ASYNC(1);
Swift
func serverCall() async throws -> VGCallId
-
Undocumented
Declaration
Objective-C
- (void) serverCall:(nullable NSDictionary *)context callback:(ServerCallCallback)callback NS_SWIFT_ASYNC(2);
Swift
func serverCall(_ context: [AnyHashable : Any]?) async throws -> VGCallId
-
Undocumented
Declaration
Objective-C
- (void) answer:(VGCallId)callId callback:(VonageErrorCallback)callback NS_SWIFT_ASYNC(2);
Swift
func answer(_ callId: VGCallId) async throws
-
Undocumented
Declaration
Objective-C
- (void) reject:(VGCallId)callId callback:(VonageErrorCallback)callback NS_SWIFT_ASYNC(2);
Swift
func reject(_ callId: VGCallId) async throws
-
Undocumented
Declaration
Objective-C
- (void) getLeg:(NSString *)leg callback:(GetLegCallback)callback NS_SWIFT_ASYNC(2);
Swift
func leg(_ leg: String) async throws -> VGVoiceLeg
-
This method is used to retrieve a list of conversations that the user is a member of.
Declaration
Objective-C
- (void)getCallLegs:(nonnull VGCallId)callId callback:(nonnull void (^)(NSError *_Nullable, VGVoiceLegsPage *_Nullable))callback;
Swift
func getCallLegs(_ callId: VGCallId) async throws -> VGVoiceLegsPage
-
This method is used to retrieve a list of conversations that the user is a member of.
Declaration
Objective-C
- (void)getCallLegs:(nonnull VGCallId)callId parameters:(VGGetCallLegsParameters *_Nullable)parameters callback:(nonnull void (^)(NSError *_Nullable, VGVoiceLegsPage *_Nullable))callback;
Swift
func getCallLegs(_ callId: VGCallId, parameters: VGGetCallLegsParameters?) async throws -> VGVoiceLegsPage
-
Undocumented
Declaration
Objective-C
- (void) reconnect:(VGCallId)callId callback:(VonageErrorCallback)callback NS_SWIFT_ASYNC(2) NS_SWIFT_NAME(reconnectCall(_:callback:));
Swift
func reconnectCall(_ callId: VGCallId) async throws
-
Undocumented
Declaration
Objective-C
- (void) hangup:(VGCallId)callId callback:(VonageErrorCallback)callback NS_SWIFT_ASYNC(2);
Swift
func hangup(_ callId: VGCallId) async throws
-
Undocumented
Declaration
Objective-C
- (void) hangup:(VGCallId)callId reason:(nullable NSString *)reasonText code:(nullable NSString *)reasonCode callback:(VonageErrorCallback)callback NS_SWIFT_ASYNC(4);
Swift
func hangup(_ callId: VGCallId, reason reasonText: String?, code reasonCode: String?) async throws
-
Undocumented
Declaration
Objective-C
- (void) say:(VGCallId)callId text:(NSString *)text callback:(VonageErrorCallback)callback NS_SWIFT_ASYNC(3);
Swift
func say(_ callId: VGCallId, text: String) async throws
-
Undocumented
Declaration
Objective-C
- (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);
Swift
func say(_ callId: VGCallId, text: String, level: NSNumber?, loop: NSNumber?, queue: Bool, voiceName: String?, ssml: Bool) async throws
-
Undocumented
Declaration
Objective-C
- (void) mute:(VGCallId)callId callback:(VonageErrorCallback)callback NS_SWIFT_ASYNC(2);
Swift
func mute(_ callId: VGCallId) async throws
-
Undocumented
Declaration
Objective-C
- (void) unmute:(VGCallId)callId callback:(VonageErrorCallback)callback NS_SWIFT_ASYNC(2);
Swift
func unmute(_ callId: VGCallId) async throws
-
Undocumented
Declaration
Objective-C
- (void) enableEarmuff:(VGCallId)callId callback:(VonageErrorCallback)callback NS_SWIFT_ASYNC(2);
Swift
func enableEarmuff(_ callId: VGCallId) async throws
-
Undocumented
Declaration
Objective-C
- (void) disableEarmuff:(VGCallId)callId callback:(VonageErrorCallback)callback NS_SWIFT_ASYNC(2);
Swift
func disableEarmuff(_ callId: VGCallId) async throws
-
Undocumented
Declaration
Objective-C
- (void) enableNoiseSuppression:(VGCallId)callId callback:(VonageErrorCallback)callback NS_SWIFT_ASYNC(2);
Swift
func enableNoiseSuppression(_ callId: VGCallId) async throws
-
Undocumented
Declaration
Objective-C
- (void) disableNoiseSuppression:(VGCallId)callId callback:(VonageErrorCallback)callback NS_SWIFT_ASYNC(2);
Swift
func disableNoiseSuppression(_ callId: VGCallId) async throws
-
Undocumented
Declaration
Objective-C
- (void) sendDTMF:(VGCallId)callId withDigits:(NSString *)digits callback:(VonageErrorCallback)callback NS_SWIFT_ASYNC(3);
Swift
func sendDTMF(_ callId: VGCallId, withDigits digits: String) async throws
-
Register Device VoIP Token for Voip push
Declaration
Objective-C
- (void)registerVoipToken:(nonnull NSData *)voipToken isSandbox:(BOOL)isSandbox callback:(nonnull void (^)(NSError *_Nullable, NSString *_Nullable))callback;
Swift
func registerVoipToken(_ voipToken: Data, isSandbox: Bool) async throws -> String
Parameters
voipToken
VoIP token used for VoIP push and CallKit
isSandbox
are tokens for sandbox APNS push environment (default production)
callback
with the error and success with deviceId of the registerVoipToken:withDeviceToken “` [voiceClient registerVoipToken:(NSData * _Nonnull)voipToken isSandbox:(Boolean * _Nullable) callback:(void (^)(NSError * _Nullable))]
-
Register Device VoIP Token for Voip push
Declaration
Objective-C
- (void)registerVoipToken:(nonnull NSData *)voipToken callback:(nonnull void (^)(NSError *_Nullable, NSString *_Nullable))callback;
Swift
func registerVoipToken(_ voipToken: Data) async throws -> String
Parameters
voipToken
VoIP token used for VoIP push and CallKit
callback
with the error and success with deviceId of the registerVoipToken:withDeviceToken “` [voiceClient registerVoipToken:(NSData * _Nonnull) callback:(void (^)(NSError * _Nullable))]
-
Undocumented
Declaration
Objective-C
@property (class, nonatomic) BOOL isUsingCallKit
Swift
static var isUsingCallKit: Bool { get set }