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
Developer
Posts: 158
Registered: ‎01-11-2010
My Device: 9700 | 9900 | PlayBook | Dev Alpha
My Carrier: Many :)
Accepted Solution

issue or bug with blackberry.system.hasPermission('location.maps')

Hey all.  Can somebody help me understand why this function (see code below) is not working as it should?

 

This code returns false on my 9900... Even though Maps is enabled (i have the icon on my home screen) and applications like foursquare and Poynt can use / make calls to BB Maps.  I can even call BBMaps from within my own application if i ignore the result of this function

 

 

function checkIfBBMaps(){

	var rslt = blackberry.system.hasPermission('location.maps'); 

	console.error("checkIfBBMaps:  rslt is:"+ rslt);

	if(rslt === true){
		return true;
	} else {
		console.error("checkIfBBMaps:  WE DONT HAVE MAPS");
		return false;
	}


}

 Thoughts?

- - - - - - - - - -
Developer
Posts: 158
Registered: ‎01-11-2010
My Device: 9700 | 9900 | PlayBook | Dev Alpha
My Carrier: Many :)

Re: issue or bug with blackberry.system.hasPermission('location.maps')

*bump*  Nobody has had this issue?

- - - - - - - - - -
Retired
Posts: 1,561
Registered: ‎04-12-2010
My Device: BlackBerry Z10
My Carrier: Bell

Re: issue or bug with blackberry.system.hasPermission('location.maps')

[ Edited ]

Hi there,

 

Based on the description:

 

Determines the level of access to the requested module- the BlackBerry WebWorks namespace or class to check for access. For example blackberry.system, blackberry.app.

https://developer.blackberry.com/html5/apis/blackberry.system.html#.hasPermission

 

To me it seems that this is API is to check whether specific WebWorks APIs have been granted permission (potentially through the config.xml, etc.) As location.maps is not an API, it would make sense to return false.

 

Perhaps you are after the hasCapability function?

https://developer.blackberry.com/html5/apis/blackberry.system.html#.hasCapability


Erik Oros | @WaterlooErik | eoros@blackberry.com | Developer Issue Tracker

If a reply has answered your question, please click Accept as Solution to help other visitors in the future.
Developer
Posts: 158
Registered: ‎01-11-2010
My Device: 9700 | 9900 | PlayBook | Dev Alpha
My Carrier: Many :)

Re: issue or bug with blackberry.system.hasPermission('location.maps')

[ Edited ]

I am an **bleep**! 

 

hasPermission() != hasCapability().

 

Oh wow. 

 

Time for me to get more coffee, i think!.

 

 

Edit:  really?!?!  the word 'i d i 0 t' is censored!  wow.

 

- - - - - - - - - -
Highlighted
Retired
Posts: 1,561
Registered: ‎04-12-2010
My Device: BlackBerry Z10
My Carrier: Bell

Re: issue or bug with blackberry.system.hasPermission('location.maps')

Heh, it happens to all of us from time to time :-)

Erik Oros | @WaterlooErik | eoros@blackberry.com | Developer Issue Tracker

If a reply has answered your question, please click Accept as Solution to help other visitors in the future.