Setup

installation - cocoa pods

  1. add Wishi pod to your podfile

target 'HostProjectSdk' do
  pod 'WishiSDK', '0.4.3'
end

2. run pod install

Xcode installation SPM

  1. In Xcode, go to Project, select Package Dependencies.

  2. Click + .

  3. Check Dependency Rule is set to "Up to Next Minor Version" with value supplied by the developer.

    1. Alternatively you can work with "master" branch - FYI - it is not a stable version though:

      1. make sure Dependency Rule is set to "Branch" and "master".

Add configuration for the SDK initialisation process before the first launch.

Import with Delegate

import WishiSDK

// register to Wishi client SDK protocol
class ViewController: UIViewController, WishiSDKDelegate

Client info setup

let clientInfo = ClientInfo.init(firstName: "Jhon", lastName: "Doe", email: "test@best.company.ever")

Configuration setup (optional)

```swift
let configDictionary: [ConfigurationStyle: Any] = [ 
  .rateTextiewFont: UIFont.systemFont(ofSize: 16.0),
  .ratePlaceholderFont: UIFont.systemFont(ofSize: 16.0),
  .lookViewPriceFont: UIFont.systemFont(ofSize: 16.0),
  .itemViewPriceFont: UIFont.systemFont(ofSize: 16.0),
  .matchReviewCellNameFont: UIFont.systemFont(ofSize: 16.0),
  .matchReviewCellTextFont: UIFont.systemFont(ofSize: 16.0),
  .matchInfoCellTitleFont: UIFont.systemFont(ofSize: 16.0),
  .matchExpertCityNameFont: UIFont.systemFont(ofSize: 16.0),
  .matchActivityIndicatorFont: UIFont.systemFont(ofSize: 16.0),
  .quizAnswerUnselectedFont: UIFont.systemFont(ofSize: 16.0),
  .rateDoneButtonFont: UIFont.boldSystemFont(ofSize: 16.0),
  .chatLoveItReStyleItFont: UIFont.boldSystemFont(ofSize: 16.0),
  .lookViewNameFont: UIFont.boldSystemFont(ofSize: 16.0),
  .itemViewNameFont: UIFont.boldSystemFont(ofSize: 16.0),
  .matchReviewCellTitleFont: UIFont.boldSystemFont(ofSize: 16.0),
  .matchInfoCellHeaderFont: UIFont.boldSystemFont(ofSize: 16.0),
  .matchExpertNameFont: UIFont.boldSystemFont(ofSize: 16.0),
  .uploadPhotoButtonFont: UIFont.boldSystemFont(ofSize: 16.0),
  .quizAnswerSelectedFont: UIFont.boldSystemFont(ofSize: 16.0),
  .navigationTitleFont: UIFont.boldSystemFont(ofSize: 16.0),
  .navigationSubTitleFont: UIFont.systemFont(ofSize: 14.0),
  .rateTitleFont: UIFont.systemFont(ofSize: 22.0),
  .quizButtonFont: UIFont.systemFont(ofSize: 16.0),
  .rateAnswerTextCellFont: UIFont.systemFont(ofSize: 16.0),
  .matchLooksCellTitleFont: UIFont.systemFont(ofSize: 22.0),
  .historyProductsSectionHeaderFont: UIFont.systemFont(ofSize: 16.0),
  .quizHeaderFont: UIFont.systemFont(ofSize: 22.0),
  .quizSubHeaderFont: UIFont.systemFont(ofSize: 16.0),
  .tooltipTitleFont: UIFont.systemFont(ofSize: 14.0),
  .chatMessageTimestempFont: UIFont.systemFont(ofSize: 14.0),
  .itemViewReviseItFont: UIFont.boldSystemFont(ofSize: 16.0),
  .chatSectionHeaderFont: UIFont.systemFont(ofSize: 14.0),
  .navigationTitleColor: UIColor.black,
  .historyProductsSectionHeaderColor: UIColor.black,
  .rateUnderscoreViewColor: UIColor.black,
  .navigationSubTitleColor: UIColor.black,
  .quizSubHeaderColor: UIColor.black,
  .quizHeaderColor: UIColor.black,
  .quizButtonColor: UIColor.black,
  .matchLookCellBorderColor: UIColor.white,
  .quizBorderUnselectedColor: UIColor.lightGray,
  .uploadBackgroundColor: UIColor.darkGray,
  .rateTextiewColor: UIColor.black,
  .matchReviewCellNameColor: UIColor.black,
  .matchReviewCellTitleColor: UIColor.black,
  .matchReviewCellTextColor: UIColor.black,
  .quizBorderSelectedColor: UIColor.black,
  .quizAnswerLabelColor: UIColor.black,
  .matchLooksCellTitleColor: UIColor.black,
  .matchInfoCellHeaderColor: UIColor.black,
  .matchInfoCellTitleColor: UIColor.black,
  .uploadPhotoButtonColor: UIColor.black,
  .matchExpertNameColor: UIColor.black,
  .matchExpertCityNameColor: UIColor.black,
  .matchActivityIndicatorColor: UIColor.black,
  .quizButtonTextColor: UIColor.white,
  .errorBackgroundColor: UIColor.DarkGray
        ]
        
let configuration = Configurations.init(configuration: configDictionary)
```

SDK inItialisation

// function return empty string on failure and clientId on success.
Wishi.shared.initSDK(clientInfo: ClientInfo,
                        partnerKey: String,
                        partnerToken: String,
                        partnerUserId: String,
                        enviroment: WishiEnviroment = .development,
                        configuration: Configurations?,
                        delegate: WishiSDKDelegate,
                        completion: @escaping ((Bool) -> Void)) {}

Launch SDK

Wishi.shared.launch(from: navigation)

Last updated