Module Veery
systemAuthorization(int authorization)
Requires Veery for React Native version 1.4.0
Allow to you to check :
- If Location is authorized by the user.
- If Remote Notifications are authorized by the user.
Authorization are given by the user to the system using the following popup window
This popup is triggered by the system when veery.activate is called.
Activate should be called to activate the Veery agent event if systemAuthorization returns true. In that case the popup will not be triggered.
Parameters
Param name | Type | Usage |
---|---|---|
authorization | int | Veery.USER_AUTH_GEOLOC : To check location service status if is authorizedAlways or authorizedWhenInUse |
Veery.USER_AUTH_GEOLOC_BACKGROUND : To check location service status if is authorizedAlways | ||
Veery.USER_AUTH_NOTIFICATION : To check notification status |
Returns
true if all Parameters sent in this function are authorized by the user
false if one of this Parameters is not authorized by the user
Usage / Example
Veery.systemAuthorization( Veery.USER_AUTH_GEOLOC | Veery.USER_AUTH_GEOLOC_BACKGROUND | Veery.USER_AUTH_NOTIFICATION ,(rep) => { console.log('systemAuthorization--rep', rep); }); // OR Veery.systemAuthorization( Veery.USER_AUTH_GEOLOC + Veery.USER_AUTH_GEOLOC_BACKGROUND + Veery.USER_AUTH_NOTIFICATION ,(rep) => { console.log('systemAuthorization--rep', rep); }); //return true if all Parameters are authorized by the user //OR you can check only one Parameter Veery.systemAuthorization(Veery.USER_AUTH_GEOLOC_BACKGROUND,(rep) => { console.log('systemAuthorization--rep', rep); }); //return true if the location service is authorized by the user (authorizedAlways)
User interaction
none
This function will not request for the authorization. If needed, this is done by the veery.activate function