Private project in the SDK Single mode

Login view

If you use the contentDock SDK in Single Mode and publish a private contentApp with the contentDock Management System, then the user have to enter his username and password when opening the App. All users who should have access to your private contentApp are managed in the contentDock Management System in the respective contentApp in the Users area. You can design the Login View according to your wishes. As soon as the user has entered the login data, they must be authenticated. For this the contentDock SDK has the function login.

Example for the login view
import UIKit
import CDockFramework

@objc(CustomElementsFunctionsSwift)

class VLogin: UIView {
    
    // Your individual login view
    // ...


    @objc func onBtnLoginTapped() {
        CDockSDK.login(with: tfLogin.text ?? "", password: tfPassword.text ?? "", 
        domain: "Your contentDock Web Address") { isSuccess in
            if isSuccess {
                print("success")
            }
            else {
                print("login failed")
            }
        }
    }
}

SDKLogin Callback

If you are using a private contentApp in the SDK Single Mode, then the user is required to authenticate before. All users who are allowed to use a private contentApp are configured in the contentDock Management System in the user configuration of the respective contentApp.

Example for the login callback
import UIKit
import CDockFramework

@objc(CustomElementsFunctionsSwift)

class CustomElementsFunctionsSwift: NSObject {


    @objc class func SDKLogin(_ loginView: UIView) {
        let v = VLogin(frame: loginView.bounds)
        v.autoresizingMask = [.flexibleWidth, .flexibleHeight]
        loginView.addSubview(v)
    }
}

class VLogin: UIView {
    
    // Your individual login view
    // ...


    @objc func onBtnLoginTapped() {
        CDockSDK.login(with: tfLogin.text ?? "", password: tfPassword.text ?? "", 
        domain: "Your contentDock Web Address") { isSuccess in
            if isSuccess {
                print("success")
            }
            else {
                print("login failed")
            }
        }
    }
}

More information


Feedback or Questions

We are always happy to help you with questions about the code or other questions.

Was this page helpful? Yes No

Topics on this page