@capawesome/capacitor-pixlive 0.1.3 → 0.1.5

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/README.md CHANGED
@@ -1,7 +1,16 @@
1
- # @capawesome/capacitor-pixlive
1
+ # Capacitor PixLive Plugin
2
2
 
3
3
  Unofficial Capacitor plugin for [PixLive SDK](https://www.vidinoti.com/) by Vidinoti.
4
4
 
5
+ ## Use Cases
6
+
7
+ The PixLive plugin is typically used to build augmented reality experiences with content managed in PixLive Maker, for example:
8
+
9
+ - **Interactive print media**: Bring magazines, flyers, or posters to life with AR content that appears when a context is recognized by the AR camera.
10
+ - **Guided tours**: Synchronize tours and contexts to guide visitors through museums, exhibitions, or cities.
11
+ - **Location-based experiences**: Trigger content or local notifications when the user approaches GPS points or beacons.
12
+ - **QR code interactions**: React to QR codes and barcodes scanned by the AR camera via the `codeRecognize` event.
13
+
5
14
  ## Installation
6
15
 
7
16
  ```bash
@@ -47,12 +56,26 @@ const config: CapacitorConfig = {
47
56
 
48
57
  ## Usage
49
58
 
59
+ The following examples show how to synchronize content from PixLive Maker and display the AR view.
60
+
61
+ ### Synchronize content from PixLive Maker
62
+
63
+ Sync AR content from PixLive Maker filtered by tags so that it is available on the device. Only available on Android and iOS:
64
+
50
65
  ```typescript
51
66
  import { Pixlive } from '@capawesome/capacitor-pixlive';
52
67
 
53
68
  const synchronize = async () => {
54
69
  await Pixlive.synchronize({ tags: [['my-tag']] });
55
70
  };
71
+ ```
72
+
73
+ ### Display the AR view
74
+
75
+ Create the native AR camera view at the specified screen coordinates. Only available on Android and iOS:
76
+
77
+ ```typescript
78
+ import { Pixlive } from '@capawesome/capacitor-pixlive';
56
79
 
57
80
  const createARView = async () => {
58
81
  await Pixlive.createARView({ x: 0, y: 0, width: 300, height: 400 });
@@ -1011,3 +1034,35 @@ Remove all listeners for this plugin.
1011
1034
  <code>'bluetooth' | 'bluetoothConnect' | 'bluetoothScan' | 'camera' | 'location' | 'notifications'</code>
1012
1035
 
1013
1036
  </docgen-api>
1037
+
1038
+ ## FAQ
1039
+
1040
+ ### Which method do I have to call first?
1041
+
1042
+ The `initialize()` method must be called before any other method of the plugin. It initializes the PixLive SDK using the license key from your Capacitor configuration file (see [Configuration](#configuration)).
1043
+
1044
+ ### How do I set up the PixLive SDK in my project?
1045
+
1046
+ The PixLive SDK itself is not bundled with the plugin. On Android, copy the `vdarsdk-release.aar` file into your app's `android/app/libs/` directory. On iOS, copy `VDARSDK.xcframework` into `ios/App/Frameworks/` in your Capacitor project. See the [Installation](#installation) section for details.
1047
+
1048
+ ### Does this plugin support Swift Package Manager?
1049
+
1050
+ No, this plugin only supports CocoaPods as the iOS dependency manager. Swift Package Manager is not supported.
1051
+
1052
+ ### Does this plugin work on the Web?
1053
+
1054
+ No, the plugin methods are only available on Android and iOS since they rely on the native PixLive SDK.
1055
+
1056
+ ### Which permissions does the plugin handle?
1057
+
1058
+ The plugin can check and request the camera, location, notifications, and Bluetooth permissions via the `checkPermissions()` and `requestPermissions(...)` methods. The Bluetooth permission is exposed as `bluetooth` on iOS and as `bluetoothConnect` and `bluetoothScan` on Android.
1059
+
1060
+ ### Can I use this plugin with Ionic, React, Vue or Angular?
1061
+
1062
+ Yes, the plugin is framework-agnostic. It works in any Capacitor app regardless of the web framework, including Ionic with Angular, React, or Vue, as well as plain JavaScript projects.
1063
+
1064
+ ## Related Plugins
1065
+
1066
+ - [Barcode Scanning](https://capawesome.io/docs/sdks/capacitor/mlkit/barcode-scanning/): Scan barcodes and QR codes with ML Kit.
1067
+ - [Bluetooth Low Energy](https://capawesome.io/docs/sdks/capacitor/bluetooth-low-energy/): Communicate with Bluetooth Low Energy devices such as beacons.
1068
+ - [Geocoder](https://capawesome.io/docs/sdks/capacitor/geocoder/): Handle geocoding and reverse geocoding.
@@ -31,7 +31,7 @@ android {
31
31
  buildTypes {
32
32
  release {
33
33
  minifyEnabled false
34
- proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
34
+ proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
35
35
  }
36
36
  }
37
37
  lintOptions {
@@ -58,8 +58,10 @@ public class PixliveHelper {
58
58
  obj.put("imageHiResURL", context.getImageHiResURL() != null ? context.getImageHiResURL() : JSONObject.NULL);
59
59
  obj.put("notificationTitle", context.getNotificationTitle() != null ? context.getNotificationTitle() : JSONObject.NULL);
60
60
  obj.put("notificationMessage", context.getNotificationMessage() != null ? context.getNotificationMessage() : JSONObject.NULL);
61
- obj.put("tags", context.getTags() != null ? context.getTags() : new JSArray());
62
- obj.put("languages", context.getLanguages() != null ? context.getLanguages() : new JSArray());
61
+ JSArray tagsArray = arrayListToJSArray(context.getTags());
62
+ JSArray languagesArray = arrayListToJSArray(context.getLanguages());
63
+ obj.put("tags", tagsArray);
64
+ obj.put("languages", languagesArray);
63
65
  return obj;
64
66
  }
65
67
 
@@ -110,4 +112,15 @@ public class PixliveHelper {
110
112
  return "unknown";
111
113
  }
112
114
  }
115
+
116
+ @NonNull
117
+ private static JSArray arrayListToJSArray(@Nullable ArrayList<String> list) {
118
+ JSArray result = new JSArray();
119
+ if (list != null) {
120
+ for (String item : list) {
121
+ result.put(item);
122
+ }
123
+ }
124
+ return result;
125
+ }
113
126
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@capawesome/capacitor-pixlive",
3
- "version": "0.1.3",
4
- "description": "Unofficial Capacitor plugin for Pixlive SDK.",
3
+ "version": "0.1.5",
4
+ "description": "Unofficial Capacitor plugin for Pixlive SDK on Android and iOS.",
5
5
  "main": "dist/plugin.cjs.js",
6
6
  "module": "dist/esm/index.js",
7
7
  "types": "dist/esm/index.d.ts",
@@ -36,7 +36,14 @@
36
36
  "keywords": [
37
37
  "capacitor",
38
38
  "plugin",
39
- "native"
39
+ "native",
40
+ "capacitor-plugin",
41
+ "pixlive",
42
+ "vidinoti",
43
+ "augmented reality",
44
+ "ar",
45
+ "ar view",
46
+ "qr code"
40
47
  ],
41
48
  "scripts": {
42
49
  "verify": "npm run verify:ios && npm run verify:android && npm run verify:web",