@wayq/beekon-rn 0.0.9 → 0.1.0

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.
Files changed (49) hide show
  1. package/BeekonRn.podspec +2 -2
  2. package/CHANGELOG.md +29 -7
  3. package/LICENSE.txt +3 -3
  4. package/README.md +84 -325
  5. package/android/build.gradle +2 -2
  6. package/android/src/main/java/in/wayq/beekonrn/BeekonRnModule.kt +28 -1
  7. package/ios/BeekonRn.mm +5 -0
  8. package/ios/BeekonRn.swift +37 -1
  9. package/ios/Frameworks/BeekonKit.xcframework/LICENSE.txt +3 -3
  10. package/ios/Frameworks/BeekonKit.xcframework/ios-arm64/BeekonKit.framework/BeekonKit +0 -0
  11. package/ios/Frameworks/BeekonKit.xcframework/ios-arm64/BeekonKit.framework/Info.plist +0 -0
  12. package/ios/Frameworks/BeekonKit.xcframework/ios-arm64/BeekonKit.framework/Modules/BeekonKit.swiftmodule/arm64-apple-ios.abi.json +254 -233
  13. package/ios/Frameworks/BeekonKit.xcframework/ios-arm64/BeekonKit.framework/Modules/BeekonKit.swiftmodule/arm64-apple-ios.swiftdoc +0 -0
  14. package/ios/Frameworks/BeekonKit.xcframework/ios-arm64/BeekonKit.framework/Modules/BeekonKit.swiftmodule/arm64-apple-ios.swiftinterface +2 -2
  15. package/ios/Frameworks/BeekonKit.xcframework/ios-arm64_x86_64-simulator/BeekonKit.framework/BeekonKit +0 -0
  16. package/ios/Frameworks/BeekonKit.xcframework/ios-arm64_x86_64-simulator/BeekonKit.framework/Info.plist +0 -0
  17. package/ios/Frameworks/BeekonKit.xcframework/ios-arm64_x86_64-simulator/BeekonKit.framework/Modules/BeekonKit.swiftmodule/arm64-apple-ios-simulator.abi.json +254 -233
  18. package/ios/Frameworks/BeekonKit.xcframework/ios-arm64_x86_64-simulator/BeekonKit.framework/Modules/BeekonKit.swiftmodule/arm64-apple-ios-simulator.swiftdoc +0 -0
  19. package/ios/Frameworks/BeekonKit.xcframework/ios-arm64_x86_64-simulator/BeekonKit.framework/Modules/BeekonKit.swiftmodule/arm64-apple-ios-simulator.swiftinterface +2 -2
  20. package/ios/Frameworks/BeekonKit.xcframework/ios-arm64_x86_64-simulator/BeekonKit.framework/Modules/BeekonKit.swiftmodule/x86_64-apple-ios-simulator.abi.json +254 -233
  21. package/ios/Frameworks/BeekonKit.xcframework/ios-arm64_x86_64-simulator/BeekonKit.framework/Modules/BeekonKit.swiftmodule/x86_64-apple-ios-simulator.swiftdoc +0 -0
  22. package/ios/Frameworks/BeekonKit.xcframework/ios-arm64_x86_64-simulator/BeekonKit.framework/Modules/BeekonKit.swiftmodule/x86_64-apple-ios-simulator.swiftinterface +2 -2
  23. package/ios/Frameworks/BeekonKit.xcframework/ios-arm64_x86_64-simulator/BeekonKit.framework/_CodeSignature/CodeResources +1 -1
  24. package/lib/module/NativeBeekonRn.js +6 -0
  25. package/lib/module/NativeBeekonRn.js.map +1 -1
  26. package/lib/module/beekon.js +13 -1
  27. package/lib/module/beekon.js.map +1 -1
  28. package/lib/module/index.js.map +1 -1
  29. package/lib/module/internal/mappers.js +12 -0
  30. package/lib/module/internal/mappers.js.map +1 -1
  31. package/lib/module/types/permission.js +2 -0
  32. package/lib/module/types/permission.js.map +1 -0
  33. package/lib/typescript/src/NativeBeekonRn.d.ts +19 -0
  34. package/lib/typescript/src/NativeBeekonRn.d.ts.map +1 -1
  35. package/lib/typescript/src/beekon.d.ts +10 -0
  36. package/lib/typescript/src/beekon.d.ts.map +1 -1
  37. package/lib/typescript/src/index.d.ts +1 -0
  38. package/lib/typescript/src/index.d.ts.map +1 -1
  39. package/lib/typescript/src/internal/mappers.d.ts +3 -1
  40. package/lib/typescript/src/internal/mappers.d.ts.map +1 -1
  41. package/lib/typescript/src/types/permission.d.ts +42 -0
  42. package/lib/typescript/src/types/permission.d.ts.map +1 -0
  43. package/package.json +5 -5
  44. package/scripts/fetch-beekonkit.sh +4 -4
  45. package/src/NativeBeekonRn.ts +21 -0
  46. package/src/beekon.ts +14 -0
  47. package/src/index.tsx +5 -0
  48. package/src/internal/mappers.ts +26 -0
  49. package/src/types/permission.ts +48 -0
@@ -0,0 +1,48 @@
1
+ /**
2
+ * How far the host app's location grant reaches. Mirrors the native
3
+ * `PermissionStatus` level on both platforms.
4
+ *
5
+ * Normalized — not platform permission constants. `'restricted'` is **iOS-only**
6
+ * (MDM / Screen Time); on Android "not yet asked" and "denied" cannot be told
7
+ * apart without an `Activity`, so both report `'notDetermined'`.
8
+ *
9
+ * - `'notDetermined'` — not yet decided; request to proceed.
10
+ * - `'denied'` — the user denied access (iOS). User-fixable in Settings.
11
+ * - `'restricted'` — blocked by an unchangeable policy (iOS-only).
12
+ * - `'foreground'` — granted while in use; foreground tracking only.
13
+ * - `'background'` — granted at all times; background tracking works.
14
+ */
15
+ export type PermissionLevel =
16
+ | 'notDetermined'
17
+ | 'denied'
18
+ | 'restricted'
19
+ | 'foreground'
20
+ | 'background';
21
+
22
+ /**
23
+ * Precision of a granted location authorization. `null` unless granted.
24
+ *
25
+ * - `'full'` — precise location.
26
+ * - `'reduced'` — approximate only (iOS 14 / Android 12 "approximate").
27
+ */
28
+ export type PermissionAccuracy = 'full' | 'reduced';
29
+
30
+ /**
31
+ * A point-in-time snapshot of the location-permission grant, returned by
32
+ * `Beekon.getPermissionStatus()`. Mirrors the native `PermissionStatus`.
33
+ *
34
+ * Beekon never *requests* permission — the app owns that. This is a read-only
35
+ * query for pre-start checks; it never prompts. It is a snapshot, not an
36
+ * observer: once tracking is running, permission loss surfaces on the `onState`
37
+ * stream as `{ kind: 'stopped', reason: 'permissionDenied' }`.
38
+ */
39
+ export type PermissionStatus = {
40
+ /** How far the grant reaches. */
41
+ level: PermissionLevel;
42
+ /** Precision of the grant, or `null` when not authorized. */
43
+ accuracy: PermissionAccuracy | null;
44
+ /** `true` when authorized at all — foreground or background. */
45
+ isAuthorized: boolean;
46
+ /** `true` when background tracking is authorized. */
47
+ canTrackInBackground: boolean;
48
+ };