Add scheduled callbacks

Let your customers request a scheduled callback in your app using the Zoom Contact Center SDK for iOS.

Start the scheduled callback service

To start standard scheduled callback functionality, first initialize the service, then fetch the service instance, and finally show the scheduled callback view.

To initialize the standard scheduled callback service, create an instance of the ZoomCCItem class to set the sdkType property to ZoomCCIInterfaceType_ScheduledCallback. Include the apiKey from your Contact Center flow.

ZoomCCItem *item = [ZoomCCItem new];
item.sdkType = ZoomCCIInterfaceType_ScheduledCallback;
item.apiKey = APP_SCHEDULE_CALLBACK_API_KEY;
let item = ZoomCCItem.init()
item.sdkType = .scheduledCallback
item.apiKey = APP_SCHEDULE_CALLBACK_API_KEY

Next, fetch the scheduled callback service instance and set its delegate to receive callbacks from ZoomCCSDK. When the status of the service is ZoomCCSDKStatus_Initial, initialize the scheduled callback service by calling initializeWithItem: and login. The callback service then connects to the Contact Center server to fetch information.

id<ZoomCCScheduledCallbackService> scheduledCallbackService = [[ZoomCCInterface sharedInstance] scheduledCallbackService];
scheduledCallbackService.scheduledCallbackDelegate = self;
if (scheduledCallbackService.status == ZoomCCSDKStatus_Initial) {
    [scheduledCallbackService initializeWithItem:item];
}
let scheduleService = ZoomCCInterface.sharedInstance().scheduledCallbackService()
scheduleService.scheduledCallbackDelegate = self
if (scheduleService.status == .initial) {
    scheduleService .initialize(with: item)
}

To show the standard scheduled callback view, use this callback. The callback gets the view's instance and displays it.

__weak typeof(self) wself = self;
[scheduledCallbackService fetchUI:^(UIViewController * _Nonnull viewController) {
    [wself directShow:viewController];
}];
scheduleService.fetchUI { vc in
if (vc != nil) {
        self.navigationController?.pushViewController(vc!, animated: true)
    }
}

End the scheduled callback service

This method closes the view created by the SDK, then returns to the application view. The service instances created inside ZoomCCSDK are released after this method is called.

[scheduledCallbackService endScheduledCallback];
scheduledCallbackService.endScheduledCallback()

Callbacks

These callbacks are available for scheduled callback functionality.

  • error
  • eventChange
  • loginStatusChanged

error

Sent after a service error.

  • service - the current service.
  • error - the service error code. See errors for details.
  • detail - the error details.
- (void)onService:(id<ZoomCCService>)service error:(NSUInteger)error  detail:(NSInteger)detail;
func onService(_ service: ZoomCCService, error: UInt, detail: Int) {
}

eventChange

Sent when a change has occurred, such as when a user requests or cancels a scheduled callback.

  • service - the current service.
  • event - the event that occurred.
- (void)onService:(id<ZoomCCService>)service eventChange:(ZoomCCSDKEvent)event;
func onService(_ service: ZoomCCService, eventChange event: ZoomCCSDKEvent) {
}

loginStatusChanged

Sent when the login status changes.

  • service - the current service.
  • status - the service status. ZoomCCSDKStatus_Login means the login succeeded.
- (void)onService:(id<ZoomCCService>)service loginStatusChanged:(ZoomCCSDKStatus)status;
func onService(_ service: ZoomCCService, loginStatusChanged status: ZoomCCSDKStatus) {
}