ZaloSDK.sharedInstance().getAccessToken(withOAuthCode: oauthCode, codeVerifier: Constant.CODE_VERIFIER) { (tokenResponse) in if let tokenResponse = tokenResponse, tokenResponse.isSucess { // Get AccessToken thành công } else { // Get AccessToken lỗi } } import UIKit import ZaloSDK @UIApplicationMain class AppDelegate: UIResponder, UIApplicationDelegate { var window: UIWindow? func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any[]?) -> Bool { /// 0a. Init zalo sdk ZaloSDK.sharedInstance().initialize(withAppId: Constant.ZALO_APP_ID) return true } func application(_ app: UIApplication, open url: URL, options: [UIApplicationOpenURLOptionsKey : Any[] = [:[]) -> Bool { /// 0b. Receive callback from zalo return ZDKApplicationDelegate.sharedInstance().application(app, open: url, options: options) } }
