I'm new to iOS development. I'm trying to integrate Fitbit in my app. I followed get authorization from Fitbit using Oauth in iOS and FitBit documentation. I used following code
- (IBAction)fitbitLogin:(id)sender {
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"https://www.fitbit.com/oauth2/authorize?response_type=code&client_id=xyxyxy&redirect_uri=xxxxx&scope=activity%20nutrition%20heartrate%20location%20nutrition%20profile%20settings%20sleep%20social%20weight"]];
}
It launches the Safari app and I fill my credentials and tap Allow means an error is showing in Safari like "Safari cannot open the page because address is invalid". I'm new to iOS development and don't know how to proceed further. Can some one help me to solve this. thanks in advance.