需要帮助返回从BrowserSession黑莓应用程序 [英] Need help returning to BlackBerry application from BrowserSession
问题描述
我的黑莓手机应用程序使用BrowserSession打开一个网页。当网页打开时,该用户将输入他们的登录凭据,然后他们被转移到一个新的网站,告诉他们关闭BlackBerry浏览器并返回到我的应用程序。 (... OAuth认证)
现在,我想看看我是否可以做以下之一:
-
创建我的应用程序自定义的URI方案,使网站可以转发到一个地址,如的myapp:// ......和我的应用程序将打开。我一直在研究网上和这个论坛,我不认为它可能。我一直在寻找大约211 JSR和内容处理程序和MIME类型很多。我也看了成JDE样品中chapidemo演示。
-
关闭BrowserSession。我知道我无法从我的应用程序中做到这一点。我成功地移动我的应用程序到前台后,我的应用程序进行了成功的http请求,但是浏览器又回到前台时,该网站转发到新的页面(它告诉用户关闭浏览器)
-
不知怎的,确定当前BrowserSession的URL。如果我能做到这一点,那么我可以有我的应用程序切换到前台时,我认识到,被转发到页面的URL。
不幸的是,我不能,因为我在浏览器中打开该网站需要支持JavaScript和Ajax使用BrowserField ......我在BrowserField尝试这样做,并没有工作。
有没有人有任何意见或建议?
谢谢!
更新:
我的code注册:
BrowserContentProviderRegistry converterRegistry = BrowserContentProviderRegistry
.getInstance();
如果(converterRegistry!= NULL){
converterRegistry.register(新BrowserPlugin());
}
您可以使用 BrowserContentProviderRegistry 类注册自定义的<一个href=\"http://www.blackberry.com/developers/docs/5.0.0api/net/rim/device/api/browser/plugin/BrowserContentProvider.html\"相对=nofollow> BrowserContentProvider 实现具有自定义MIME类型您的应用程序。当OAuth的完成,有它重定向到您网站上的一个页面,提供了MIME类型的文档。这将导致你的BrowserContentProvider被执行,那么它可以做任何你喜欢的,比如把你的应用程序返回到前台。
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 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.
这篇关于需要帮助返回从BrowserSession黑莓应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!