let sdkInitializedSuccessfully = MobileRTC.shared().initialize(context)
if sdkInitializedSuccessfully == true, let authorizationService = MobileRTC.shared().getAuthService() {
authorizationService.clientKey = sdkKey
authorizationService.clientSecret = sdkSecret
authorizationService.jwtToken = "xxxxxxx"
authorizationService.delegate = self
authorizationService.sdkAuth()
}
}
This is my callback method in AppDelegate.
func onMobileRTCLoginReturn(_ returnValue: Int) {
switch returnValue {
case 0:
print("Successfully logged in")
// This alerts the ViewController that login was successful. NotificationCenter.default.post(name: Notification.Name("userLoggedIn"), object: nil)
case 1002:
print("Password incorrect")
default:
print("Could not log in. Error code: \(returnValue)")
}
}
Can you please confirm whether or not you are receiving the onMobileRTCAuthReturn callback before trying to log in? If so, what is the returnValue from that callback?
Perviously I used the device only SDK at that time onMobileRTCAuthReturn is called but later I used SDK for mobile and Simulator and I run the app on simulator but onMobileRTCAuthReturn is not fired.
No I run the app in actual device with iPhone X and I found onMobileRTCAuthReturn is not fire. Is it possible that if JWT is incorrect that reason onMobileRTCAuthReturn not trigger?
This is How i’m creating the JWT
import SwiftyJWT
let alg = JWTAlgorithm.hs256(“secret”)
let headerWithKeyId = JWTHeader.init(keyId: “”)
I am suspecting that the JWT payload may be generated incorrectly. To verify this, can you create a JWT through JWT.io and hardcode it into your application to see if this above code is causing the issue? Instructions for doing so can be found here: "auth sdk failed" when running zoom sdk demo - #7 by Michael_Condon