I'm utilizing the facebook log in from Azure SDK, I'm utilizing the following code in a button:
-(void)fblogin
{
[_azureService.client loginWithProvider:@"facebook" urlScheme:@"dribel" controller:self animated:YES completion:^(MSUser * _Nullable user, NSError * _Nullable error)
{
if (error)
{
NSLog(@"Login failed with error: %@, %@", error, [error userInfo]);
}
else
{
_azureService.client.currentUser = user;
NSLog(@"User logged in: %@", user.userId);
[self fblogin];
}
}];
}
A webview like this, opens and does all the facebook log in process...
And when it ends, it calls the following method in the app delegate and since it's true, it resumes the log in flow...
- (BOOL)application:(UIApplication *)application openURL:(NSURL *)url options:(NSDictionary<UIApplicationOpenURLOptionsKey,id> *)options
{
if ([[url.scheme lowercaseString] isEqualToString:@"dribel"])
{
// Resume login flow
return [self.azureService.client resumeWithURL:url];
}
else {
return NO;
}
}
but the webview is supposed to be dismissed and after being dismissed the code is supposed to land on the else statement of the first piece of code, but it's not doing anything. I have to press done and lands on the if true statement and it says I canceled it. Does anyone has an idea of what could be wrong?
We have set up the external url in the azure portal to redirect to the correct appname:// so that's why it we get true in the app delegate. But what else is missing?