All Projects → akofman → Cordova Plugin Permissionscope

akofman / Cordova Plugin Permissionscope

Licence: apache-2.0
🔓 Cordova plugin to handle iOS permissions

Programming Languages

swift
15916 projects

Projects that are alternatives of or similar to Cordova Plugin Permissionscope

cordova-plugin-apkupdater
This plugin allows your Android app to download and install compressed updates without the Google Play Store.
Stars: ✭ 46 (+70.37%)
Mutual labels:  cordova, cordova-plugin
Cordova Plugin Disable Bitcode
Cordova plugin to disable bitcode in iOS build settings
Stars: ✭ 19 (-29.63%)
Mutual labels:  cordova, cordova-plugin
cordova-plugin-today-widget
Add a today widget app extension target to your cordova project.
Stars: ✭ 51 (+88.89%)
Mutual labels:  cordova, cordova-plugin
example-cordova-code-push-plugin
Ionic + Cordova Code Push Plugin Example
Stars: ✭ 45 (+66.67%)
Mutual labels:  cordova, cordova-plugin
Cordova Plugin Linkedin
Cordova plugin for LinkedIn
Stars: ✭ 17 (-37.04%)
Mutual labels:  cordova, cordova-plugin
cordova-plugin-dbcopy
Copy SQLite Database from www folder to default app database location
Stars: ✭ 90 (+233.33%)
Mutual labels:  cordova, cordova-plugin
Cordova Admob Pro
🔥 Cordova Plugin for Google AdMob, DFP, ADX. Easy monetization using mobile Ad, with single line of JavaScript. Compatible with Cordova CLI, Inoic, PhoneGap Build, etc.
Stars: ✭ 690 (+2455.56%)
Mutual labels:  cordova, cordova-plugin
cordova-plugin-zeep
Zip compression/decompression for the cordova/phonegap platform
Stars: ✭ 27 (+0%)
Mutual labels:  cordova, cordova-plugin
Vue Cordova
Vue.js plugin for Cordova
Stars: ✭ 328 (+1114.81%)
Mutual labels:  cordova, cordova-plugin
Cordova Plugin Geofence
Geofencing plugin for cordova
Stars: ✭ 261 (+866.67%)
Mutual labels:  cordova, cordova-plugin
cordova-swift3-plugin-example
Swift 3 Cordova plugin example to support blog post.
Stars: ✭ 23 (-14.81%)
Mutual labels:  cordova, cordova-plugin
Cordova Plugin Admob Free
Cordova AdMob Plugin
Stars: ✭ 508 (+1781.48%)
Mutual labels:  cordova, cordova-plugin
cordova-support-google-services
DEPRECATED. Cordova plugin to add google services support
Stars: ✭ 41 (+51.85%)
Mutual labels:  cordova, cordova-plugin
cordova-plugin-flurryanalytics
Adds support for all that Flurry Analytics flavored goodness to your Cordova based apps
Stars: ✭ 23 (-14.81%)
Mutual labels:  cordova, cordova-plugin
cordova-plugin-wkkeyboardfix
Cordova plugin to provide a temporary fix for an iOS 12 and 13 bug involving keyboards in WKWebView.
Stars: ✭ 14 (-48.15%)
Mutual labels:  cordova, cordova-plugin
ionic-native-sms-retriever-plugin-master
Cross-platform plugin for Cordova / PhoneGap to Retrieve SMS. Available for Android.
Stars: ✭ 16 (-40.74%)
Mutual labels:  cordova, cordova-plugin
cordova-plugin-dbmeter
🎤📣 Cordova plugin to get decibels from the microphone
Stars: ✭ 33 (+22.22%)
Mutual labels:  cordova, cordova-plugin
cordova-gmv-barcode-scanner
A Cordova barcode scanning plugin based on the Google Mobile Vision library for iOS & Android.
Stars: ✭ 48 (+77.78%)
Mutual labels:  cordova, cordova-plugin
scanbot-sdk-example-ionic
Scanbot scanner SDK example app for Ionic with Cordova.
Stars: ✭ 24 (-11.11%)
Mutual labels:  cordova, cordova-plugin
Cordova Plugin Qrscanner
A fast, energy efficient, highly-configurable QR code scanner for Cordova apps and the browser.
Stars: ✭ 485 (+1696.3%)
Mutual labels:  cordova, cordova-plugin

Twitter: @alexiskofman License Build Status

cordova-plugin-permissionScope

This plugin is a wrapper of the very helpful Swift framework PermissionScope. It defines a global PermissionScope object, which permits to requesting permissions from users.

Installation

cordova plugin add cordova-plugin-permissionScope --save

The iOS part is written in Swift and the Swift support plugin is configured as a dependency.

⚠️ Because this plugin doesn't support Swift 3 at the moment, the following preference has to be added in your project :

<preference name="UseLegacySwiftLanguageVersion" value="true" />

Supported Platforms

  • iOS

Methods

PermissionScope.init(config, success, error)

