1

I have little bit confuse between graph api result.Can any one explain which default object method is facebook using when we fetch data via graph api. Have any application account setting for access data in json object or in array object, because some time i found user data in encrypted and some time non encrypted. I found user email id in two way from facebook graph api. One is:

{
   "id": "100001114785800",
   "name": "Stella Jackson",
   "first_name": "Stella",
   "last_name": "Jackson",
   "link": "http://www.facebook.com/profile.php?id=100001114785800",
   "birthday": "04/16/1987",
   "gender": "female",
   "email": "[email protected]",
   "timezone": 5.5,
   "locale": "en_US",
   "updated_time": "2010-10-08T13:26:10+0000"
}

And second one is:

{
   "id": "100001114785800",
   "name": "Stella Jackson",
   "first_name": "Stella",
   "last_name": "Jackson",
   "link": "http://www.facebook.com/profile.php?id=100001114785800",
   "birthday": "04/16/1987",
   "gender": "female",
   "email": "stella_ja\u0040live.com",
   "timezone": 5.5,
   "locale": "en_US",
   "updated_time": "2010-10-08T13:26:10+0000"
}

Have any idea?

Thanks

1
  • Any JSON parser should read both those emails as the same. \u0040 is just the escaped version of the at-sign. Commented Jan 22, 2011 at 6:58

5 Answers 5

1

The '\u0040' is same as obfuscated or Unicode form of '@' symbol. Most Parsers can convert that to the original symbol.

Check this for list of Unicode character set.

http://www.alanwood.net/demos/ansi.html

Sign up to request clarification or add additional context in comments.

2 Comments

I am fetching facebook user information on my site last 2 month, it returned the user email like '[email protected]' but suddenly two day ago facebook provide email with Unicode like 'stella_ja\u0040live.com'. This issue give error on my registration page for invalid email. I have solved this error to parse facebok return data in json_decode, But i want to know why suddenly i get user email with Unicode character from facebook. Why???
Thats a big why.. but i dont know why.. i tried with a sample app and i still got the proper emailID no unicodes..
1

@Vik i want to do the same thing, collect post info in array, try this if it work than see..

   if (response.authResponse) {
    var accessToken =    response.authResponse.accessToken;
        //var UserInfo = document.getElementById('UserInfo'); 
        FB.api('/' + info.id + '/feed?access_token=' + accessToken, 
                    { limit: 20 },function(result) {

        UserInfo.innerHTML = "Welcome, " +  result.id + "!";
        alert('Message: ' + result.id);
            });
                                }  

Comments

0

Use this to get the dictionary n value of email for ios

FbGraphResponse *fb_graph_response = [fbGraph doGraphGet:@"me" withGetVars:nil];
NSLog(@"getMeButtonPressed:  %@", fb_graph_response.htmlResponse);
NSDictionary *dictionary=[fb_graph_response.htmlResponse JSONValue];
NSLog(@"%@",[dictionary valueForKey:@"email"]);

Hope it helps you.

Comments

0

The easiest way would be to take the email string and do something like this (objective c):

NSString *email = @"stella_ja\u0040live.com"; // or whatever you use to get it
email = [NSString stringByReplacingOccurencesOfString:@"\u0040" withString:@"@"];

So in other words, use string methods to replace "\u0040" with "@".

Comments

0

you can simply replace \u0040 with @ but during this replace compiler will consider "\" as escape sequence and will skip this without making changes.

What you do like this below:

NSString *strEmail = @"stella_ja\u0040live.com";
[strEmail stringByReplacingOccurrencesOfString:@"\\u0040" withString:@"@"];
NSLog(@"strEmail: %@", strEmail);

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.