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
Developer
Posts: 176
Registered: ‎06-23-2012
My Device: Z10 & Z30
My Carrier: Rogers
Accepted Solution

Reset permissions state for testing BBM integration

For the purposes of testing, I want to unregister my app from BBM and clear all the permissions for it.

 

Right now when I delete and re-deploy the app, it re-registers but does so without popping up the permissions dialog window again to ask whether I want to allow it access to BBM or not.

 

What do I have to do to get that back? If I go to the Applications Permissions window in Settings (which is extremely buggy, by the way) and turn off the BBM permission, it doesn't do anything but block the app from using BBM.

Developer
Posts: 6,473
Registered: ‎12-08-2010
My Device: PlayBook, Z10
My Carrier: none

Re: Reset permissions state for testing BBM integration

I would expect deleting the app would work for that, though there's a brief period (10 minutes?) during which certain "state" doesn't appear to be cleaned up fully after an uninstall, so reinstalling too quickly may not work. Either waiting before reinstalling, or rebooting, should avoid that problem.

An alternative should simply be to change your GUID. That ought to make it re-register, from what I understand. GUIDs are cheap, so no loss there. ;-)

Peter Hansen -- (BB10 and dev-related blog posts at http://peterhansen.ca.)
Author of White Noise and Battery Guru for BB10 and for PlayBook | Get more from your battery!
Developer
Posts: 194
Registered: ‎11-24-2012
My Device: Dev Alpha B, Bold 9700
My Carrier: NA

Re: Reset permissions state for testing BBM integration

I haven't done the BBM integration, but I do know that in the device settings menu, under security, there is a permissions menu which you can turn off selected permissions.  But it doesn't ask you to re-select them when you run the app again.

Developer
Posts: 6,473
Registered: ‎12-08-2010
My Device: PlayBook, Z10
My Carrier: none

Re: Reset permissions state for testing BBM integration

That's correct. Merely re-running the app won't ask you to select them. Nor will installing an update to the app, unless new permissions are added.

If, however, you remove the app, then wait long enough, then reinstall it, you should be asked again. Rebooting after the uninstall and before the reinstall should also clear things out and make it ask again (as I've determined empirically, numerous times).

Peter Hansen -- (BB10 and dev-related blog posts at http://peterhansen.ca.)
Author of White Noise and Battery Guru for BB10 and for PlayBook | Get more from your battery!
Developer
Posts: 176
Registered: ‎06-23-2012
My Device: Z10 & Z30
My Carrier: Rogers

Re: Reset permissions state for testing BBM integration

Unfortunately, I tried that just now. Uninstalled the app, rebooted, re-deployed, and it just registers without asking for permissions.

I changed the UUID and still the same.

Was in the middle of trying to re-add BBM to bar-descriptor after removing it to test something, and now Momentics crashes any time I try to open a context menu (right click). I'm stuck.
Developer
Posts: 6,473
Registered: ‎12-08-2010
My Device: PlayBook, Z10
My Carrier: none

Re: Reset permissions state for testing BBM integration

Try changing your app's id then. (The <id> in the bar-descriptor.) That *has* to work, by definition. If it doesn't, then you're doing something wrong, I think. If you change the app id, it's effectively a different app.

Peter Hansen -- (BB10 and dev-related blog posts at http://peterhansen.ca.)
Author of White Noise and Battery Guru for BB10 and for PlayBook | Get more from your battery!
Developer
Posts: 176
Registered: ‎06-23-2012
My Device: Z10 & Z30
My Carrier: Rogers

Re: Reset permissions state for testing BBM integration

After rebooting my laptop, Momentics decided to stop crashing and I changed the app ID and sure enough it asked for my permissions again.

Seems like a bug if it remembers permissions for apps that are technically supposed to be deleted. Then again my entire Application Permissions screen is all over the place and next to unusable. Am I the only one with that problem?

Also, side note: Changed it back to the ID it was before and it's still remembering the permissions. Hope it's a OS bug and not an app bug.
Highlighted
Developer
Posts: 526
Registered: ‎05-17-2009
My Device: 9900
My Carrier: ATT

Re: Reset permissions state for testing BBM integration

Its also a problem that there is no unregister method in the API
Like all of my posts
Developer
Posts: 6,473
Registered: ‎12-08-2010
My Device: PlayBook, Z10
My Carrier: none

Re: Reset permissions state for testing BBM integration

raffi, just to confirm, you were actually rebooting the device earlier, and not your laptop, right? When I said reboot after uninstalling, I meant reboot the Dev Alpha.

It may be that rebooting no longer flushes things out though, in which case I'm pretty sure it's just a time delay. At one point I remembering thinking it might have been an hourly housekeeping thing which did the final cleanup, but it's been a long time since I analyzed it. I'm confident that after *some* period of time it will clear the permissions out. (But sometimes I'm wrong even when I'm confident. ;-) )

Peter Hansen -- (BB10 and dev-related blog posts at http://peterhansen.ca.)
Author of White Noise and Battery Guru for BB10 and for PlayBook | Get more from your battery!
Developer
Posts: 176
Registered: ‎06-23-2012
My Device: Z10 & Z30
My Carrier: Rogers

Re: Reset permissions state for testing BBM integration

Haha, yes I was definitely rebooting my dev alpha after deleting the app. Smiley Wink

By the way, in regards to the unusable permissions screen, I have filed a bug. Not sure why this started happening, but for reference: https://www.blackberry.com/jira/browse/BBTEN-627

Also wish we could simply delete permisisons for a given app...