spotny-sdk 0.2.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.
package/LICENSE ADDED
@@ -0,0 +1,20 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Ahmad Freijeh
4
+ Permission is hereby granted, free of charge, to any person obtaining a copy
5
+ of this software and associated documentation files (the "Software"), to deal
6
+ in the Software without restriction, including without limitation the rights
7
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8
+ copies of the Software, and to permit persons to whom the Software is
9
+ furnished to do so, subject to the following conditions:
10
+
11
+ The above copyright notice and this permission notice shall be included in all
12
+ copies or substantial portions of the Software.
13
+
14
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
20
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,37 @@
1
+ # spotny-sdk
2
+
3
+ Beacon Scanner
4
+
5
+ ## Installation
6
+
7
+
8
+ ```sh
9
+ npm install spotny-sdk
10
+ ```
11
+
12
+
13
+ ## Usage
14
+
15
+
16
+ ```js
17
+ import { multiply } from 'spotny-sdk';
18
+
19
+ // ...
20
+
21
+ const result = multiply(3, 7);
22
+ ```
23
+
24
+
25
+ ## Contributing
26
+
27
+ - [Development workflow](CONTRIBUTING.md#development-workflow)
28
+ - [Sending a pull request](CONTRIBUTING.md#sending-a-pull-request)
29
+ - [Code of conduct](CODE_OF_CONDUCT.md)
30
+
31
+ ## License
32
+
33
+ MIT
34
+
35
+ ---
36
+
37
+ Made with [create-react-native-library](https://github.com/callstack/react-native-builder-bob)
@@ -0,0 +1,29 @@
1
+ require "json"
2
+
3
+ package = JSON.parse(File.read(File.join(__dir__, "package.json")))
4
+
5
+ Pod::Spec.new do |s|
6
+ s.name = "SpotnySdk"
7
+ s.version = package["version"]
8
+ s.summary = package["description"]
9
+ s.homepage = package["homepage"]
10
+ s.license = package["license"]
11
+ s.authors = package["author"]
12
+
13
+ s.platforms = { :ios => min_ios_version_supported }
14
+ s.source = { :git => "https://github.com/Spotny-SA/spotny-sdk.git", :tag => "#{s.version}" }
15
+
16
+ s.source_files = "ios/**/*.{h,m,mm,swift,cpp}"
17
+ s.private_header_files = "ios/**/*.h"
18
+
19
+ # Kontakt.io beacon SDK (iBeacon scanning)
20
+ s.dependency "KontaktSDK", "~> 3.0"
21
+
22
+ # Swift bridging header
23
+ s.pod_target_xcconfig = {
24
+ "SWIFT_OBJC_BRIDGING_HEADER" => "$(PODS_TARGET_SRCROOT)/ios/SpotnySdk-Bridging-Header.h",
25
+ "SWIFT_VERSION" => "5.0"
26
+ }
27
+
28
+ install_modules_dependencies(s)
29
+ end
@@ -0,0 +1,70 @@
1
+ buildscript {
2
+ ext.SpotnySdk = [
3
+ kotlinVersion: "2.0.21",
4
+ minSdkVersion: 24,
5
+ compileSdkVersion: 36,
6
+ targetSdkVersion: 36
7
+ ]
8
+
9
+ ext.getExtOrDefault = { prop ->
10
+ if (rootProject.ext.has(prop)) {
11
+ return rootProject.ext.get(prop)
12
+ }
13
+
14
+ return SpotnySdk[prop]
15
+ }
16
+
17
+ repositories {
18
+ google()
19
+ mavenCentral()
20
+ }
21
+
22
+ dependencies {
23
+ classpath "com.android.tools.build:gradle:8.7.2"
24
+ // noinspection DifferentKotlinGradleVersion
25
+ classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:${getExtOrDefault('kotlinVersion')}"
26
+ }
27
+ }
28
+
29
+
30
+ apply plugin: "com.android.library"
31
+ apply plugin: "kotlin-android"
32
+
33
+ apply plugin: "com.facebook.react"
34
+
35
+ android {
36
+ namespace "com.spotnysdk"
37
+
38
+ compileSdkVersion getExtOrDefault("compileSdkVersion")
39
+
40
+ defaultConfig {
41
+ minSdkVersion getExtOrDefault("minSdkVersion")
42
+ targetSdkVersion getExtOrDefault("targetSdkVersion")
43
+ }
44
+
45
+ buildFeatures {
46
+ buildConfig true
47
+ }
48
+
49
+ buildTypes {
50
+ release {
51
+ minifyEnabled false
52
+ }
53
+ }
54
+
55
+ lint {
56
+ disable "GradleCompatible"
57
+ }
58
+
59
+ compileOptions {
60
+ sourceCompatibility JavaVersion.VERSION_1_8
61
+ targetCompatibility JavaVersion.VERSION_1_8
62
+ }
63
+ }
64
+
65
+ dependencies {
66
+ implementation "com.facebook.react:react-android"
67
+
68
+ // AltBeacon — iBeacon scanning for Android
69
+ implementation "org.altbeacon:android-beacon-library:2.20.5"
70
+ }
@@ -0,0 +1,33 @@
1
+ <manifest xmlns:android="http://schemas.android.com/apk/res/android">
2
+
3
+ <!-- BLE scanning -->
4
+ <uses-permission android:name="android.permission.BLUETOOTH" />
5
+ <uses-permission android:name="android.permission.BLUETOOTH_ADMIN" />
6
+ <!-- Android 12+ -->
7
+ <uses-permission android:name="android.permission.BLUETOOTH_SCAN"
8
+ android:usesPermissionFlags="neverForLocation" />
9
+ <uses-permission android:name="android.permission.BLUETOOTH_CONNECT" />
10
+
11
+ <!-- Location is required for beacon scanning on API < 31 -->
12
+ <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
13
+ <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
14
+ <!-- Background location required for background scanning -->
15
+ <uses-permission android:name="android.permission.ACCESS_BACKGROUND_LOCATION" />
16
+
17
+ <!-- Run foreground service while scanning in background -->
18
+ <uses-permission android:name="android.permission.FOREGROUND_SERVICE" />
19
+ <uses-permission android:name="android.permission.FOREGROUND_SERVICE_LOCATION" />
20
+
21
+ <uses-feature android:name="android.hardware.bluetooth_le" android:required="false" />
22
+
23
+ <application>
24
+ <!-- AltBeacon background scanning service -->
25
+ <service android:name="org.altbeacon.beacon.service.BeaconService"
26
+ android:enabled="true"
27
+ android:exported="false"
28
+ android:isolatedProcess="false" />
29
+ <service android:name="org.altbeacon.beacon.BeaconIntentProcessor"
30
+ android:exported="false" />
31
+ </application>
32
+
33
+ </manifest>