### Install Webasyst via CocoaPods Source: https://github.com/1312inc/webasyst-x-ios-pod/blob/main/README.md Add the library to your Podfile and run the installation command. ```ruby pod 'Webasyst' ``` ```bash pod install ``` -------------------------------- ### getAllUserInstall Source: https://github.com/1312inc/webasyst-x-ios-pod/blob/main/README.md Retrieves the list of all user installations. ```APIDOC ## getAllUserInstall(completion: ([UserInstall]) -> Void) ### Description Fetches a list of all user installations including name, clientId, domain, accessToken, and url. ### Parameters - **completion** (Closure) - Required - Callback returning list of installations ``` -------------------------------- ### getUserInstall Source: https://github.com/1312inc/webasyst-x-ios-pod/blob/main/README.md Retrieves a specific user installation. ```APIDOC ## getUserInstall(clientId: String) -> UserInstall ### Description Obtains a specific installation record based on the provided clientId. ### Parameters - **clientId** (String) - Required - The clientId of the installation ``` -------------------------------- ### extendLicense Source: https://github.com/1312inc/webasyst-x-ios-pod/blob/main/README.md Extends a subscription plan for the installation. ```APIDOC ## extendLicense(type: String, date: Date, completion: (Bool) -> Void) ### Description Binds an available license or creates a trial license based on the provided subscription plan type and cut-off date. ### Parameters - **type** (String) - Required - Type of subscription plan - **date** (Date) - Required - Subscription cut-off date - **completion** (Closure) - Required - Callback returning authorization status ``` -------------------------------- ### updateUserInstalls Source: https://github.com/1312inc/webasyst-x-ios-pod/blob/main/README.md Updates and retrieves the user installation list from the server. ```APIDOC ## updateUserInstalls(completion: ([UserInstallCodable]) -> Void) ### Description Synchronizes and returns the list of user installations from the server. ### Parameters - **completion** (Closure) - Required - Callback returning updated list of installations ``` -------------------------------- ### checkInstallApp Source: https://github.com/1312inc/webasyst-x-ios-pod/blob/main/README.md Checks the installation status of a specific application. ```APIDOC ## checkInstallApp(app: String, completion: (Bool, Error?) -> Void) ### Description Checks if an application is installed. The completion closure returns a boolean indicating success and an optional error description. ### Parameters - **app** (String) - Required - Application name - **completion** (Closure) - Required - Callback returning success status and error ``` -------------------------------- ### deleteInstall Source: https://github.com/1312inc/webasyst-x-ios-pod/blob/main/README.md Deletes an installation from the local database. ```APIDOC ## deleteInstall(clientId: String) ### Description Removes the specified installation from the database. ### Parameters - **clientId** (String) - Required - The clientId of the installation to delete ``` -------------------------------- ### checkLicense Source: https://github.com/1312inc/webasyst-x-ios-pod/blob/main/README.md Binds a free license to the installation or creates a trial license. ```APIDOC ## checkLicense(app: String, completion: (Bool) -> Void) ### Description Attempts to find an available license for the user. If found, it binds it to the installation; otherwise, it creates a trial license. ### Parameters - **app** (String) - Required - Application name - **completion** (Closure) - Required - Callback returning authorization status ``` -------------------------------- ### View Webasyst error format Source: https://github.com/1312inc/webasyst-x-ios-pod/blob/main/README.md Example of how errors are displayed in the Xcode console. ```ruby Error Domain=Webasyst warning: https://1312.io The data couldn’t be read because it was missing. Code=205 "(null)" ``` -------------------------------- ### Initialize WebasystApp Source: https://github.com/1312inc/webasyst-x-ios-pod/blob/main/README.md Configure the library in the didFinishLaunchingWithOptions method of your AppDelegate. ```swift let webasyst = WebasystApp() webasyst.configure() ``` -------------------------------- ### Import Webasyst Library Source: https://github.com/1312inc/webasyst-x-ios-pod/blob/main/README.md Import the library into your AppDelegate file. ```swift import Webasyst ``` -------------------------------- ### Webasyst.plist Configuration Fields Source: https://github.com/1312inc/webasyst-x-ios-pod/blob/main/README.md Required fields for the Webasyst.plist configuration file. ```text "clientId": String // clientId of your application. Example: "72at75391ea785412a24f4568528ed49" "host": String // Webasyst ID auth domain: "www.webasyst.com" "scope": String // the scope required by your application (separated by dot). Example: "site.blog.shop" ``` -------------------------------- ### createWebasystAccount Source: https://github.com/1312inc/webasyst-x-ios-pod/blob/main/README.md Creates a new Webasyst account. ```APIDOC ## createWebasystAccount(bundle: String, plainId: String, accountDomain: String, accountName: String, completion: (Result) -> Void) ### Description Creates a new Webasyst account and returns the new clientId and URL upon success. ### Parameters - **bundle** (String) - Required - Account bundle - **plainId** (String) - Required - Account plain ID - **accountDomain** (String) - Required - Account domain - **accountName** (String) - Required - Account name - **completion** (Closure) - Required - Callback returning creation result ``` -------------------------------- ### oAuthLogin(merge:code:navigationController:action:) Source: https://github.com/1312inc/webasyst-x-ios-pod/blob/main/README.md Presents a webView for Webasyst authorization and returns the user status. ```APIDOC ## oAuthLogin(merge:code:navigationController:action:) ### Description The method presents a webView with a Webasyst authorisation form. After successful completion of the form, the user is authenticated and the user status is returned. ### Parameters - **merge** (Any) - Required - Parameter that is responsible for merging accounts - **code** (Any) - Required - Parameter responsible for merging accounts - **navigationController** (UINavigationController) - Required - UINavigationController to display the OAuth webasyst modal window - **action** (Closure) - Required - Closure to perform an action after authorization with status of user ``` -------------------------------- ### defaultChecking Source: https://github.com/1312inc/webasyst-x-ios-pod/blob/main/README.md Performs a standard user authentication check on the Webasyst server. ```APIDOC ## defaultChecking(completion: (Bool) -> Void) ### Description Verifies the current user's authentication status against the Webasyst server. ### Parameters - **completion** (Closure) - Required - Callback returning authorization status ``` -------------------------------- ### Define UserStatus enumeration Source: https://github.com/1312inc/webasyst-x-ios-pod/blob/main/README.md Represents the various authentication states returned after an OAuth login attempt. ```swift UserStatus Values: `authorizedButProfileIsEmpty`: Status when a user is authorised but their profile is empty. `authorizedButNoneInstalls`: Status when a user is authorised but has not installs. `authorizedButNoneInstallsAndProfileIsEmpty`: Status when a user is authorised but has not installs and their profile is empty. `authorized`: Status when user is authorized. `networkError(String)`: State when the network is unavailable. `nonAuthorized`: Status when user is not authorized. `error(message: String)`: Status when the server returned an error. ``` -------------------------------- ### getDefaultLocalizedString(key:comment:) Source: https://github.com/1312inc/webasyst-x-ios-pod/blob/main/README.md Retrieves a localized string from the Webasyst localization files. ```APIDOC ## getDefaultLocalizedString(key:comment:) ### Description Returns the NSLocalizedString contained in the Webasyst localisation files. ### Parameters - **key** (String) - Required - Parameter for NSLocalizedString method - **comment** (String) - Required - Parameter for NSLocalizedString method ### Returns - **String** - The localized string. ``` -------------------------------- ### getToken(tokenType:) Source: https://github.com/1312inc/webasyst-x-ios-pod/blob/main/README.md Retrieves a Webasyst token from the library. ```APIDOC ## getToken(tokenType:) ### Description A method for getting Webasyst tokens. ### Parameters - **tokenType** (String) - Required - Type of token (Access Token or Refresh Token) ### Returns - **String** - Requested token in string format ``` -------------------------------- ### oAuthAppleID(authData:result:) Source: https://github.com/1312inc/webasyst-x-ios-pod/blob/main/README.md Performs authorization in Webasyst using an Apple ID. ```APIDOC ## oAuthAppleID(authData:result:) ### Description Authorization in Webasyst with an Apple ID. ### Parameters - **authData** (Any) - Required - Authorization data sent by the Apple ID authorization controller - **result** (Closure) - Required - Closure with result of authorization ``` -------------------------------- ### getAuthCode(value:type:success:) Source: https://github.com/1312inc/webasyst-x-ios-pod/blob/main/README.md Requests a confirmation code for WAID authorization without a browser. ```APIDOC ## getAuthCode(value:type:success:) ### Description Method for requesting a confirmation code for authorization via WAID without a browser. ### Parameters - **value** (String) - Required - Email or phone number to which a confirmation code should be sent - **type** (Enum) - Required - Value type (.email/.phone) - **success** (Closure) - Required - Closure performed after the method has been executed ``` -------------------------------- ### checkUserAuth Source: https://github.com/1312inc/webasyst-x-ios-pod/blob/main/README.md Updates the user token and verifies authorization status. ```APIDOC ## checkUserAuth(completion: (UserStatus) -> Void) ### Description Updates the user token and checks authorization, returning the user's status in the application. ### Parameters - **completion** (Closure) - Required - Callback returning user status ``` -------------------------------- ### sendConfirmCode(type:code:success:) Source: https://github.com/1312inc/webasyst-x-ios-pod/blob/main/README.md Sends a confirmation code to the server to complete authorization. ```APIDOC ## sendConfirmCode(type:code:success:) ### Description Sending a confirmation code after calling the getAuthCode method or after reading qr-code. ### Parameters - **type** (Any) - Required - Type of confirmation code - **code** (String) - Required - Code received by user by e-mail or text message or qr content - **success** (Closure) - Required - Closure performed after the method has been executed ``` -------------------------------- ### requestFullScreenConfetti(viewController:) Source: https://github.com/1312inc/webasyst-x-ios-pod/blob/main/README.md Triggers a confetti animation on the specified view controller. ```APIDOC ## requestFullScreenConfetti(viewController:) ### Description Start a confetti animation for selected viewController. ### Parameters - **viewController** (UIViewController) - Required - UIViewController for which the confetti animation will be called ``` -------------------------------- ### logOutUser Source: https://github.com/1312inc/webasyst-x-ios-pod/blob/main/README.md Logs out the user and clears local data. ```APIDOC ## logOutUser(completion: (Bool) -> Void) ### Description Logs out the user from the account and deletes all associated records in the database. ### Parameters - **completion** (Closure) - Required - Callback returning success status ``` -------------------------------- ### Define AuthResult enumeration Source: https://github.com/1312inc/webasyst-x-ios-pod/blob/main/README.md Represents the server response statuses when requesting authentication via WAID. ```swift AuthResult Server response when authentication is requested Values: `success`: Successful request Tokens saved in Keychain. `no_channels`: Incorrect clientId. `invalid_client`: Not transmitted code_challenge. `require_code_challenge`: Not transmitted code_challenge. `invalid_email`: An invalid string is passed as an email. `invalid_phone`: An invalid string is passed as a phone number. `request_timeout_limit`: Repeat request was sent before timeout was expired. `sent_notification_fail`: The server was unable to send the code. `server_error`: Server error. `undefined`: Unknown error, in the value error, transmits the text of the error. ``` -------------------------------- ### getProfileData Source: https://github.com/1312inc/webasyst-x-ios-pod/blob/main/README.md Retrieves user profile information. ```APIDOC ## getProfileData() -> ProfileData ### Description Returns the current user's profile data. ``` -------------------------------- ### updateUserImage Source: https://github.com/1312inc/webasyst-x-ios-pod/blob/main/README.md Updates the current user's profile image. ```APIDOC ## updateUserImage(image: Image, success: (Result) -> Void) ### Description Updates the current user image and returns the result via a closure. ### Parameters - **image** (Image) - Required - The image to upload - **success** (Closure) - Required - Callback returning success or error ``` -------------------------------- ### deleteAccount Source: https://github.com/1312inc/webasyst-x-ios-pod/blob/main/README.md Deletes the current user account. ```APIDOC ## deleteAccount(completion: (Result) -> Void) ### Description Sends a request to delete the current account and returns the operation result. ### Parameters - **completion** (Closure) - Required - Callback returning deletion result or error ``` -------------------------------- ### changeCurrentUserData Source: https://github.com/1312inc/webasyst-x-ios-pod/blob/main/README.md Updates the current user's profile data. ```APIDOC ## changeCurrentUserData(profile: ProfileData, success: (Result) -> Void) ### Description Updates user profile information with the provided data model. ### Parameters - **profile** (ProfileData) - Required - The user data model - **success** (Closure) - Required - Callback returning success or error ``` -------------------------------- ### deleteUserImage Source: https://github.com/1312inc/webasyst-x-ios-pod/blob/main/README.md Deletes the current user's profile image. ```APIDOC ## deleteUserImage(image: Closure) ### Description Removes the current user image and returns the result via a closure. ### Parameters - **image** (Closure) - Required - Callback returning success or error ``` -------------------------------- ### mergeTwoAccs Source: https://github.com/1312inc/webasyst-x-ios-pod/blob/main/README.md Merges two WAID contacts. ```APIDOC ## mergeTwoAccs(completion: (Result) -> Void) ### Description Opposes a new free WAID contact connected to an application with another existing WAID contact. ### Parameters - **completion** (Closure) - Required - Callback returning merge result or error ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.