views:

464

answers:

3

I have a few questions about permissions and prompts. Most importantly this has to do with making a data connection and using GPS

QUESTIONS

1. Prompts & Allow - Remove Notice?: When installing my app (signed) on various devices, some devices prompt the user about making a data connection and some do not (the connection is just made). I check the permissions, and on both devices they are data connection is set to prompt. Why would one device just make a connection and the other requires a prompt? NOTE: both devices are on the same carrier (verision) and and are not restricted by BES.

2. Premission Dialog in Recent Build: In the recent build the user is promted about allowing a data request. In previous version builds this pompt never occured (even though both builds make a data connection that might require a prompt). For the life of me I can't tell what I might have changes that resulted in pompts now occuring. Is there anything I should check in the build/project/files so these prompts wont appear any longer?

3. Set Permissions On Install?: Is there any way to enforce permissions (say to allow) on install of the app? I know I can do invokePermissionsRequest but that will then occur during when running the app. Ideally I'd like to get permissions settled without user involvement or during install.

Some facts to note:

  • Developing for 4.2.1 and above
  • Apps are signed
  • Apps make use of data connection and GPS

Thanks in advance!

A: 

Pertaining to your questions #1 and #2... There may be differences in behavior depending on what OS the device is using. Many permissions were modified/renamed/created when OS 4.7 was released. For example, here are the permissions I request for OS 4.5:

ApplicationPermissions.PERMISSION_FILE_API
ApplicationPermissions.PERMISSION_INTER_PROCESS_COMMUNUCATION
ApplicationPermissions.PERMISSION_CHANGE_DEVICE_SETTINGS
ApplicationPermissions.PERMISSION_EXTERNAL_CONNECTIONS
ApplicationPermissions.PERMISSION_INTERNAL_CONNECTIONS
ApplicationPermissions.PERMISSION_WIFI
ApplicationPermissions.PERMISSION_EMAIL
ApplicationPermissions.PERMISSION_HANDHELD_KEYSTORE

And here are the permissions I request for OS 4.7:

ApplicationPermissions.PERMISSION_FILE_API
ApplicationPermissions.PERMISSION_CROSS_APPLICATION_COMMUNICATION
ApplicationPermissions.PERMISSION_DEVICE_SETTINGS
ApplicationPermissions.PERMISSION_INTERNET
ApplicationPermissions.PERMISSION_SERVER_NETWORK
ApplicationPermissions.PERMISSION_WIFI
ApplicationPermissions.PERMISSION_EMAIL
ApplicationPermissions.PERMISSION_SECURITY_DATA,     

You can see that a number of permissions were renamed. You may need to update your code to be aware of the OS and request specific permissions.

For question #3, there is no way to execute any kind of code on-install. The best you can do is make your application 'Auto-run on startup' and perform the check then. However, this might be a worse solution, as the user may become confused by getting a permissions request dialog on startup.

The best solution is to make sure you have sufficient privileges every time your application is launched. If not, request all necessary privileges and handle everything as gracefully as possible. If you execute this successfully, your users will only have to deal with the permissions the very first time your application is launched (as long as they don't mess around with them on their own later on).

CJ
A: 

Question #1. check if you have the firewall enabled. Options->Security Options->Firewall. If it is enabled you will be prompted when trying to access GPS, if it is not enabled you won't be prompted.

Question #2. This might have something to do with the status of the previous version of you app. If you're installing over the top of an existing app, blackberry will "remember" what prompts it has already asked you and what your answer was. On the other hand if you uninstall before installing, blackberry will have "forgotten".

Question #3. There is no way to run custom code on install.

Jeff
A: 

With respect to question #3, if your program is set to be auto run on start, it will be run on installation. This is how applications and/or libraries tie into the system hooks on install. You will need to be careful on reboot because it is always possible that the system will decide that an upgrade requires a reboot, in which case your code will be run late in the reboot proces, but before the UI is available. So this code would need to check to see if the permissions are correct. If not, delay until the UI is running (if it isn't alread) then make the calls to prompt for changes.

Richard

related questions