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

Native Development

Reply
Contributor
Posts: 12
Registered: ‎12-15-2012
My Device: Z10
My Carrier: Omnitel

How to pass encoded & to browser through invocation framework?

It looks like my code is good but something is not working with encoded & symbol. Have I found yet another bug Smiley Happy.

 

Here is code:

 

Invocation {
id: linkInvocation
query: InvokeQuery {
id: linkInvocationQuery
}
onArmed: {
if (linkInvocationQuery.uri != '') {
console.log('Open URL: ' + linkInvocationQuery.uri);
trigger("bb.action.OPEN");
}
}
}

 

Now to open some URL I call following code:

 

linkInvocationQuery.uri = url;
linkInvocationQuery.updateQuery();

 

Now let's say my url is:

http://www.google.com/search?q=Macklemore%20%26%20Ryan%20Lewis%20Can't%20Hold%20Us%20lyrics

 

Notice that it has %26 that means &. Now when I call code above I see following in logs:

 

Open URL: http://www.google.com/search?q=Macklemore %26 Ryan Lewis Can't Hold Us lyrics

 

Interesting %26 is unescaped what is most probably OK. Now Browser gets following URL:

http://www.google.com/search?q=Macklemore%20%2526%20Ryan%20Lewis%20Can't%20Hold%20Us%20lyrics

 

Now %26 gets encoded to %2526. That actually means that I can't pass encoded & to invocation framework.

 

Any suggestions?

Highlighted
Contributor
Posts: 12
Registered: ‎12-15-2012
My Device: Z10
My Carrier: Omnitel

Re: How to pass encoded & to browser through invocation framework?

Little update: I have not found solution so I have replaced "&" to "and". It works in my situation.