This page provides a reference for the Gruveo SDK for iOS and lists the methods and events exposed by the SDK.
Once all of the prerequisites are in place, the initialization of a Gruveo screen looks as follows:
1 2 3 4 5 | [GruveoCallManager callCode:@"gruveorocks" videoCall:YES onViewController:self callCreationCompletion:^(CallInitError creationError) { if (creationError != CallInitErrorNone) { // Show error here } }]; |
callCode:(NSString *)
videoCall:(BOOL)
onViewController:(UIViewController *)
callCreationCompletion:(void(^)(CallInitError))
CallInitError
enum value for checking the init status. See below for details.CallInitError
EnumThe callCreationCompletion
block above is called with one of the following values:
CallInitErrorNone
- everything went fineCallInitErrorInvalidCode
- the callCode
value contains invalid charactersCallInitErrorMissingClientID
- the client ID hasn't been setCallInitErrorNetworkUnreachable
- the device is offlineCallInitErrorMicrophoneAccessDenied
- previously denied access to microphone.The GruveoCallManager
methods listed below let you send commands to the SDK.
+(NSString *)generateRandomCode
+(void)authorize:(NSString)token
+(void)endCall
+(void)toggleVideo:(BOOL)enable
YES
in the enable
parameter to turn the camera on; pass NO
to turn it off.+(void)switchCamera:(BOOL)useFront
YES
in the useFront
parameter to activate the front camera, or NO
to activate the rear one.+(void)toggleAudio:(BOOL)enable
YES
in the enable
parameter to unmute the mic or pass NO
to mute it.+(void)toggleRecording:(BOOL)enable
YES
in the enable
parameter to start call recording or NO
to stop it. Recordings done with this method use the default "maximized" layout. This functionality is only available when the call is ongoing. Check out Call Recording for call recording prerequisites and more information.+(void)toggleRecording:(BOOL)enable withLayout:(GruveoCallRecordingLayout)layout
YES
in the enable
parameter to start call recording or NO
to stop it. The following layout
values are supported:GruveoCallRecordingLayoutMaximized
– maximize the currently active speakerGruveoCallRecordingLayoutTiled
– display all participants’ pictures in tiles of approximately the same size.+(void)toggleRoomLock:(BOOL)enable
YES
in the enable
parameter to lock the room or pass NO
to unlock it. This functionality is only available when the call is ongoing.+(BOOL)isCallActive
GruveoCallManager
calls the following delegate functions to pass information from the SDK to the app.
-(void)requestToSignApiAuthToken:(NSString *)token
token
parameter contains the token value to sign. Please see Authentication for details.-(void)callEstablished
-(void)recordingStateChanged
-(void)recordingFilename:(NSString *)filename
filename
parameter contains the filename of the recording.-(void)callEnd:(GruveoCallEndReason)reason
reason
parameter is used for indicating the reason why the call ended and may have one of the following values:GruveoCallEndReasonBusy
- the call room is lockedGruveoCallEndReasonHandleBusy
- the callee is busy with another callGruveoCallEndReasonHandleUnreachable
- the callee is unreachableGruveoCallEndReasonHandleNonExist
- the Gruveo handle doesn't existGruveoCallEndReasonFreeDemoEnded
- the 5-minute call limit has been reached (when using the demo
client ID)GruveoCallEndReasonRoomLimitReached
- the room limit of 12 participants has been reachedGruveoCallEndReasonNoConnection
- lost connectionGruveoCallEndReasonInvalidCredentials
- invalid token signature providedGruveoCallEndReasonInternalError
- internal errorGruveoCallEndReasonOtherParty
- the call ended due to the other party hanging upGruveoCallEndReasonUser
- the call ended due to the user hanging up.generateRandomCode
helper method to GruveoCallManager
.toggleRecording
method with the layout
parameter.recordingFilename
event.GruveoCallEndReasonOtherParty
value to the GruveoCallEndReason
enum.