I have integrated Tuya SDK in my flutter app for iOS. But while signing in, i am getting error saying "Verification failed".
Following is the detailed description of error
Error Domain=com.thing.www Code=1501 "Permission Verification Failed" UserInfo={NSLocalizedDescription=Permission Verification Failed, NSLocalizedFailureReason=SING_VALIDATE_FALED}
Here is the code in AppDelegate file
import UIKit
import Flutter
import ThingSmartBaseKit
@UIApplicationMain
@objc class AppDelegate: FlutterAppDelegate {
private var flutterResult: FlutterResult?
override func application(
_ application: UIApplication,
didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?
) -> Bool {
GeneratedPluginRegistrant.register(with: self)
ThingSmartSDK.sharedInstance().start(withAppKey: AppKeys.appKey, secretKey: AppKeys.secretKey)
#if DEBUG
ThingSmartSDK.sharedInstance()?.debugMode = true
#else
#endif
setMethodChannels()
return super.application(application, didFinishLaunchingWithOptions: launchOptions)
}
func setMethodChannels() {
if let controller = window?.rootViewController as? FlutterViewController {
let channel = FlutterMethodChannel(
name: "NativeBridgeChannel",
binaryMessenger: controller.binaryMessenger)
channel.setMethodCallHandler { [weak self]
(call: FlutterMethodCall, result: @escaping FlutterResult) -> Void in
self?.flutterResult = result
if call.method == "test" {
self?.tuyaLogin(result: result)
} else {
result(FlutterMethodNotImplemented)
}
}
}
}
func tuyaLogin(result: @escaping FlutterResult) {
ThingSmartUser.sharedInstance().loginOrRegister(withCountryCode: "+92", uid: "[email protected]", password: "1234567", createHome: false) { (res) in
result("Logged In")
} failure: { (error) in
let errorMessage = error?.localizedDescription ?? ""
print(error.debugDescription)
result(error.debugDescription)
}
}
}
I have double checked the BundleId, AppSecret key & App key, but again i am getting the same error.