Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Java Development

Reply
Contributor
Posts: 26
Registered: ‎01-18-2011
My Device: Not Specified

Re: Facebook SDK problems

Hi,

 

        I m trying  add your code but i get this error

     CompileError in ExecuteMethod Error! on line 5: Unexpected 'native'..
    [native code]

Developer
Posts: 177
Registered: ‎01-21-2009
My Device: 9900
My Carrier: Vodafone

Re: Facebook SDK problems

[ Edited ]

In your login url also pass the "scope" parameter as outlined in the authentication guide if you want to do anything with the user account: http://developers.facebook.com/docs/authentication/

 

List of permissions here: http://developers.facebook.com/docs/authentication/permissions

 

Sorry I'm not sure about your compile issue. I've never heard of that before. Can you provide more details?

Contributor
Posts: 26
Registered: ‎01-18-2011
My Device: Not Specified

Re: Facebook SDK problems

i just put this url on login screen

 

super(new StringBuffer()
                            .append("https://m.facebook.com/dialog/oauth?display=touch&type=user_agent&redirect_uri=fbconnect://success&c...").toString(),pfbc,cookieManager);

 

login screen will come but after username password submittion  login screen again come ,

and i diddnt get auth_token and accestoken also.

 

server response url are:

http://www.facebook.com/connect/uiserver.php?method=permissions.request&app_id=147610151925651&displ...

 

 

http://touch.facebook.com/login.php?app_id=147610151925651&cancel=fbconnect%3A%2F%2Fsuccess%2F%3Ferr...

%3D147610151925651%26display%3Dtouch%26redirect_uri%3Dfbconnect%253A%252F%252Fsuccess

%26type%3Duser_agent%26fbconnect%3D1%26perms%3Dpublish_stream%252Ccreate_event%26from_login%3D1

 

 

m i doing some thing wrong plz suggest me

 

 

 

Developer
Posts: 177
Registered: ‎01-21-2009
My Device: 9900
My Carrier: Vodafone

Re: Facebook SDK problems

Well I have some interesting things to report. As it turns out the url I suggested passing into the login screen is actually already done in PermissionScreen, so just use that. 

 

Read my post about implementing a url scraper function that you inject into the Browser redirect and url request events to scrape for the access_token. For whatever reason I've found that some implementations of the browser don't post a content changed event, or they loop back on the previous url and the fbconnect:// response is tossed out. Doesn't hurt to scrape for it early.

 

 

Contributor
Posts: 26
Registered: ‎01-18-2011
My Device: Not Specified

Re: Facebook SDK problems

Hi Pwerry,

                 Thanks for your quick feedback.

As I am novice to blackberry, could you please elaborate your previous reply.

I have tried using your code but still not getting access token string from server response...

 

 

Or can you send me the code for ----> login into the facebook through Blackberry and retrieve access token..

 

Please help, I'am stuck in this from one week .....

Contributor
Posts: 32
Registered: ‎01-18-2011
My Device: Curve 8900

Re: Facebook SDK problems

Hello everyone,

 

I started working with Blackberry Java Development recently and the first problem that occurred with all project we have is this Facebook problem.

 

I don't have much experience about issues solved by RIM and Facebook, so with your experiences, would you wait for an official release to solve this problem, or change the code on all applications using facebook and publish it fixed (many applications have 1,000+ users).

 

I'm worried if they fix it and this solution stops work after this, and have another version with problem.

Regular Contributor
Posts: 94
Registered: ‎08-07-2010
My Device: 9550

Re: Facebook SDK problems

Hai Jimmd,

 

As u said , i have changed url in constructor in LoginScreen , then i have posted on facebook account.

 and when i have added code in onAction() method of LoginScreen, I am  getting exception in read(path) of GraphContext class

 

my code in onAction() in loginscreen is ,

 

 

    public void onAction(Action event) {
        if (event.getSource() == this) {
            if (event.getAction().equals(ACTION_SUCCESS)
                    && getUrl().startsWith(settings.nextUrl)) {
                String url = getUrl();
                log.info("(LoginScreen.ACTION_SUCCESS) URL: " + url);
                int startIndex = url.indexOf("auth_token");
                if (startIndex > -1) {
                    int stopIndex = url.length();

                    if (url.indexOf('&', startIndex) > -1) {
                        stopIndex = url.indexOf('&', startIndex);
                    } else if (url.indexOf(';', startIndex) > -1) {
                        stopIndex = url.indexOf(';', startIndex);
                    }
                    String authToken = url.substring(url.indexOf('=',
                            startIndex) + 1, stopIndex);
                    log.debug("auth_token = " + authToken);
                    fireAction(ACTION_LOGGED_IN, authToken);
                }
            }
            if (event.getAction().equals(ACTION_LOGGED_IN)) {
                fbc.getApplicationSettings().sessionKey = (String)event.getData();
                try {
                    fbc.upgradeSession();
                } catch (FacebookException e) {
                    e.printStackTrace();
                }
                // now you have the access token...
                String accessToken = fbc.getApplicationSettings().accessToken;
                
            }
            
            
        }
    }

 

Contributor
Posts: 26
Registered: ‎01-18-2011
My Device: Not Specified

Re: Facebook SDK problems

Hello   gollapallysrinivas,

 

 

  will u get AUTH TOKEN ? Could  u send output (reponse url) you got from facebook server.

Developer
Posts: 201
Registered: ‎12-17-2010
My Device: Not Specified

Re: Facebook SDK problems

Hi,I used the blackberry's but I can't do the post,

 

just got the White screen label with Success so can you help me to change the status from my blackberry app.

 

If any one can help me please help me to come out from it.

 

Thank for reply....

Contributor
Posts: 16
Registered: ‎11-29-2010
My Device: Not Specified

Re: Facebook SDK problems

Hello Everyone,

 

Kindly tell me that how can i get Access token which i get on hitting  a link.

 

Lemme explain in detail

I have one server which asks for authentication by hitting one particular url given by them and after that they in return give me the access token key appended with the url which i need to fetch at my end to do further transactions 

Kindly let me know its solution

Thanks ,

Abhishek