Giter VIP home page Giter VIP logo

sentry's Introduction

Sentry

Sentry

A lightweight wrapper for Android Permissions.

Kotlin Build Status Codecov GitHub (pre-)release

GETTING STARTED

Sentry (pre-)releases are available via JitPack. It is recommended that a specific release version is selected when using the library in production as there may be breaking changes at anytime.

Tip: Test out the canary channel to try out features by using the latest develop snapshot; develop-SNAPSHOT.

// Project level build.gradle
// ...
repositories {
    maven { url 'https://jitpack.io' }
}
// ...

// Module level build.gradle
dependencies {
    // Replace version with release version, e.g. 1.0.0-alpha, -SNAPSHOT
    implementation "io.karn:sentry:[VERSION]"
}

USAGE

The most basic case is as follows:

// Add the following delegate to your activity.
- class MyActivity : AppCompatActivity() {
+ class MyActivity : AppCompatActivity(), Permissions by SentryPermissionHandler {

// or optionally manually delegate to the SentryPermissionHandler by adding the following override
// in your Activity
+    override fun onRequestPermissionsResult(requestCode: Int, permissions: Array<out String>, grantResults: IntArray) {
+        SentryPermissionHandler.onRequestPermissionsResult(requestCode, permissions, grantResults)
+    }
}

Then anywhere in your activity you can make a request to fetch a permission.

Sentry
    // A reference to your current activity.
    .with(activity)
    // The permission that is being queried.
    .requestPermission(Manifest.permission.WRITE_EXTERNAL_STORAGE) { isGranted: Boolean ->
        Log.v("Sentry", "Granted permission to write to external storage? $isGranted")
    }

CONTRIBUTING

There are many ways to contribute, you can

  • submit bugs,
  • help track issues,
  • review code changes.

sentry's People

Contributors

karn avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

sentry's Issues

Handle activity configuration changes (e.g screen rotation).

Description:
When a permission is requested and the activity configuration changes, the library is unable to receive results from the previous request. There is no seamless way to handle this at the moment other than to simply re-request the permission.

Android Manifest merger conflict

This line could be redundant and it causes an issue with Android manifest merger.


FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':mobile-ui:processDebugManifest'.
> Manifest merger failed : Attribute application@theme value=(@style/AppTheme.NoActionBar) from AndroidManifest.xml:17:9-52
  	is also present at [io.karn:sentry:0.0.1] AndroidManifest.xml:34:18-74 value=(@style/Theme.AppCompat.Light.NoActionBar).
  	Suggestion: add 'tools:replace="android:theme"' to <application> element at AndroidManifest.xml:10:5-28:19 to override.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.