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

Reply
Contributor
paroxysm
Posts: 35
Registered: ‎09-15-2012
My Device: AT&T Torch 9810
Accepted Solution

Conflicting information about BB10 user agent.

If you were to read this post, you'd think that 'BB10' is the user agent for detecting BB10. However, after testing this out on the BB10 simulators from 10.0.10.672 to 10.1.0.1483 I found that it's not the case but 'BlackBerry10' instead, I also deployed on a bb10 device and it had the same user agent. Is this post outdated?

Retired
erikjohnzon
Posts: 245
Registered: ‎09-21-2012
My Device: Q10

Re: Conflicting information about BB10 user agent.

BB10 Should be in the user agent header. I tested this morning on a device and it indeed was. I'm not sure about the simulator. Here is what I saw:

 

Mozilla/5.0 (BB10; Kbd) AppleWebKit/537.35+ (KHTML, like Gecko) Version/10.0......

 

 

You can also see the code that BBUI uses for detection which has changed. It uses the BB10 property as well.

 

https://github.com/blackberry/bbUI.js/commit/b716a3528a89404d55622362242731a20ce4a782

 

Hope that helps!

@erikjohnzon
erjohnson@blackberry.com
Developer
peardox
Posts: 1,229
Registered: ‎03-20-2011
My Device: Playbook, Z10 LE, Dev Alpha B, 2x Dev Alpha C

Re: Conflicting information about BB10 user agent.

Z10 ST 100-1 - 10.0.9.2372

 

"Mozilla/5.0 (BB10; Touch) AppleWebKit/537.10+ (KHTML, like Gecko) Version/10.0.9.2372 Mobile Safari/537.10+

 

Dev Alpha C - 10.1.0.1483

 

Mozilla/5.0 (BB10; Kbd) AppleWebKit/537.10+ (KHTML, like Gecko) Version/10.1.0.1485 Mobile Safari/537.10+

 




Click the like button if you find my posts useful!
Contributor
paroxysm
Posts: 35
Registered: ‎09-15-2012
My Device: AT&T Torch 9810

Re: Conflicting information about BB10 user agent.

This is indeed strange, one thing I forgot to mention that could potentially be an issue, is that I was debugging a webworks app on the simulator  when I spotted this inconsistency. I was trying to find out why the framework wasn't applying BB10 styling to elements and it was that 'navigator.userAgent' was returning 'BlackBerry10'. I have a screenshot if that helps, see.

Developer
peardox
Posts: 1,229
Registered: ‎03-20-2011
My Device: Playbook, Z10 LE, Dev Alpha B, 2x Dev Alpha C

Re: Conflicting information about BB10 user agent.

Can I suggest that you get the latest Sim?

 

It really depends on which version you're using as to what you'll get back

 

I must admit I've not tested this but try the current download and you should get something very close to delivery

 

I know my Dev Alpha reacts in very much the same way

 

If you want to identify a specific model of device search for Advertizing in the box above - this will lead you to a github extension we've been mustally discussing for the last few weeks that can tell you what you need to know




Click the like button if you find my posts useful!
Contributor
paroxysm
Posts: 35
Registered: ‎09-15-2012
My Device: AT&T Torch 9810

Re: Conflicting information about BB10 user agent.

I'm sorry, I don't understand your statement about the github extension. And I do indeed have the latest simulator 10.1.0.1483 and the latest webworks SDK.
Developer
peardox
Posts: 1,229
Registered: ‎03-20-2011
My Device: Playbook, Z10 LE, Dev Alpha B, 2x Dev Alpha C

Re: Conflicting information about BB10 user agent.

Sorry for that - you want to look at something more advanced...

 

https://github.com/blackberry/WebWorks-Community-APIs/tree/master/BB10/deviceInfo

 

Read the instructions

 

This, allied with other APIs lets you identify a device properly




Click the like button if you find my posts useful!
Contributor
paroxysm
Posts: 35
Registered: ‎09-15-2012
My Device: AT&T Torch 9810

Re: Conflicting information about BB10 user agent.

Turns out I was overriding my userAgent with a rim:userAgent attribute in my config.xml, pretty much shot myself in the foot :smileyhappy: