开发者

Need help returning to BlackBerry application from BrowserSession

My BlackBerry application is using a BrowserSession to open up a web page. When the web page opens up, the user will type in their login credentials, and then they are forwarded to a new website which tells them to close the BlackBerry Browser and return to my application. (...OAuth authentication)

Now, I am trying to see if I can do one of the following:

  • Create a custom URI scheme for my application, so that the 开发者_JS百科website can forward to an address such as "myapp://..." and my application will open up. I have been researching online and on the forums about this, and I don't think its possible. I have been searching a lot about JSR 211 and content handlers and MIME types. I also looked into the chapidemo demo in the JDE samples.

  • Close the BrowserSession. I know that I cannot do this from within my application. I successfully moved my application to the foreground after my application made a successful http request, but the browser comes BACK to the foreground when the website forwards to the new page (which tells the user to close the browser)

  • Somehow determine the URL of the current BrowserSession. If I could do that, then I could have my application to the foreground when I recognize the URL of the page that was forwarded to.

Unfortunately, I cannot use a BrowserField because the site that I open up in the browser needs to support javascript and ajax...I tried this in the BrowserField, and it didn't work.

Does anyone have any advice or suggestions?

Thanks!


Update:

My code to register:

BrowserContentProviderRegistry converterRegistry = BrowserContentProviderRegistry
                .getInstance();
        if (converterRegistry != null) {
            converterRegistry.register(new BrowserPlugin());
        }


You could use the BrowserContentProviderRegistry class to register a custom BrowserContentProvider implementation for your app with a custom MIME type. When OAuth is done, have it redirect to a page on your website that serves up a document with that MIME type. This will cause your BrowserContentProvider to be executed which can then do anything you like, such as bring your application back into the foreground.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