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
Trusted Contributor
lathajagan
Posts: 114
Registered: ‎03-06-2013
My Device: Blackberry Z10
My Carrier: Airtel

Accessing permission list from settings

Hello,

My requirement goes like this,

I have an application where i can link phone numbers with local contacts and should show the names in place of numbers.

For that i am using : Rim:smileytongue:ermit attribute for adding access-pim-contacts and also used webworks contactfindoptions to get the phone numbers matched with names.

Now, when user goes to settings in phone and goes to security and permissions, in the permission list if he switches off contacts permission for my application, i should not able to able to do contact matching for my application.

So , my requirement is how to access permission list for my application from settings of phone.

Please help me out in solving this.

--------
- If a post contains the solution to the problem, please click "Accept as Solution"
- If a post contains helpful content, please give it a "Thumbs Up"

developer.blackberry.com
@BlackBerryDev
Please use plain text.
Trusted Contributor
lathajagan
Posts: 114
Registered: ‎03-06-2013
My Device: Blackberry Z10
My Carrier: Airtel

Re: Accessing permission list from settings

any help for this pls reply me back

--------
- If a post contains the solution to the problem, please click "Accept as Solution"
- If a post contains helpful content, please give it a "Thumbs Up"

developer.blackberry.com
@BlackBerryDev
Please use plain text.
Developer
peardox
Posts: 1,229
Registered: ‎03-20-2011
My Device: Playbook, Z10 LE, Dev Alpha B, 2x Dev Alpha C
My Carrier: 3, Orange, Vodafone

Re: Accessing permission list from settings

You're lucky I just posted (see Aplogies thread)

 

If I get this right you want to pick up the permissions you have in config.xml

 

I can do this later this week (Apologies applies)

 

PM me a reminder as the next few days are rather busy so I may forget

 

You need an extension - this is a nice quick one that should only take me a few hours and useful in many other apps so I'm more than happy to write it




Click the like button if you find my posts useful!
Please use plain text.
Trusted Contributor
lathajagan
Posts: 114
Registered: ‎03-06-2013
My Device: Blackberry Z10
My Carrier: Airtel

Re: Accessing permission list from settings

pls tell me how to write an extension for picking up the permissions for accessing contacts, it will be more than useful for me.
expecting a reply from u
--------
- If a post contains the solution to the problem, please click "Accept as Solution"
- If a post contains helpful content, please give it a "Thumbs Up"

developer.blackberry.com
@BlackBerryDev
Please use plain text.
Developer
peardox
Posts: 1,229
Registered: ‎03-20-2011
My Device: Playbook, Z10 LE, Dev Alpha B, 2x Dev Alpha C
My Carrier: 3, Orange, Vodafone

Re: Accessing permission list from settings

Again you pick me@ the precide time requierd

 

The way do do it is to study the NDK and also refer to the weborks extension templte

 

I wont kid you - this is not easy

 

Once you get there - it opens a new world to you

 

I cant tell you with simple instructions how to write one (its complicated)




Click the like button if you find my posts useful!
Please use plain text.
Developer
kamal_nigam
Posts: 434
Registered: ‎07-23-2012
My Device: Blackberry 10
My Carrier: Orange

Re: Accessing permission list from settings

@lathajagan logically you can solve this issue.

 

1. wheever you are comming to name display page make a call with ContactAPI. i feel that you may get error if user has disabled permission. on the basis of that u can take decision.

Thanks
-------------------------------------------------------------------------------------
Press the Accept as solution Button when u got the Solution
Press Kudo to say thank to developer.
-------------------------------------------------------------------------------------.
Please use plain text.
Developer
kamal_nigam
Posts: 434
Registered: ‎07-23-2012
My Device: Blackberry 10
My Carrier: Orange

Re: Accessing permission list from settings

one more thing. you can check the

http://developer.blackberry.com/html5/apis/blackberry.pim.contacts.contacterror.html

 

you may get the following error

Number PERMISSION_DENIED_ERROR

 

Thanks
-------------------------------------------------------------------------------------
Press the Accept as solution Button when u got the Solution
Press Kudo to say thank to developer.
-------------------------------------------------------------------------------------.
Please use plain text.
BlackBerry Development Advisor (Retired)
mimendoza
Posts: 64
Registered: ‎06-04-2012
My Device: Blackberry Z10
My Carrier: Bell

Re: Accessing permission list from settings

Once you get the error, you can inform the user that they need to enable contact permissions for your app and you can then invoke the BB10 application permission settings app.

Similar to:

 

https://github.com/blackberry/BB10-WebWorks-Samples/blob/master/invoke/invoker/invocations.js#L193

 

and using uri: "settings://permissions"

----------------------------------------------------------------------------------
- Did this post help solve the issue? Click on "Accept as Solution"
- Was the content of this post helpful? Please give it a "Thumbs Up"

developer.blackberry.com
@BlackBerryDev
Please use plain text.
Trusted Contributor
lathajagan
Posts: 114
Registered: ‎03-06-2013
My Device: Blackberry Z10
My Carrier: Airtel

Re: Accessing permission list from settings

@ I am not getting any error, but it goes to success call back but fullname is returned as null
--------
- If a post contains the solution to the problem, please click "Accept as Solution"
- If a post contains helpful content, please give it a "Thumbs Up"

developer.blackberry.com
@BlackBerryDev
Please use plain text.
Trusted Contributor
lathajagan
Posts: 114
Registered: ‎03-06-2013
My Device: Blackberry Z10
My Carrier: Airtel

Re: Accessing permission list from settings

@kamal_nigam

Even though settings-> Security and Permissions-> Application Permissions-> My Application-> Contacts as off,

blackberry.pim.contacts.find never goes to onFindError function , but it calls back onFindSuccess call back and doesnt match the contacts at all, but doesnt give any error.

But when i remove <rim:smileytongue:ermit>access_pimdomain_contacts</rim:smileytongue:ermit> from config.xml of my application then it through an error in onFindError function, alert('The operation failed due to insufficient permissions.'); error 20.

I have tried using  blackberry.system.hasPermission('blackberry.pim.contacts'); but it always gives me as allowed.

 

help me if u get any other idea to solve this problem, will be posting one more forum post for the same,

--------
- If a post contains the solution to the problem, please click "Accept as Solution"
- If a post contains helpful content, please give it a "Thumbs Up"

developer.blackberry.com
@BlackBerryDev
Please use plain text.