@abrarmehraj/permission-kit 0.1.0 → 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/android/build/.transforms/11f559a2ebefa85800586e59edd71959/results.bin +1 -0
- package/android/build/.transforms/11f559a2ebefa85800586e59edd71959/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/expo/modules/permissionkit/BuildConfig.dex +0 -0
- package/android/build/.transforms/11f559a2ebefa85800586e59edd71959/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/expo/modules/permissionkit/ExpoPermissionKitModule$definition$lambda$2$$inlined$AsyncFunctionWithoutArgs$1.dex +0 -0
- package/android/build/.transforms/11f559a2ebefa85800586e59edd71959/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/expo/modules/permissionkit/ExpoPermissionKitModule$definition$lambda$2$$inlined$AsyncFunctionWithoutArgs$2.dex +0 -0
- package/android/build/.transforms/11f559a2ebefa85800586e59edd71959/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/expo/modules/permissionkit/ExpoPermissionKitModule.dex +0 -0
- package/android/build/.transforms/11f559a2ebefa85800586e59edd71959/transformed/bundleLibRuntimeToDirDebug/desugar_graph.bin +0 -0
- package/android/build/.transforms/4df5c4d065593aa9636568712527225c/results.bin +1 -0
- package/android/build/.transforms/4df5c4d065593aa9636568712527225c/transformed/classes/classes_dex/classes.dex +0 -0
- package/android/build/intermediates/compile_library_classes_jar/debug/bundleLibCompileToJarDebug/classes.jar +0 -0
- package/android/build/intermediates/incremental/debug/packageDebugResources/compile-file-map.properties +1 -1
- package/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/expo/modules/permissionkit/ExpoPermissionKitModule$definition$lambda$2$$inlined$AsyncFunctionWithoutArgs$2.class +0 -0
- package/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/expo/modules/permissionkit/ExpoPermissionKitModule.class +0 -0
- package/android/build/intermediates/runtime_library_classes_jar/debug/bundleLibRuntimeToJarDebug/classes.jar +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/inputs/source-to-output.tab +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/inputs/source-to-output.tab.values.at +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-attributes.tab +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-attributes.tab.values.at +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab.values.at +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/internal-name-to-source.tab +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/internal-name-to-source.tab.keystream +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/internal-name-to-source.tab.keystream.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/internal-name-to-source.tab.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/internal-name-to-source.tab.values.at +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/internal-name-to-source.tab_i +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/proto.tab +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/proto.tab.values.at +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/source-to-classes.tab +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/source-to-classes.tab.values.at +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/subtypes.tab +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/subtypes.tab.values.at +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/supertypes.tab +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/supertypes.tab.values.at +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/counters.tab +1 -1
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/file-to-id.tab +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/file-to-id.tab.values.at +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/id-to-file.tab +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/id-to-file.tab.keystream +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/id-to-file.tab.keystream.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/id-to-file.tab.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/id-to-file.tab.values.at +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/id-to-file.tab_i +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/id-to-file.tab_i.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/lookups.tab +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/lookups.tab.keystream +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/lookups.tab.keystream.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/lookups.tab.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/lookups.tab.values.at +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/lookups.tab_i +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/last-build.bin +0 -0
- package/android/build/kotlin/compileDebugKotlin/classpath-snapshot/shrunk-classpath-snapshot.bin +0 -0
- package/android/build/kotlin/compileDebugKotlin/local-state/build-history.bin +0 -0
- package/android/build/tmp/kotlin-classes/debug/expo/modules/permissionkit/ExpoPermissionKitModule$definition$lambda$2$$inlined$AsyncFunctionWithoutArgs$2.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/expo/modules/permissionkit/ExpoPermissionKitModule.class +0 -0
- package/android/src/main/java/expo/modules/permissionkit/ExpoPermissionKitModule.kt +7 -0
- package/build/PermissionKit.d.ts.map +1 -1
- package/build/PermissionKit.js +11 -1
- package/build/PermissionKit.js.map +1 -1
- package/package.json +1 -1
- package/src/PermissionKit.ts +11 -1
- /package/android/build/intermediates/java_res/debug/processDebugJavaRes/out/META-INF/{abrar-permission-kit_debug.kotlin_module → abrarmehraj-permission-kit_debug.kotlin_module} +0 -0
- /package/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/META-INF/{abrar-permission-kit_debug.kotlin_module → abrarmehraj-permission-kit_debug.kotlin_module} +0 -0
- /package/android/build/tmp/kotlin-classes/debug/META-INF/{abrar-permission-kit_debug.kotlin_module → abrarmehraj-permission-kit_debug.kotlin_module} +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
o/bundleLibRuntimeToDirDebug
|
|
Binary file
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
o/classes
|
|
Binary file
|
|
Binary file
|
|
@@ -1 +1 @@
|
|
|
1
|
-
#Fri Jun 05
|
|
1
|
+
#Fri Jun 05 15:07:19 IST 2026
|
|
Binary file
|
|
Binary file
|
package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/inputs/source-to-output.tab
CHANGED
|
Binary file
|
|
Binary file
|
package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-attributes.tab
CHANGED
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/proto.tab.values.at
CHANGED
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/subtypes.tab
CHANGED
|
Binary file
|
|
Binary file
|
package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/supertypes.tab
CHANGED
|
Binary file
|
|
Binary file
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
|
|
1
|
+
3
|
|
2
2
|
0
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/id-to-file.tab.len
CHANGED
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/id-to-file.tab_i.len
CHANGED
|
Binary file
|
|
Binary file
|
package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/lookups.tab.keystream
CHANGED
|
Binary file
|
|
Binary file
|
package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/lookups.tab.len
CHANGED
|
Binary file
|
package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/lookups.tab.values.at
CHANGED
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/android/build/kotlin/compileDebugKotlin/classpath-snapshot/shrunk-classpath-snapshot.bin
CHANGED
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -36,6 +36,13 @@ class ExpoPermissionKitModule : Module() {
|
|
|
36
36
|
val packageName = context.packageName
|
|
37
37
|
|
|
38
38
|
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
|
|
39
|
+
if (androidx.core.content.ContextCompat.checkSelfPermission(
|
|
40
|
+
context,
|
|
41
|
+
android.Manifest.permission.REQUEST_IGNORE_BATTERY_OPTIMIZATIONS
|
|
42
|
+
) != android.content.pm.PackageManager.PERMISSION_GRANTED) {
|
|
43
|
+
throw Exception("MISSING_PERMISSION: Add batteryOptimization to your app.json plugin")
|
|
44
|
+
}
|
|
45
|
+
|
|
39
46
|
val intent = Intent(
|
|
40
47
|
Settings.ACTION_REQUEST_IGNORE_BATTERY_OPTIMIZATIONS,
|
|
41
48
|
Uri.parse("package:$packageName")
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PermissionKit.d.ts","sourceRoot":"","sources":["../src/PermissionKit.ts"],"names":[],"mappings":"AAGA,wBAAsB,wBAAwB;;;YAME,SAAS,GAAG,QAAQ;GAEnE;AAED,wBAAsB,mBAAmB;;;YAJO,SAAS,GAAG,QAAQ;
|
|
1
|
+
{"version":3,"file":"PermissionKit.d.ts","sourceRoot":"","sources":["../src/PermissionKit.ts"],"names":[],"mappings":"AAGA,wBAAsB,wBAAwB;;;YAME,SAAS,GAAG,QAAQ;GAEnE;AAED,wBAAsB,mBAAmB;;;YAJO,SAAS,GAAG,QAAQ;GA8BnE;AAiBD,eAAO,MAAM,aAAa;;;CAGzB,CAAC"}
|
package/build/PermissionKit.js
CHANGED
|
@@ -18,6 +18,7 @@ async function checkBatteryOptimization() {
|
|
|
18
18
|
};
|
|
19
19
|
}
|
|
20
20
|
async function batteryOptimization() {
|
|
21
|
+
var _a;
|
|
21
22
|
if (react_native_1.Platform.OS === 'ios' || !ExpoPermissionKitModule_1.default) {
|
|
22
23
|
return { status: 'unavailable' };
|
|
23
24
|
}
|
|
@@ -25,7 +26,16 @@ async function batteryOptimization() {
|
|
|
25
26
|
if (check.status === 'granted') {
|
|
26
27
|
return check;
|
|
27
28
|
}
|
|
28
|
-
|
|
29
|
+
try {
|
|
30
|
+
await ExpoPermissionKitModule_1.default.openBatteryOptimizationSettings();
|
|
31
|
+
}
|
|
32
|
+
catch (error) {
|
|
33
|
+
if ((_a = error === null || error === void 0 ? void 0 : error.message) === null || _a === void 0 ? void 0 : _a.includes('MISSING_PERMISSION')) {
|
|
34
|
+
console.warn("[@abrarmehraj/permission-kit] Missing Permission: You forgot to add 'batteryOptimization' to your app.json plugin.");
|
|
35
|
+
return { status: 'denied' };
|
|
36
|
+
}
|
|
37
|
+
throw error;
|
|
38
|
+
}
|
|
29
39
|
await waitForResume();
|
|
30
40
|
return await checkBatteryOptimization();
|
|
31
41
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PermissionKit.js","sourceRoot":"","sources":["../src/PermissionKit.ts"],"names":[],"mappings":";;;;;;AAGA,4DAQC;AAED,
|
|
1
|
+
{"version":3,"file":"PermissionKit.js","sourceRoot":"","sources":["../src/PermissionKit.ts"],"names":[],"mappings":";;;;;;AAGA,4DAQC;AAED,kDA0BC;AAvCD,+CAAkD;AAClD,wFAAqD;AAE9C,KAAK,UAAU,wBAAwB;IAC5C,IAAI,uBAAQ,CAAC,EAAE,KAAK,KAAK,IAAI,CAAC,iCAAY,EAAE,CAAC;QAC3C,OAAO,EAAE,MAAM,EAAE,aAAsB,EAAE,CAAC;IAC5C,CAAC;IACD,MAAM,OAAO,GAAG,MAAM,iCAAY,CAAC,4BAA4B,EAAE,CAAC;IAClE,OAAO;QACL,MAAM,EAAE,CAAC,OAAO,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,QAAQ,CAAyB;KACjE,CAAC;AACJ,CAAC;AAEM,KAAK,UAAU,mBAAmB;;IACvC,IAAI,uBAAQ,CAAC,EAAE,KAAK,KAAK,IAAI,CAAC,iCAAY,EAAE,CAAC;QAC3C,OAAO,EAAE,MAAM,EAAE,aAAsB,EAAE,CAAC;IAC5C,CAAC;IAED,MAAM,KAAK,GAAG,MAAM,wBAAwB,EAAE,CAAC;IAE/C,IAAI,KAAK,CAAC,MAAM,KAAK,SAAS,EAAE,CAAC;QAC/B,OAAO,KAAK,CAAC;IACf,CAAC;IAED,IAAI,CAAC;QACH,MAAM,iCAAY,CAAC,+BAA+B,EAAE,CAAC;IACvD,CAAC;IAAC,OAAO,KAAU,EAAE,CAAC;QACpB,IAAI,MAAA,KAAK,aAAL,KAAK,uBAAL,KAAK,CAAE,OAAO,0CAAE,QAAQ,CAAC,oBAAoB,CAAC,EAAE,CAAC;YACnD,OAAO,CAAC,IAAI,CACV,oHAAoH,CACrH,CAAC;YACF,OAAO,EAAE,MAAM,EAAE,QAAiB,EAAE,CAAC;QACvC,CAAC;QACD,MAAM,KAAK,CAAC;IACd,CAAC;IAED,MAAM,aAAa,EAAE,CAAC;IAEtB,OAAO,MAAM,wBAAwB,EAAE,CAAC;AAC1C,CAAC;AAED,SAAS,aAAa;IACpB,OAAO,IAAI,OAAO,CAAC,OAAO,CAAC,EAAE;QAC3B,MAAM,GAAG,GAAG,uBAAQ,CAAC,gBAAgB,CACnC,QAAQ,EACR,CAAC,KAAK,EAAE,EAAE;YACR,IAAI,KAAK,KAAK,QAAQ,EAAE,CAAC;gBACvB,GAAG,CAAC,MAAM,EAAE,CAAC;gBACb,0DAA0D;gBAC1D,UAAU,CAAC,OAAO,EAAE,GAAG,CAAC,CAAC;YAC3B,CAAC;QACH,CAAC,CACF,CAAC;IACJ,CAAC,CAAC,CAAC;AACL,CAAC;AAEY,QAAA,aAAa,GAAG;IAC3B,mBAAmB;IACnB,wBAAwB;CACzB,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@abrarmehraj/permission-kit",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.1",
|
|
4
4
|
"description": "A developer-friendly permissions library for Expo and React Native. One call handles the full workflow — check, request, wait for app resume, return final status.",
|
|
5
5
|
"main": "build/index.js",
|
|
6
6
|
"module": "build/index.js",
|
package/src/PermissionKit.ts
CHANGED
|
@@ -22,7 +22,17 @@ export async function batteryOptimization() {
|
|
|
22
22
|
return check;
|
|
23
23
|
}
|
|
24
24
|
|
|
25
|
-
|
|
25
|
+
try {
|
|
26
|
+
await NativeModule.openBatteryOptimizationSettings();
|
|
27
|
+
} catch (error: any) {
|
|
28
|
+
if (error?.message?.includes('MISSING_PERMISSION')) {
|
|
29
|
+
console.warn(
|
|
30
|
+
"[@abrarmehraj/permission-kit] Missing Permission: You forgot to add 'batteryOptimization' to your app.json plugin."
|
|
31
|
+
);
|
|
32
|
+
return { status: 'denied' as const };
|
|
33
|
+
}
|
|
34
|
+
throw error;
|
|
35
|
+
}
|
|
26
36
|
|
|
27
37
|
await waitForResume();
|
|
28
38
|
|
|
File without changes
|
|
File without changes
|