Inits and customizes the dialog and all the alerts displayed from direct requests. If called without any parameter then the default config is restored.

The following properties are available:

Property Comment
headerLabel Header UILabel with the message "Hey, listen!" by default.
bodyLabel Header UILabel with the message "We need a couple things\r\nbefore you get started." by default.
closeButtonTitle Title for the close button. "Close" by default.
closeButtonTextColor Hex color code for the close button's text color (ie: #cccccc).
closeOffset Offset used to position the Close button (ie: {-200,0}).
permissionButtonTextColor Hex color code for the permission buttons' text color (ie: #cccccc).
permissionButtonBorderColor Hex color code for the permission buttons' border color (ie: #cccccc).
permissionButtonΒorderWidth Border width for the permission buttons.
permissionButtonCornerRadius Corner radius for the permission buttons.
permissionLabelColor Hex color code for the permission labels' text color (ie: #cccccc).
authorizedButtonColor Hex color code used for permission buttons with authorized status (ie: #cccccc).
unauthorizedButtonColor Hex color code used for permission buttons with unauthorized status. By default, inverse of authorizedButtonColor (ie: #cccccc).
deniedAlertTitle Title for the denied alert.
deniedAlertMessage Message for the denied alert.
deniedCancelActionTitle Title for the denied alert's cancel button. "OK" by default.
deniedDefaultActionTitle Title for the denied alert's default button. "Show me" by default.
disabledAlertTitle Title for the disabled alert.
disabledAlertMessage Message for the disabled alert.
disabledCancelActionTitle Title for the disabled alert's cancel button. "OK" by default.
disabledDefaultActionTitle Title for the disabled alert's default button. "Show me" by default.

PermissionScope.show(success, error)

Displays the permissions dialog if permissions have to be approved else does nothing.

PermissionScope.add<TYPE>Permission(message, success, error)

The following methods permit to set up permissions asked from the dialog :

  • PermissionScope.addNotificationsPermission(message, success, error)
  • PermissionScope.addLocationInUsePermission(message, success, error)
  • PermissionScope.addLocationAlwaysPermission(message, success, error)
  • PermissionScope.addContactsPermission(message, success, error)
  • PermissionScope.addEventsPermission(message, success, error)
  • PermissionScope.addMicrophonePermission(message, success, error)
  • PermissionScope.addCameraPermission(message, success, error)
  • PermissionScope.addPhotosPermission(message, success, error)
  • PermissionScope.addRemindersPermission(message, success, error)
  • PermissionScope.addBluetoothPermission(message, success, error)
  • PermissionScope.addMotionPermission(message, success, error)

Message is a label displayed below the permission button. Its goal is to explain why a permission has to be approved.

PermissionScope.request<TYPE>Permission(success, error)

The following methods permit to check whether a particular permission has been granted else it displays an alert :

  • PermissionScope.requestNotificationsPermission(success, error)
  • PermissionScope.requestLocationInUsePermission(success, error)
  • PermissionScope.requestLocationAlwaysPermission(success, error)
  • PermissionScope.requestContactsPermission(success, error)
  • PermissionScope.requestEventsPermission(success, error)
  • PermissionScope.requestMicrophonePermission(success, error)
  • PermissionScope.requestCameraPermission(success, error)
  • PermissionScope.requestPhotosPermission(success, error)
  • PermissionScope.requestRemindersPermission(success, error)
  • PermissionScope.requestBluetoothPermission(success, error)
  • PermissionScope.requestMotionPermission(success, error)

Examples

PermissionScope.init({
  headerLabel: 'Hello',
  bodyLabel: 'Before you get started',
  closeButtonTextColor: '#cccccc',
  closeButtonTitle: 'Return',
  permissionButtonTextColor: '#30ab7d',
  permissionButtonBorderColor: '#30ab7d',
  closeOffset: '{-200, 0}',
  authorizedButtonColor: '#cccccc',
  unauthorizedButtonColor: '#c2262d',
  permissionButtonCornerRadius: '20',
  permissionLabelColor: '#ff5500',
  permissionButtonΒorderWidth: '5',
  deniedCancelActionTitle: 'Cancel',
  deniedDefaultActionTitle: 'Settings',
  deniedAlertTitle: 'Permission',
  deniedAlertMessage: 'Please enable all the permissions',
  disabledCancelActionTitle: 'Cancel',
  disabledDefaultActionTitle: 'Settings',
});

PermissionScope.addBluetoothPermission('Please enable access to your Bluetooth');
PermissionScope.addCameraPermission('Please enable access to your Camera');
PermissionScope.addPhotosPermission('Please enable access to your Photos');

PermissionScope.show();

The result could be something like this :

Here is the default version :

PermissionScope.init({
  denieddDefaultActionTitle: 'Settings'
});

PermissionScope.requestEventsPermission();

Here is what you should obtain if the permission has not been granted :

App

An app is available in the tests/app folder and is generated from the Cordova Plugin TestFramework. It permits to launch auto tests and manual tests.

To install it, please follow these steps :

npm run install && cordova run --device
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].