Wishi partner widget/SDK documentation
  • The Formal Stuff
    • Introduction
    • iOS SDK
      • Setup
        • View controller setup example
      • Public protocols
      • Public API's
      • Data structures/types
    • Web SDK
      • Setup
      • Initialization
      • Data structures
      • Public API's/interfaces
      • Events subscription
      • Telemetry
    • Pixel
      • Set up the base code
      • Set up events
      • Tracking parameters
    • Client-side authentication
    • FAQ
Powered by GitBook
On this page

Was this helpful?

  1. The Formal Stuff
  2. iOS SDK

Public protocols

Once the user tap on an icon - callback

func onItemClick(url: String) {}

Error handling

func sdkFailure(error: SDKError) {}
// interface
public enum SDKError: Error {
    case sdkNotInitialized
    case missingClientInfoAndUserData
    case missingClientId
    case failToInitSDK
    case failToAuthenticate
    case failToGenerateToken
    case failToGetUserStatus
}

ViewController presented on host application

func presented(viewController: UIViewController) {}

Selecting items callback

 func didSelectItems(fromController controller: QuizViewController, quizObject: WSQuiz, selectedOptions: [WSQuizAnswer], lastSelectedOption: WSQuizAnswer) {
            
 }

screen selection is done- callback

func screenSelectionDone(fromController controller: QuizViewController, quizObject: WSQuiz, selectedOptions: [WSQuizAnswer]) {
        
    }

No new messages to read - callback

// callback will be called once message queue (user read all messages inside)
func onReadMessages(unreadMessage: Int) {}
PreviousView controller setup exampleNextPublic API's

Last updated 2 years ago

Was this helpful?