If you are using Internet Explorer, please remove blackberry.com from your compatibility view settings.

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
Developer
dtater
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?

- - - - - - - - - -
Please use plain text.
Developer
dtater
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?

- - - - - - - - - -
Please use plain text.
BlackBerry Development Advisor
oros
Posts: 1,552
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.
Please use plain text.
Developer
dtater
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.

 

- - - - - - - - - -
Please use plain text.
BlackBerry Development Advisor
oros
Posts: 1,552
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.
Please use plain text.