@capgo/capacitor-ricoh360 8.0.21 → 8.0.24

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.
@@ -13,6 +13,5 @@ Pod::Spec.new do |s|
13
13
  s.source_files = 'ios/Sources/**/*.{swift,h,m,c,cc,mm,cpp}'
14
14
  s.ios.deployment_target = '15.0'
15
15
  s.dependency 'Capacitor'
16
- s.dependency 'Alamofire', '~> 5.10.2'
17
16
  s.swift_version = '5.1'
18
17
  end
package/Package.swift CHANGED
@@ -10,16 +10,14 @@ let package = Package(
10
10
  targets: ["Ricoh360CameraPlugin"])
11
11
  ],
12
12
  dependencies: [
13
- .package(url: "https://github.com/ionic-team/capacitor-swift-pm.git", from: "8.0.0"),
14
- .package(url: "https://github.com/Alamofire/Alamofire.git", from: "5.10.2")
13
+ .package(url: "https://github.com/ionic-team/capacitor-swift-pm.git", from: "8.0.0")
15
14
  ],
16
15
  targets: [
17
16
  .target(
18
17
  name: "Ricoh360CameraPlugin",
19
18
  dependencies: [
20
19
  .product(name: "Capacitor", package: "capacitor-swift-pm"),
21
- .product(name: "Cordova", package: "capacitor-swift-pm"),
22
- "Alamofire"
20
+ .product(name: "Cordova", package: "capacitor-swift-pm")
23
21
  ],
24
22
  path: "ios/Sources/Ricoh360CameraPlugin"),
25
23
  .testTarget(
package/README.md CHANGED
@@ -1,13 +1,28 @@
1
1
  # @capgo/capacitor-ricoh360
2
2
 
3
- <a href="https://capgo.app/"><img src="https://capgo.app/readme-banner.svg?repo=Cap-go/capacitor-ricoh360-camera-plugin" alt="Capgo - Instant updates for Capacitor" /></a>
3
+ Control Ricoh 360 cameras from your Capacitor app: live preview, photo capture, settings and file access.
4
+
5
+ <a href="https://capgo.app/?ref=plugin_ricoh360_camera_plugin"><img src="https://capgo.app/readme-banner.svg?repo=Cap-go/capacitor-ricoh360-camera-plugin" alt="Capgo - Instant updates for Capacitor" /></a>
4
6
 
5
7
  <div align="center">
6
- <h2><a href="https://capgo.app/?ref=plugin_ricoh360_camera_plugin"> ➡️ Get Instant updates for your App with Capgo</a></h2>
7
- <h2><a href="https://capgo.app/consulting/?ref=plugin_ricoh360_camera_plugin"> Missing a feature? We’ll build the plugin for you 💪</a></h2>
8
+ <p><b>Capgo</b>: open-source live updates for Ionic and Capacitor apps. Ship OTA fixes and features instantly, without waiting for app store review.</p>
9
+ <h2><a href="https://capgo.app/register/?ref=plugin_ricoh360_camera_plugin">➡️ Get started for free</a></h2>
10
+ <p>14-day unlimited free trial. No credit card required</p>
11
+ <p><a href="https://capgo.app/consulting/?ref=plugin_ricoh360_camera_plugin">Missing a feature? We'll build the plugin for you 💪</a></p>
8
12
  </div>
9
13
 
10
- Provides an SDK for the Ricoh360 cameras for Capacitor
14
+ <p align="center">
15
+ <img src="https://raw.githubusercontent.com/Cap-go/capacitor-ricoh360-camera-plugin/main/assets/github-social-preview.png" alt="@capgo/capacitor-ricoh360 for Capacitor apps" width="300" />
16
+ </p>
17
+
18
+ ## Key features
19
+
20
+ - **Connect**: `initialize()` with the camera URL.
21
+ - **Capture**: `capturePicture()` takes a photo.
22
+ - **Live preview**: `livePreview()` and `stopLivePreview()`.
23
+ - **Files**: `listFiles()` and `getCameraAsset()` read media stored on the camera.
24
+ - **Settings and commands**: `readSettings()`, `setSettings()` and `sendCommand()` for raw camera API calls.
25
+ - **Platforms**: iOS and Android. Not available on web.
11
26
 
12
27
  ## Documentation
13
28
 
@@ -1,6 +1,5 @@
1
1
  import Foundation
2
2
  import Capacitor
3
- import Alamofire
4
3
  import AVKit
5
4
  import UIKit
6
5
  import Network
@@ -11,7 +10,7 @@ import Network
11
10
  */
12
11
  @objc(Ricoh360CameraPlugin)
13
12
  public class Ricoh360CameraPlugin: CAPPlugin, CAPBridgedPlugin, URLSessionDataDelegate { // swiftlint:disable:this type_body_length
14
- private let pluginVersion: String = "8.0.21"
13
+ private let pluginVersion: String = "8.0.24"
15
14
  public let identifier = "Ricoh360CameraPlugin"
16
15
  public let jsName = "Ricoh360Camera"
17
16
  public let pluginMethods: [CAPPluginMethod] = [
@@ -208,22 +207,38 @@ public class Ricoh360CameraPlugin: CAPPlugin, CAPBridgedPlugin, URLSessionDataDe
208
207
 
209
208
  requestLocalNetworkPermission { [weak self] granted in
210
209
  if granted {
211
- AF.request(infoUrl).validate().responseData { response in
212
- switch response.result {
213
- case .success(let data):
214
- do {
215
- if let json = try JSONSerialization.jsonObject(with: data, options: []) as? [String: Any] {
216
- call.resolve(["session": "Initialized", "info": json])
217
- } else {
218
- call.reject("Camera is not reachable or info could not be retrieved")
219
- }
220
- } catch {
210
+ guard let url = URL(string: infoUrl) else {
211
+ call.reject("Camera is not reachable or info could not be retrieved")
212
+ return
213
+ }
214
+ var request = URLRequest(url: url)
215
+ request.httpMethod = "GET"
216
+ request.timeoutInterval = 60
217
+
218
+ let task = URLSession.shared.dataTask(with: request) { data, response, error in
219
+ if error != nil {
220
+ call.reject("Camera is not reachable or info could not be retrieved")
221
+ return
222
+ }
223
+
224
+ guard let httpResponse = response as? HTTPURLResponse,
225
+ (200...299).contains(httpResponse.statusCode),
226
+ let data = data else {
227
+ call.reject("Camera is not reachable or info could not be retrieved")
228
+ return
229
+ }
230
+
231
+ do {
232
+ if let json = try JSONSerialization.jsonObject(with: data, options: []) as? [String: Any] {
233
+ call.resolve(["session": "Initialized", "info": json])
234
+ } else {
221
235
  call.reject("Camera is not reachable or info could not be retrieved")
222
236
  }
223
- case .failure(let error):
237
+ } catch {
224
238
  call.reject("Camera is not reachable or info could not be retrieved")
225
239
  }
226
240
  }
241
+ task.resume()
227
242
  } else {
228
243
  call.reject("Permission not granted")
229
244
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@capgo/capacitor-ricoh360",
3
- "version": "8.0.21",
3
+ "version": "8.0.24",
4
4
  "description": "Provides an SDK for the Ricoh360 cameras for Capacitor",
5
5
  "main": "dist/plugin.cjs.js",
6
6
  "module": "dist/esm/index.js",