Skip to content

Instantly share code, notes, and snippets.

@ralphpina
Last active March 13, 2019 22:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ralphpina/37cc411ba675fe281185ad1501958ca6 to your computer and use it in GitHub Desktop.
Save ralphpina/37cc411ba675fe281185ad1501958ca6 to your computer and use it in GitHub Desktop.
/**
* This is the main API for the SDK. It provides methods to observe and request permissions.
*/
interface PermissionsManager {
/**
* Observe the state of permissions. You will get notified when there's new changes to it.
*/
fun observe(vararg permissions: Permission): Observable<List<PermissionResult>>
/**
* Request a permission from the system. The Single will return the permissions result from the OS.
*/
fun request(vararg permissions: Permission): Single<List<PermissionResult>>
/**
* Navigate to your app's settings. Here the user can manually change permissions.
*/
fun navigateToOsAppSettings()
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment