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
nidhicdn
Posts: 45
Registered: ‎10-25-2012
My Device: 8520
Accepted Solution

Browser field Issue

I want to use browser field for fb login .  I have made own .net website for fb login. It is working fine  in all devices.  I am devoloping it  in os 5.0. It is not working in 9800 device . If I click facebook button on that website , browser field unable to redirect on other page.

 

plz help its urgent.

 

My code is

 


    
    BrowserFieldConfig myBrowserFieldConfig = new BrowserFieldConfig();
    myBrowserFieldConfig.setProperty(BrowserFieldConfig.NAVIGATION_MODE,BrowserFieldConfig.NAVIGATION_MODE_POINTER);
    final BrowserField browserField = new BrowserField(myBrowserFieldConfig);

    final ProtocolController pc = (ProtocolController) browserField.getController();
    //
    
    pc.setResourceRequestHandler("http", new BrowserFieldResourceRequestHandler() {
        
        public InputConnection handleResource(BrowserFieldRequest request)
                throws Exception {
            InputConnection inputConnection =
                      browserField.getConnectionManager().makeRequest(request);
        String     urll=request.getURL();

        
             if ((urll.indexOf("Flag=1") != -1)){
                
             }
            
             return inputConnection;
        }
    });
    
    pc.setNavigationRequestHandler("http", new BrowserFieldNavigationRequestHandler() {
        public void handleNavigation(BrowserFieldRequest request) throws Exception {
            // intercept();  //Intercept the request and my handler
            InputConnection ic = pc.handleResourceRequest(request);
            browserField.displayContent(ic, request.getURL());
            String u=request.getURL();

            int i=u.lastIndexOf('&');
            String subString=u.substring(i+1);

            if(subString.equalsIgnoreCase("Flag=1")){
                
            }
        }
    });
    browserField.requestContent("http://197.255.212.150/fbauth/Account/Login?IMINumber="+DeviceInfo.getDeviceId()+";deviceside=false;...

 

 

Please use plain text.
Developer
peter_strange
Posts: 19,604
Registered: ‎07-14-2008
My Device: Not Specified

Re: Browser field Issue

[ Edited ]

Sorry, I am confused by a number of aspects of this question.

 

If I understand you correctly, you are logging in to Facebook by proxying your request through your own web site.  So the BlackBerry does not log in - you do this on your web site, and then your BlackBerry application just communicates with your web site.

 

Is this correct?

 

if this is not correct, can you describe the process you are actually using, and why your web site is important in this process. 

 

You say this process is working fine on all devices, except for the 9800.  On that device the page does not redirect. 

 

Can you tell us some additional details:

a) What other devices and OS's have you tested on?

b) Can you describe the process you are using to log in - in other words what does your BrowserField actually do during the various phases of the Facebook log in. 

c) Are you having this problem on the Simulator or on the real device? 

d) On the device that is having  problems, does the Browser work correctly?  Can you use it to log in to the Facebook web site directly for example?

Please use plain text.
Contributor
nidhicdn
Posts: 45
Registered: ‎10-25-2012
My Device: 8520

Re: Browser field Issue

[ Edited ]

yes you are correct .

 

a) My application start from OS 5.0 so , I Made it in JDE 5.0 , I have tested on simulator 8520,8900,9900,9000 , it is working fine.

 

b) I have open my .net website in browser field (This website is just  using for fb  login  ). The first page contain the facebook button in the website , If I successful login through this website , they will give me access token in the url  and If  I got access token in the url then I push my home screen. This is the whole process.

                            But my problem is if I open  the website in browser field the first page is open properly , after that  If I click on facebook button  on that page the same page is open all time in 9800 simulator.

 

c) I am testing it on simulator not on real device (It is working in other simulator 8520,8900,9900,9000  simulator)

 

d) It is working in 9800 browser  in simulator. But not on browser field

 

 

Please use plain text.
Developer
peter_strange
Posts: 19,604
Registered: ‎07-14-2008
My Device: Not Specified

Re: Browser field Issue

I have had issues in a number of Simulators with the implementation of the BrowserField.  One I know I have problems with is the 9800.  My immediately suspicion is that there is an issue with that SImulator.  Download a 9800 Simulator with a later level of OS and try on that, or try it on a real 9800 device. 

Please use plain text.
Contributor
nidhicdn
Posts: 45
Registered: ‎10-25-2012
My Device: 8520

Re: Browser field Issue

[ Edited ]

Ok first I will test it on device . Thanks for reply. :smileyhappy:

Please use plain text.
Contributor
nidhicdn
Posts: 45
Registered: ‎10-25-2012
My Device: 8520

Re: Browser field Issue

Yes it is working in device . Thanks :smileyhappy: .

Please use plain text.