initialize(withKey: "YOUR_KEY", andSecret: "YOUR_SECRET")
This method will initialize the SDK, use this function in the AppDelegate
Parameters:
- key: The SDK key that was provided to you.
- secret: The SDK secret that was provided to you.
Usage Example:
MySizeIdSDK.sharedInstance().initialize(withKey: "YOUR_KEY", andSecret: "YOUR_SECRET")
MySizeIdSDK.sharedInstance().setCompletionScreen(completionViewController)
Sets a completion screen to be presented after the last measurement is succesful
Parameters:
completionViewController: this screen will presented after the measurements
startUI(fromParentViewController: self, userID: "SOME_USER_ID")
This method will start the SDK
Parameters:
Usage Example:
MySizeIdSDK.sharedInstance().startUI(fromParentViewController: self, userID: "TEST_USER_ID1")
startFromOnBoarding(self, andUserID: "USER_ID")
This method will start the SDK from the onboarding screens.
Parameters:
Usage Example:
MySizeIdSDK.sharedInstance().startFromOnBoarding(self, andUserID: "USER_ID")
getSize("SIZE_CHART", andUserID: "USER_ID", onComplete: ((String?) -> Void)!, onFailure: ((Error?) -> Void)!)
Retrieves the user size according to the size chart code and user id.
Parameters:
- SizeChartCode: the size chart code you’re trying to receive the size from.
- UserId: a unique user id.
- OnComplete: a callback that will be called if there are no errors with the correct size as String.
- OnFailure: a callback that will be called if you have an error.
Usage Example:
MySizeIdSDK.sharedInstance().getSize("SIZE_CHART", andUserID: "USER_ID", onComplete: { (size) in
print(size)
}) { (error) in
print(error?.localizedDescription)
}
This method will reveal if the device is supported.
Usage Example:
MySizeIdSDK.sharedInstance().isDeviceSupported()
resetMeasurement("USER_ID", onComplete: () -> Void, onFailure: (Error) -> Void)
Resets the measurements of the user whose id is ‘userid’.
Parameters:
- userID: a unique user id – can be any unique String.
- OnComplete: a callback that will be called if there are no errors.
- OnFailure: a callback that will be called if you have an error.
Usage Example:
MySizeIdSDK.sharedInstance().resetMeasurement("USER_ID", onComplete: {
print("Suceess")
}) { (error) in
print("\(error.localizedDescription)")
}
resetProfile("USER_ID", onComplete: () -> Void, onFailure: (Error) -> Void)
Resets the profile of the user whose id is ‘userid’.
Parameters:
- userID: a unique user id – can be any unique String.
- OnComplete: a callback that will be called if there are no errors.
- OnFailure: a callback that will be called if you have an error.
Usage Example:
MySizeIdSDK.sharedInstance().resetProfile("USER_ID", onComplete: {
print("Suceess")
}) { (error) in
print("\(error.localizedDescription)")
}
disableOnBoardingBackButton()
This method will disable the back button on the onboarding screen, must be called before “start” or “startFromOnBoarding” methods.
Usage Example:
MySizeIdSDK.sharedInstance().disableOnBoardingBackButton()
setVideoForMeasureType(MeasureTypeEnum, isMale: true/false, videoName: "SOME_VIDEO", fileExtension: "mp4")
Override the tutorial video with a custom file
Parameters:
type: the measurement for which to override
isMale: boolean to indicate for which gender to override
videoName: should be a string of a file from the main bundle
fileExtension: the extension of the video file
Usage Example:
sdk.setVideoForMeasureType(TYPE_FOREARM, isMale: true, videoName: "SOME_VIDEO", fileExtension: "mp4")
setFontsWith(boldFontName: "SOME_FONT1", regularFontName: "SOME_FONT2", lightFontName: "SOME_FONT3")
Override the fonts used by the SDK, the fonts should be already loaded for example by adding them into the Info.plist key UIAppFonts
Parameters:
boldFontName: a font to be used by the SDK to replace bold fonts in the UI
regularFontName: a font to be used by the SDK to replace regular fonts in the UI
lightFontName: a font to be used by the SDK to replace light fonts in the UI
Usage Example:
MySizeIdSDK.sharedInstance().setFontsWith(boldFontName: "GODOFWAR", regularFontName: "The Amazing Spider-Man", lightFontName: "AmazDooMLeft"))
Comments
0 comments
Please sign in to leave a comment.