Oauth.io Fitbit request not working after relaunching app

196 views Asked by At

I am able to request Fitbit data using Oauth.io service but only as long as the app is running. Once the app relaunches the request call no longer works. Does the Fitbit token and secret need to be saved and retrieved after the app is launched ? If so, how is this done?

Request code I am using. I am also using the Oauth.io framework.

[_request_object get:@"https://api.fitbit.com/1/user/-/activities/date/2012-02-25.json" success:^(NSDictionary *output, NSString *body, NSHTTPURLResponse *httpResponse)
 {
     NSLog(@"status code:%i\n", httpResponse.statusCode);
     NSLog(@"name:%@, \n", [output objectForKey: @"steps"]);
     NSLog(@"name:%@", body);
     NSLog(@"name:%@", output);

 }];
1

There are 1 answers

0
Anna Billstrom On

You need to use the cache options so that ios has access to the tokens persistenty through usage. See https://github.com/oauth-io/oauth-ios, "Using the cache."