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

Web and WebWorks Development


Thank you for visiting the BlackBerry Support Community Forums.

BlackBerry will be closing the BlackBerry Support Community Forums Device Forums on April 1st (Developers, see below)

BlackBerry remains committed to providing excellent customer support to our customers. We are delighted to direct you to the CrackBerry Forums, a well-established and thorough support channel, for continued BlackBerry support. Please visit http://forums.crackberry.com or http://crackberry.com/ask. You can also continue to visit BlackBerry Support or the BlackBerry Knowledge Base for official support options available for your BlackBerry Smartphone.

"When we launched CrackBerry.com 10 years ago, we set out to make it a fun and useful destination where BlackBerry Smartphone owners could share their excitement and learn to unleash the full potential of their BlackBerry. A decade later, the CrackBerry community is as active and passionate as ever and I know our knowledgeable members and volunteers will be excited to welcome and assist more BlackBerry owners with their questions."

- Kevin Michaluk, Founder, CrackBerry.com

Developers, for more information about the BlackBerry Developer Community please review Join the Conversation on the BlackBerry Developer Community Forums found on Inside BlackBerry.


Reply
Highlighted
New Developer
Posts: 70
Registered: ‎01-13-2011
My Device: Torch 9800 and Playbook
My Carrier: Rogers

How Can I Redirect to a Page in My WebWorks App from and External Site

I have an entire functioning client side only OAuth flow working on my desktop browser. My next step is to make that work in a PlayBook WebWorks app. I can make it to the twitter authorization page, but after I authenticate Twitter can't redirect me to to my page at local:///index.html

 

Is there another way to directly access WebWorks app files?

Retired
Posts: 518
Registered: ‎07-18-2011
My Device: Bold
My Carrier: Rogers

Re: How Can I Redirect to a Page in My WebWorks App from and External Site

Hi pnewhook,

 

I believe something like the snippet below should work for you

window.location = window.location.origin + window.location.pathname.replace("oauth2callback.html", "index.html");

 



1.Please resolve your thread by clicking the "Accept as Solution" button below the post which solved your problem!
2. If any post helps you please click the button below the post(s)
New Developer
Posts: 70
Registered: ‎01-13-2011
My Device: Torch 9800 and Playbook
My Carrier: Rogers

Re: How Can I Redirect to a Page in My WebWorks App from and External Site

Sorry, I don't think I explained my problem well enough. My problem lies in the fact that Twitter wants to redirect me to http://index.html in favour of 'local://' even though I've explicitly stated local:///index.html is where I want to go. 

 

I have this working on a local webserver using localhost, but that's ultimately over HTTP, is there a way to refer to a file in a WebWorks application with an http address?

Developer
Posts: 817
Registered: ‎11-19-2009
My Device: Z10, Q10, 9900, 9790, PlayBook,
My Carrier: T-Mobile UK, Three, O2, Orange, Sunrise, Swisscom

Re: How Can I Redirect to a Page in My WebWorks App from and External Site

You simply have to give a callback parameter to Twitter.

--
Olivier - interfaSys ltd
Developing for BlackBerry 10 devices using the Sencha Touch framework.
New Developer
Posts: 70
Registered: ‎01-13-2011
My Device: Torch 9800 and Playbook
My Carrier: Rogers

Re: How Can I Redirect to a Page in My WebWorks App from and External Site

Hi interfaSys, I do give a callbackUrl to twitter, but the problem is because that's a page in a local application, twitter doesn't want to redirect to it. I need some way of aliasing local files to HTTP addresses, like localhost on a desktop.

Developer
Posts: 817
Registered: ‎11-19-2009
My Device: Z10, Q10, 9900, 9790, PlayBook,
My Carrier: T-Mobile UK, Three, O2, Orange, Sunrise, Swisscom

Re: How Can I Redirect to a Page in My WebWorks App from and External Site

[ Edited ]

Have you tried with 127.0.0.1 or local:/index.html (single slash)?

What does 'location.href' return?

 

(I'm not in front of a dev env atm and use oob for now)

--
Olivier - interfaSys ltd
Developing for BlackBerry 10 devices using the Sencha Touch framework.
Developer
Posts: 817
Registered: ‎11-19-2009
My Device: Z10, Q10, 9900, 9790, PlayBook,
My Carrier: T-Mobile UK, Three, O2, Orange, Sunrise, Swisscom

Re: How Can I Redirect to a Page in My WebWorks App from and External Site

I just did a test and after authorization, Twitter loaded index.html at local:///index.html.

--
Olivier - interfaSys ltd
Developing for BlackBerry 10 devices using the Sencha Touch framework.