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
Robdob
Posts: 225
Registered: ‎01-31-2013
My Device: Developer

Is it possible to Postpone or further streamline the permission requirements

Hi,

 

I have an app which requires several permissions to operate fully.  i.e. , location, shared files, and phone.

 

I have three issues for which I'm trying to find solutions for:

 

-1- is it possible to further streamline the permissions being requested? The problem being that most people are concerned about accepting some of these permissions because the ability that each permission is giving the developer.  i.e.. I require the phone permission within my app in order to launch the phone dialer pre input with a number, this is a convenience feature, however when the user allows the app this permission they are also giving the app full rein over their phone,  addresses,  saved numbers etc..  this can be very alarming

 

-2-  my app only requires the shared files permissions and pin indentifying permissions should the user decide that they would like to post an ad,  this is not a requirement to search ads, however my apps framework asks for all of these permissions at the beginning..  is there a way to only ask for these permissions as they are needed?

.. 

-3- is these a way to present the user with a splash screen before the permission request screen so that I can supply a preamble to what the permissions being requested are for?

 

Thanks,



GeoYeo - Free Local classifieds - Built for Blackberry 10, if you like it please Rate It and Share it!
Please use plain text.
Developer
BBSJdev
Posts: 6,116
Registered: ‎07-05-2012
My Device: Playbook, Dev Alpha C, Z10 LE, Z30

Re: Is it possible to Postpone or further streamline the permission requirements

[ Edited ]

1) Not really. An explanation would be the way to go, let the user turn off the permissions (if they like) then in your app check for access on finding an unset permission display a dialog with explanations of why they need to be turned on along with a button that invokes the Settings page.

 

2) See 1. Doing it this way means if the user never uses the functionality they will never see a problem. If they do they will get a message explaining why the permission is needed. Less nefarious.

 

3) Not that I'm aware of.


If you've been helped click on Like Button, if you've been saved buy the app. :smileyhappy:

Developer of stokLocker, Sympatico and Super Sentences.
Please use plain text.
Developer
BBSJdev
Posts: 6,116
Registered: ‎07-05-2012
My Device: Playbook, Dev Alpha C, Z10 LE, Z30

Re: Is it possible to Postpone or further streamline the permission requirements

I've also seen some developers put an explanation in the App description, not a big fan of doing this myself but it's another option.


If you've been helped click on Like Button, if you've been saved buy the app. :smileyhappy:

Developer of stokLocker, Sympatico and Super Sentences.
Please use plain text.
Developer
Robdob
Posts: 225
Registered: ‎01-31-2013
My Device: Developer

Re: Is it possible to Postpone or further streamline the permission requirements

Hi,

 

firstly thank you taking the time to reply.

 

I've included the description of why the permissions are being requested from within the app, but as I not many appear to be reading it..

 

Is there a way to check if all the permissions being requested are being accepted and if not which ones were or were not accepted, or do I need to just figured this out at the time that fuctionality within my app requirring a permission fails?

 

Thanks,

 



GeoYeo - Free Local classifieds - Built for Blackberry 10, if you like it please Rate It and Share it!
Please use plain text.
Developer
BBSJdev
Posts: 6,116
Registered: ‎07-05-2012
My Device: Playbook, Dev Alpha C, Z10 LE, Z30

Re: Is it possible to Postpone or further streamline the permission requirements

[ Edited ]

A few services have associated classes that have a function indicating whether the permission is set or not but a lot don't so you can either run your own check at start time or wait until the user tries the operation and catch it then.

 

As I alluded to I personally think the best option is to wait until the user tries the functionality that needs the permission and then bring up the dialog box that invokes the Settings page if found missing.

 

As an example for the shared_files permission you might simply run a check at the start to see if you can create a file in the data folder and if not you know that the permission has been turned off.

 


If you've been helped click on Like Button, if you've been saved buy the app. :smileyhappy:

Developer of stokLocker, Sympatico and Super Sentences.
Please use plain text.
Developer
Robdob
Posts: 225
Registered: ‎01-31-2013
My Device: Developer

Re: Is it possible to Postpone or further streamline the permission requirements

k, thanks,

 

its ashame that you can't postpone requesting the user for permissons until they are actually needed as I think presenting the user with an initial screen requested all permissions is sometimes a turnoff..



GeoYeo - Free Local classifieds - Built for Blackberry 10, if you like it please Rate It and Share it!
Please use plain text.
Developer
slashkyle
Posts: 820
Registered: ‎10-16-2012
My Device: Red Z10

Re: Is it possible to Postpone or further streamline the permission requirements

[ Edited ]

In the help page of Spy Cam Extreme I put a section that tells users what features require which permissions and there's a button that takes them to the permissions so that they can adjust them

 

Since I added the button I have yet to receive another e-mail about permissions

 

Here's the source

 

ApplicationUI.cpp

 

#include <bb/system/InvokeRequest>
#include <bb/system/InvokeManager>
#include <bb/system/InvokeTargetReply>
QmlDocument *qml = QmlDocument::create("asset:///main.qml").parent(this);
    qml->setContextProperty("cpp", this);

 

void ApplicationUI::permissions()
{
	InvokeManager manager;
	InvokeRequest request;

	// Setup what to show and in what target.
	request.setTarget("sys.settings.target");
	request.setAction("bb.action.OPEN");
	request.setMimeType("settings/view");
	request.setUri(tr("settings://permissions"));
	InvokeTargetReply *targetReply = manager.invoke(request);
	//setting the parent to "this" will make the manager live on after this function is destroyed
	manager.setParent(this);

	if (targetReply == NULL) {
		qDebug() << "InvokeTargetReply is NULL: targetReply = " << targetReply;
	} else {
		targetReply->setParent(this);
	}
}

.hpp

namespace bb
{
    namespace cascades
    {
        class Application;
    }
    namespace system
    {
    	class InvokeManager;
    }
}

 

public:
    ApplicationUI(bb::cascades::Application *app);
    virtual ~ApplicationUI() { }
    Q_INVOKABLE void permissions();

 

.qml

 

Container {
    horizontalAlignment: HorizontalAlignment.Fill
    bottomMargin: 15
    Label {
        text: "Adjust Permissions"
        textStyle.textAlign: TextAlign.Center
        horizontalAlignment: HorizontalAlignment.Center
    }
    onTouch: {
        if (event.isUp()){
            console.log("Adjust Permissions")
            cpp.permissions();
        }
    }
}
Please use plain text.
Developer
BBSJdev
Posts: 6,116
Registered: ‎07-05-2012
My Device: Playbook, Dev Alpha C, Z10 LE, Z30

Re: Is it possible to Postpone or further streamline the permission requirements

@slashkyle You spelled adjust wrong in the onTouch event handler. :-)

If you've been helped click on Like Button, if you've been saved buy the app. :smileyhappy:

Developer of stokLocker, Sympatico and Super Sentences.
Please use plain text.
Developer
slashkyle
Posts: 820
Registered: ‎10-16-2012
My Device: Red Z10

Re: Is it possible to Postpone or further streamline the permission requirements

I thought it gave a nice touch :smileywink:  fixed now Thanks

Please use plain text.
Developer
Robdob
Posts: 225
Registered: ‎01-31-2013
My Device: Developer

Re: Is it possible to Postpone or further streamline the permission requirements

Hi,

 

thanks for the great code, the problem is that when a users first gews presented with a slew of permissions to accept before your app launches it turns many people a way.  IS there not a way to present a user with a request for permission later. or reinstate app permissions later



GeoYeo - Free Local classifieds - Built for Blackberry 10, if you like it please Rate It and Share it!
Please use plain text.