You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
On iOS it seems the callback is never called and it seems it's an issue directly with the swift/objc implementation
request.send(self, completion: { resp in
guard let strongSelf = weakSelf else { return }
// STEP 3: Parse and handle the response
if resp.errCode.rawValue == 0 {
let responseCode = resp.code
// Upload response code to your server and obtain user access token
// ...
} else {
// User authorization failed. Handle errors
// ...
}
})
It never gets to the guard let strongSelf... line.
Complete code
@objc
func auth(_ callback: @escaping RCTResponseSenderBlock) {
// STEP 1: Create the request and set permissions
let scopes = ["user.info.basic,video.list"] // list your scopes
let scopesSet = NSOrderedSet(array: scopes)
let request = TikTokOpenSDKAuthRequest()
request.permissions = scopesSet
// STEP 2: Send the request
weak var weakSelf = self
request.send(self, completion: { resp in
guard let strongSelf = weakSelf else { return }
// STEP 3: Parse and handle the response
if resp.errCode.rawValue == 0 {
let responseCode = resp.code
// Upload response code to your server and obtain user access token
// ...
} else {
// User authorization failed. Handle errors
// ...
}
})
}
The text was updated successfully, but these errors were encountered:
On iOS it seems the callback is never called and it seems it's an issue directly with the swift/objc implementation
It never gets to the
guard let strongSelf...
line.Complete code
The text was updated successfully, but these errors were encountered: