lig-scanner-expo-sdk 1.0.0 → 1.0.2

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 (35) hide show
  1. package/android/.gradle/9.0.0/checksums/checksums.lock +0 -0
  2. package/android/.gradle/9.0.0/fileChanges/last-build.bin +0 -0
  3. package/android/.gradle/9.0.0/fileHashes/fileHashes.lock +0 -0
  4. package/android/.gradle/9.0.0/gc.properties +0 -0
  5. package/android/.gradle/buildOutputCleanup/buildOutputCleanup.lock +0 -0
  6. package/android/.gradle/buildOutputCleanup/cache.properties +2 -2
  7. package/android/build.gradle +3 -3
  8. package/android/src/main/AndroidManifest.xml +2 -1
  9. package/android/src/main/java/tw/com/lig/scanner/rn/expo/ARPlayerView.kt +188 -140
  10. package/android/src/main/java/tw/com/lig/scanner/rn/expo/LigScannerExpoSdkModule.kt +50 -12
  11. package/build/LigScannerExpoSdk.types.d.ts +1 -1
  12. package/build/LigScannerExpoSdk.types.d.ts.map +1 -1
  13. package/build/LigScannerExpoSdk.types.js.map +1 -1
  14. package/build/ScanView.js +3 -3
  15. package/build/ScanView.js.map +1 -1
  16. package/build/hooks/useLigScanner.d.ts +13 -52
  17. package/build/hooks/useLigScanner.d.ts.map +1 -1
  18. package/build/hooks/useLigScanner.js +36 -39
  19. package/build/hooks/useLigScanner.js.map +1 -1
  20. package/lig-scanner-sample-app/App.tsx +287 -0
  21. package/lig-scanner-sample-app/README.md +53 -0
  22. package/lig-scanner-sample-app/app.json +44 -0
  23. package/lig-scanner-sample-app/assets/adaptive-icon.png +0 -0
  24. package/lig-scanner-sample-app/assets/favicon.png +0 -0
  25. package/lig-scanner-sample-app/assets/icon.png +0 -0
  26. package/lig-scanner-sample-app/assets/splash-icon.png +0 -0
  27. package/lig-scanner-sample-app/babel.config.js +6 -0
  28. package/lig-scanner-sample-app/index.ts +8 -0
  29. package/lig-scanner-sample-app/package-lock.json +8177 -0
  30. package/lig-scanner-sample-app/package.json +25 -0
  31. package/lig-scanner-sample-app/tsconfig.json +6 -0
  32. package/package.json +1 -1
  33. package/src/LigScannerExpoSdk.types.ts +4 -4
  34. package/src/ScanView.tsx +6 -6
  35. package/src/hooks/useLigScanner.ts +60 -67
@@ -0,0 +1,53 @@
1
+ # LiG Scanner Expo SDK Sample App
2
+
3
+ This is a complete sample application demonstrating the usage of `lig-scanner-expo-sdk` for React Native (Expo).
4
+ It showcases:
5
+ - **Automated Scanning**: Using the `useLigScanner` hook.
6
+ - **AR Experience**: Transitioning to `ARPlayerView` with aligned 3D models.
7
+ - **Full Lifecycle**: Correctly handling camera session management.
8
+
9
+ ## Prerequisites
10
+
11
+ - **Node.js** (LTS recommended)
12
+ - **Xcode** (for iOS build)
13
+ - **CocoaPods**
14
+
15
+ ## Setup
16
+
17
+ 1. **Install Dependencies**
18
+ ```bash
19
+ npm install
20
+ ```
21
+
22
+ 2. **Install iOS Native Pods**
23
+ ```bash
24
+ cd ios
25
+ pod install
26
+ cd ..
27
+ ```
28
+
29
+ ## iOS Configuration (Crucial)
30
+
31
+ Before running on a real device, you **MUST** configure code signing:
32
+
33
+ 1. Open `ios/ligscannersampleapp.xcworkspace` in **Xcode**.
34
+ 2. Select the `ligscannersampleapp` target in the project navigator.
35
+ 3. Go to the **Signing & Capabilities** tab.
36
+ 4. Under **Signing**, select your **Development Team**.
37
+ *(If using a Free Apple ID, you may need to "Trust" the app in Settings > General > VPN & Device Management on your iPhone)*.
38
+
39
+ ## Running the App
40
+
41
+ 1. **Start the Metro Bundler**
42
+ ```bash
43
+ npx expo start -c
44
+ ```
45
+
46
+ 2. **Run on Device**
47
+ - **Recommended**: Press the **Play** (Run) button in Xcode (ensure your device is selected).
48
+ - **CLI**: You can also run `npx expo run:ios --device` (but `pod install` must be done first).
49
+
50
+ ## Notes
51
+
52
+ - **Expo Version**: This sample is strictly pinned to **Expo 53** (`~53.0.22`) to match the SDK compatibility. Do not upgrade to Expo 54 until a new SDK release is available.
53
+ - **Logic**: The `App.tsx` contains `IntegratedDemo` which mirrors the official example implementation. It keeps the Scanner view mounted in the background to manage the camera session correctly. Do not unmount `ScanView` when showing AR content.
@@ -0,0 +1,44 @@
1
+ {
2
+ "expo": {
3
+ "name": "lig-scanner-sample-app",
4
+ "slug": "lig-scanner-sample-app",
5
+ "version": "1.0.0",
6
+ "orientation": "portrait",
7
+ "icon": "./assets/icon.png",
8
+ "userInterfaceStyle": "light",
9
+ "newArchEnabled": true,
10
+ "splash": {
11
+ "image": "./assets/splash-icon.png",
12
+ "resizeMode": "contain",
13
+ "backgroundColor": "#ffffff"
14
+ },
15
+ "plugins": [
16
+ [
17
+ "expo-sensors",
18
+ {
19
+ "motionPermission": "Allow $(PRODUCT_NAME) to access your device motion"
20
+ }
21
+ ]
22
+ ],
23
+ "ios": {
24
+ "supportsTablet": true,
25
+ "bundleIdentifier": "com.lig.scanner.sample",
26
+ "infoPlist": {
27
+ "NSCameraUsageDescription": "Allow $(PRODUCT_NAME) to access your camera for scanning tags.",
28
+ "NSMotionUsageDescription": "Allow $(PRODUCT_NAME) to access your device motion for AR alignment.",
29
+ "NSMicrophoneUsageDescription": "Allow $(PRODUCT_NAME) to access your microphone for video recording."
30
+ }
31
+ },
32
+ "android": {
33
+ "adaptiveIcon": {
34
+ "foregroundImage": "./assets/adaptive-icon.png",
35
+ "backgroundColor": "#ffffff"
36
+ },
37
+ "edgeToEdgeEnabled": true,
38
+ "predictiveBackGestureEnabled": false
39
+ },
40
+ "web": {
41
+ "favicon": "./assets/favicon.png"
42
+ }
43
+ }
44
+ }
@@ -0,0 +1,6 @@
1
+ module.exports = function (api) {
2
+ api.cache(true);
3
+ return {
4
+ presets: ['babel-preset-expo'],
5
+ };
6
+ };
@@ -0,0 +1,8 @@
1
+ import { registerRootComponent } from 'expo';
2
+
3
+ import App from './App';
4
+
5
+ // registerRootComponent calls AppRegistry.registerComponent('main', () => App);
6
+ // It also ensures that whether you load the app in Expo Go or in a native build,
7
+ // the environment is set up appropriately
8
+ registerRootComponent(App);