0

iphone sdk- unable to fetch user data

Hello ,

I have used below code for fetching the user data .
But it was giving below error.
Please help if any body has done it before

JSONValue failed. Error trace is: (
    "Error Domain=org.brautaset.JSON.ErrorDomain Code=3 \"Unrecognised leading character\" UserInfo=0x4e85810 {NSLocalizedDescription=Unrecognised leading character}"
  1. - (void)sendRequests {  
  2.   // initialize a user request for the logged-in user     
  3.   YOSUserRequest *request = [YOSUserRequest requestWithSession:session];  
  4.      
  5.   // fetch the user's profile data  
  6.   YOSResponseData *userProfileResponse = [request   
  7.                                          fetchProfileWithDelegate:self];  
  8. }  
  9.   
  10. - (void)requestDidFinishLoading:(YOSResponseData *)data {  
  11.   // parse the response text string into a dictionary  
  12.   NSDictionary *rspData = [data.responseText JSONValue];  
  13.   NSDictionary *profileData = [rspData objectForKey:@"profile"];  
  14.     
  15.   // format a string using the nickname object from the profile.  
  16.   NSString *welcomeText = [NSString stringWithFormat:@"Hey %@ %@!",   
  17.      [profileData objectForKey:@"givenName"],  
  18.      [profileData objectForKey:@"familyName"]];  


0 Replies
This forum is locked.

Recent Posts

in Y!OS SDKs