@capacitor-community/camera-preview 2.0.0-beta.0 → 2.0.0-beta.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.
- package/CapacitorCommunityCameraPreview.podspec +3 -2
- package/LICENSE +21 -0
- package/README.md +46 -57
- package/android/build.gradle +4 -4
- package/android/src/main/java/com/ahm/capacitor/camera/preview/CameraPreview.java +127 -118
- package/dist/esm/definitions.d.ts +9 -5
- package/dist/esm/definitions.js +1 -0
- package/dist/esm/index.d.ts +3 -1
- package/dist/esm/index.js +5 -1
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/web.d.ts +7 -1
- package/dist/esm/web.js +89 -77
- package/dist/esm/web.js.map +1 -1
- package/ios/Plugin/CameraController.swift +155 -48
- package/ios/Plugin/Plugin.m +3 -0
- package/ios/Plugin/Plugin.swift +125 -46
- package/ios/Plugin.xcodeproj/project.pbxproj +2 -6
- package/ios/Podfile +2 -2
- package/ios/Podfile.lock +4 -4
- package/package.json +7 -6
- package/android/local.properties +0 -8
- package/ios/Plugin.xcodeproj/xcuserdata/ahernandez.xcuserdatad/xcschemes/xcschememanagement.plist +0 -14
- package/ios/Plugin.xcodeproj/xcuserdata/nielsvanharen.xcuserdatad/xcschemes/xcschememanagement.plist +0 -14
- package/ios/Plugin.xcworkspace/xcuserdata/ahernandez.xcuserdatad/UserInterfaceState.xcuserstate +0 -0
- package/ios/Plugin.xcworkspace/xcuserdata/arielhernandezmusa.xcuserdatad/UserInterfaceState.xcuserstate +0 -0
- package/ios/Plugin.xcworkspace/xcuserdata/nielsvanharen.xcuserdatad/UserInterfaceState.xcuserstate +0 -0
- package/ios/Pods/CapacitorCordova/LICENSE +0 -23
- package/ios/Pods/CapacitorCordova/README.md +0 -39
- package/ios/Pods/CapacitorCordova/ios/CapacitorCordova/CapacitorCordova/CapacitorCordova.h +0 -21
- package/ios/Pods/CapacitorCordova/ios/CapacitorCordova/CapacitorCordova/Classes/Public/AppDelegate.h +0 -8
- package/ios/Pods/CapacitorCordova/ios/CapacitorCordova/CapacitorCordova/Classes/Public/AppDelegate.m +0 -5
- package/ios/Pods/CapacitorCordova/ios/CapacitorCordova/CapacitorCordova/Classes/Public/CDV.h +0 -28
- package/ios/Pods/CapacitorCordova/ios/CapacitorCordova/CapacitorCordova/Classes/Public/CDVAvailability.h +0 -109
- package/ios/Pods/CapacitorCordova/ios/CapacitorCordova/CapacitorCordova/Classes/Public/CDVCommandDelegate.h +0 -51
- package/ios/Pods/CapacitorCordova/ios/CapacitorCordova/CapacitorCordova/Classes/Public/CDVCommandDelegateImpl.h +0 -39
- package/ios/Pods/CapacitorCordova/ios/CapacitorCordova/CapacitorCordova/Classes/Public/CDVCommandDelegateImpl.m +0 -154
- package/ios/Pods/CapacitorCordova/ios/CapacitorCordova/CapacitorCordova/Classes/Public/CDVConfigParser.h +0 -31
- package/ios/Pods/CapacitorCordova/ios/CapacitorCordova/CapacitorCordova/Classes/Public/CDVConfigParser.m +0 -81
- package/ios/Pods/CapacitorCordova/ios/CapacitorCordova/CapacitorCordova/Classes/Public/CDVInvokedUrlCommand.h +0 -52
- package/ios/Pods/CapacitorCordova/ios/CapacitorCordova/CapacitorCordova/Classes/Public/CDVInvokedUrlCommand.m +0 -116
- package/ios/Pods/CapacitorCordova/ios/CapacitorCordova/CapacitorCordova/Classes/Public/CDVPlugin.h +0 -81
- package/ios/Pods/CapacitorCordova/ios/CapacitorCordova/CapacitorCordova/Classes/Public/CDVPlugin.m +0 -154
- package/ios/Pods/CapacitorCordova/ios/CapacitorCordova/CapacitorCordova/Classes/Public/CDVPluginManager.h +0 -25
- package/ios/Pods/CapacitorCordova/ios/CapacitorCordova/CapacitorCordova/Classes/Public/CDVPluginManager.m +0 -77
- package/ios/Pods/CapacitorCordova/ios/CapacitorCordova/CapacitorCordova/Classes/Public/CDVPluginResult.h +0 -82
- package/ios/Pods/CapacitorCordova/ios/CapacitorCordova/CapacitorCordova/Classes/Public/CDVPluginResult.m +0 -216
- package/ios/Pods/CapacitorCordova/ios/CapacitorCordova/CapacitorCordova/Classes/Public/CDVScreenOrientationDelegate.h +0 -33
- package/ios/Pods/CapacitorCordova/ios/CapacitorCordova/CapacitorCordova/Classes/Public/CDVUIWebViewDelegate.h +0 -41
- package/ios/Pods/CapacitorCordova/ios/CapacitorCordova/CapacitorCordova/Classes/Public/CDVUIWebViewDelegate.m +0 -399
- package/ios/Pods/CapacitorCordova/ios/CapacitorCordova/CapacitorCordova/Classes/Public/CDVURLProtocol.h +0 -27
- package/ios/Pods/CapacitorCordova/ios/CapacitorCordova/CapacitorCordova/Classes/Public/CDVURLProtocol.m +0 -74
- package/ios/Pods/CapacitorCordova/ios/CapacitorCordova/CapacitorCordova/Classes/Public/CDVUserAgentUtil.h +0 -27
- package/ios/Pods/CapacitorCordova/ios/CapacitorCordova/CapacitorCordova/Classes/Public/CDVUserAgentUtil.m +0 -156
- package/ios/Pods/CapacitorCordova/ios/CapacitorCordova/CapacitorCordova/Classes/Public/CDVViewController.h +0 -30
- package/ios/Pods/CapacitorCordova/ios/CapacitorCordova/CapacitorCordova/Classes/Public/CDVViewController.m +0 -34
- package/ios/Pods/CapacitorCordova/ios/CapacitorCordova/CapacitorCordova/Classes/Public/NSDictionary+CordovaPreferences.h +0 -35
- package/ios/Pods/CapacitorCordova/ios/CapacitorCordova/CapacitorCordova/Classes/Public/NSDictionary+CordovaPreferences.m +0 -63
- package/ios/Pods/Local Podspecs/Capacitor.podspec.json +0 -31
- package/ios/Pods/Manifest.lock +0 -23
- package/ios/Pods/Pods.xcodeproj/project.pbxproj +0 -1296
- package/ios/Pods/Pods.xcodeproj/xcuserdata/ahernandez.xcuserdatad/xcschemes/Capacitor.xcscheme +0 -60
- package/ios/Pods/Pods.xcodeproj/xcuserdata/ahernandez.xcuserdatad/xcschemes/CapacitorCordova.xcscheme +0 -58
- package/ios/Pods/Pods.xcodeproj/xcuserdata/ahernandez.xcuserdatad/xcschemes/Pods-Plugin.xcscheme +0 -58
- package/ios/Pods/Pods.xcodeproj/xcuserdata/ahernandez.xcuserdatad/xcschemes/Pods-PluginTests.xcscheme +0 -58
- package/ios/Pods/Pods.xcodeproj/xcuserdata/ahernandez.xcuserdatad/xcschemes/xcschememanagement.plist +0 -39
- package/ios/Pods/Target Support Files/Capacitor/Capacitor-Info.plist +0 -26
- package/ios/Pods/Target Support Files/Capacitor/Capacitor-dummy.m +0 -5
- package/ios/Pods/Target Support Files/Capacitor/Capacitor-prefix.pch +0 -12
- package/ios/Pods/Target Support Files/Capacitor/Capacitor.debug.xcconfig +0 -13
- package/ios/Pods/Target Support Files/Capacitor/Capacitor.modulemap +0 -7
- package/ios/Pods/Target Support Files/Capacitor/Capacitor.release.xcconfig +0 -13
- package/ios/Pods/Target Support Files/CapacitorCordova/CapacitorCordova-Info.plist +0 -26
- package/ios/Pods/Target Support Files/CapacitorCordova/CapacitorCordova-dummy.m +0 -5
- package/ios/Pods/Target Support Files/CapacitorCordova/CapacitorCordova-prefix.pch +0 -12
- package/ios/Pods/Target Support Files/CapacitorCordova/CapacitorCordova-umbrella.h +0 -32
- package/ios/Pods/Target Support Files/CapacitorCordova/CapacitorCordova.debug.xcconfig +0 -12
- package/ios/Pods/Target Support Files/CapacitorCordova/CapacitorCordova.modulemap +0 -6
- package/ios/Pods/Target Support Files/CapacitorCordova/CapacitorCordova.release.xcconfig +0 -12
- package/ios/Pods/Target Support Files/Pods-Plugin/Pods-Plugin-Info.plist +0 -26
- package/ios/Pods/Target Support Files/Pods-Plugin/Pods-Plugin-acknowledgements.markdown +0 -57
- package/ios/Pods/Target Support Files/Pods-Plugin/Pods-Plugin-acknowledgements.plist +0 -95
- package/ios/Pods/Target Support Files/Pods-Plugin/Pods-Plugin-dummy.m +0 -5
- package/ios/Pods/Target Support Files/Pods-Plugin/Pods-Plugin-umbrella.h +0 -16
- package/ios/Pods/Target Support Files/Pods-Plugin/Pods-Plugin.debug.xcconfig +0 -13
- package/ios/Pods/Target Support Files/Pods-Plugin/Pods-Plugin.modulemap +0 -6
- package/ios/Pods/Target Support Files/Pods-Plugin/Pods-Plugin.release.xcconfig +0 -13
- package/ios/Pods/Target Support Files/Pods-PluginTests/Pods-PluginTests-Info.plist +0 -26
- package/ios/Pods/Target Support Files/Pods-PluginTests/Pods-PluginTests-acknowledgements.markdown +0 -57
- package/ios/Pods/Target Support Files/Pods-PluginTests/Pods-PluginTests-acknowledgements.plist +0 -95
- package/ios/Pods/Target Support Files/Pods-PluginTests/Pods-PluginTests-dummy.m +0 -5
- package/ios/Pods/Target Support Files/Pods-PluginTests/Pods-PluginTests-frameworks.sh +0 -187
- package/ios/Pods/Target Support Files/Pods-PluginTests/Pods-PluginTests-umbrella.h +0 -16
- package/ios/Pods/Target Support Files/Pods-PluginTests/Pods-PluginTests.debug.xcconfig +0 -14
- package/ios/Pods/Target Support Files/Pods-PluginTests/Pods-PluginTests.modulemap +0 -6
- package/ios/Pods/Target Support Files/Pods-PluginTests/Pods-PluginTests.release.xcconfig +0 -14
package/ios/Plugin/Plugin.swift
CHANGED
|
@@ -23,27 +23,35 @@ public class CameraPreview: CAPPlugin {
|
|
|
23
23
|
|
|
24
24
|
@objc func rotated() {
|
|
25
25
|
|
|
26
|
-
let height = self.paddingBottom != nil ? self.height! - self.paddingBottom!: self.height!;
|
|
27
|
-
|
|
28
26
|
if UIDevice.current.orientation.isLandscape {
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
if (UIDevice.current.orientation == UIDeviceOrientation.landscapeRight) {
|
|
38
|
-
self.cameraController.previewLayer?.connection?.videoOrientation = .landscapeLeft
|
|
27
|
+
if(self.width! > self.height!) {
|
|
28
|
+
// we started in landscape
|
|
29
|
+
let height = self.paddingBottom != nil ? self.height! - self.paddingBottom!: self.height!;
|
|
30
|
+
self.previewView.frame = CGRect(x: self.x!, y: self.y!, width: self.width!, height: height)
|
|
31
|
+
} else {
|
|
32
|
+
// we started in portrait
|
|
33
|
+
let width = self.paddingBottom != nil ? self.width! - self.paddingBottom!: self.width!;
|
|
34
|
+
self.previewView.frame = CGRect(x: self.y!, y: self.x!, width: self.height!, height: width)
|
|
39
35
|
}
|
|
36
|
+
self.cameraController.previewLayer?.frame = self.previewView.frame
|
|
40
37
|
}
|
|
41
38
|
|
|
42
39
|
if UIDevice.current.orientation.isPortrait {
|
|
43
|
-
self.previewView
|
|
40
|
+
if (self.previewView != nil && self.x != nil && self.y != nil && self.width != nil && self.height != nil) {
|
|
41
|
+
if(self.height! > self.width!) {
|
|
42
|
+
// we started in portrait
|
|
43
|
+
let height = self.paddingBottom != nil ? self.height! - self.paddingBottom!: self.height!;
|
|
44
|
+
self.previewView.frame = CGRect(x: self.x!, y: self.y!, width: self.width!, height: height)
|
|
45
|
+
} else {
|
|
46
|
+
// we started in landscape
|
|
47
|
+
let width = self.paddingBottom != nil ? self.width! - self.paddingBottom!: self.width!;
|
|
48
|
+
self.previewView.frame = CGRect(x: self.y!, y: self.x!, width: self.height!, height: width)
|
|
49
|
+
}
|
|
50
|
+
}
|
|
44
51
|
self.cameraController.previewLayer?.frame = self.previewView.frame
|
|
45
|
-
self.cameraController.previewLayer?.connection?.videoOrientation = .portrait
|
|
46
52
|
}
|
|
53
|
+
|
|
54
|
+
cameraController.updateVideoOrientation()
|
|
47
55
|
}
|
|
48
56
|
|
|
49
57
|
@objc func start(_ call: CAPPluginCall) {
|
|
@@ -67,44 +75,48 @@ public class CameraPreview: CAPPlugin {
|
|
|
67
75
|
self.paddingBottom = CGFloat(call.getInt("paddingBottom")!)
|
|
68
76
|
}
|
|
69
77
|
|
|
70
|
-
AVCaptureDevice.requestAccess(for: .video, completionHandler: { (granted: Bool) in
|
|
71
|
-
if (!granted) {
|
|
72
|
-
call.reject("permission failed");
|
|
73
|
-
}
|
|
74
|
-
});
|
|
75
|
-
|
|
76
78
|
self.rotateWhenOrientationChanged = call.getBool("rotateWhenOrientationChanged") ?? true
|
|
77
79
|
self.toBack = call.getBool("toBack") ?? false
|
|
78
80
|
self.storeToFile = call.getBool("storeToFile") ?? false
|
|
79
81
|
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
self.webView?.
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
82
|
+
AVCaptureDevice.requestAccess(for: .video, completionHandler: { (granted: Bool) in
|
|
83
|
+
guard granted else {
|
|
84
|
+
call.reject("permission failed");
|
|
85
|
+
return
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
DispatchQueue.main.async {
|
|
89
|
+
if (self.cameraController.captureSession?.isRunning ?? false) {
|
|
90
|
+
call.reject("camera already started")
|
|
91
|
+
} else {
|
|
92
|
+
self.cameraController.prepare(cameraPosition: self.cameraPosition){error in
|
|
93
|
+
if let error = error {
|
|
94
|
+
print(error)
|
|
95
|
+
call.reject(error.localizedDescription)
|
|
96
|
+
return
|
|
97
|
+
}
|
|
98
|
+
let height = self.paddingBottom != nil ? self.height! - self.paddingBottom!: self.height!;
|
|
99
|
+
self.previewView = UIView(frame: CGRect(x: 0, y: 0, width: self.width!, height: height))
|
|
100
|
+
self.webView?.isOpaque = false
|
|
101
|
+
self.webView?.backgroundColor = UIColor.clear
|
|
102
|
+
self.webView?.scrollView.backgroundColor = UIColor.clear
|
|
103
|
+
self.webView?.superview?.addSubview(self.previewView)
|
|
104
|
+
if (self.toBack!) {
|
|
105
|
+
self.webView?.superview?.bringSubviewToFront(self.webView!)
|
|
106
|
+
}
|
|
107
|
+
try? self.cameraController.displayPreview(on: self.previewView)
|
|
108
|
+
|
|
109
|
+
if (self.rotateWhenOrientationChanged == true) {
|
|
110
|
+
NotificationCenter.default.addObserver(self, selector: #selector(CameraPreview.rotated), name: UIDevice.orientationDidChangeNotification, object: nil)
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
call.resolve()
|
|
104
114
|
|
|
115
|
+
}
|
|
105
116
|
}
|
|
106
117
|
}
|
|
107
|
-
}
|
|
118
|
+
});
|
|
119
|
+
|
|
108
120
|
}
|
|
109
121
|
|
|
110
122
|
@objc func flip(_ call: CAPPluginCall) {
|
|
@@ -156,7 +168,7 @@ public class CameraPreview: CAPPlugin {
|
|
|
156
168
|
return
|
|
157
169
|
}
|
|
158
170
|
let imageData: Data?
|
|
159
|
-
if (self.
|
|
171
|
+
if (self.cameraController.currentCameraPosition == .front) {
|
|
160
172
|
let flippedImage = image.withHorizontallyFlippedOrientation()
|
|
161
173
|
imageData = flippedImage.jpegData(compressionQuality: CGFloat(quality!/100))
|
|
162
174
|
} else {
|
|
@@ -178,6 +190,41 @@ public class CameraPreview: CAPPlugin {
|
|
|
178
190
|
}
|
|
179
191
|
}
|
|
180
192
|
}
|
|
193
|
+
|
|
194
|
+
@objc func captureSample(_ call: CAPPluginCall) {
|
|
195
|
+
DispatchQueue.main.async {
|
|
196
|
+
let quality: Int? = call.getInt("quality", 85)
|
|
197
|
+
|
|
198
|
+
self.cameraController.captureSample { image, error in
|
|
199
|
+
guard let image = image else {
|
|
200
|
+
print("Image capture error: \(String(describing: error))")
|
|
201
|
+
call.reject("Image capture error: \(String(describing: error))")
|
|
202
|
+
return
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
let imageData: Data?
|
|
206
|
+
if (self.cameraPosition == "front") {
|
|
207
|
+
let flippedImage = image.withHorizontallyFlippedOrientation()
|
|
208
|
+
imageData = flippedImage.jpegData(compressionQuality: CGFloat(quality!/100))
|
|
209
|
+
} else {
|
|
210
|
+
imageData = image.jpegData(compressionQuality: CGFloat(quality!/100))
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
if (self.storeToFile == false){
|
|
214
|
+
let imageBase64 = imageData?.base64EncodedString()
|
|
215
|
+
call.resolve(["value": imageBase64!])
|
|
216
|
+
} else {
|
|
217
|
+
do {
|
|
218
|
+
let fileUrl = self.getTempFilePath()
|
|
219
|
+
try imageData?.write(to:fileUrl)
|
|
220
|
+
call.resolve(["value": fileUrl.absoluteString])
|
|
221
|
+
} catch {
|
|
222
|
+
call.reject("Error writing image to file")
|
|
223
|
+
}
|
|
224
|
+
}
|
|
225
|
+
}
|
|
226
|
+
}
|
|
227
|
+
}
|
|
181
228
|
|
|
182
229
|
@objc func getSupportedFlashModes(_ call: CAPPluginCall) {
|
|
183
230
|
do {
|
|
@@ -217,5 +264,37 @@ public class CameraPreview: CAPPlugin {
|
|
|
217
264
|
call.reject("failed to set flash mode")
|
|
218
265
|
}
|
|
219
266
|
}
|
|
267
|
+
|
|
268
|
+
@objc func startRecordVideo(_ call: CAPPluginCall) {
|
|
269
|
+
DispatchQueue.main.async {
|
|
270
|
+
|
|
271
|
+
let quality: Int? = call.getInt("quality", 85)
|
|
272
|
+
|
|
273
|
+
self.cameraController.captureVideo { (image, error) in
|
|
274
|
+
|
|
275
|
+
guard let image = image else {
|
|
276
|
+
print(error ?? "Image capture error")
|
|
277
|
+
guard let error = error else {
|
|
278
|
+
call.reject("Image capture error")
|
|
279
|
+
return
|
|
280
|
+
}
|
|
281
|
+
call.reject(error.localizedDescription)
|
|
282
|
+
return
|
|
283
|
+
}
|
|
284
|
+
|
|
285
|
+
//self.videoUrl = image
|
|
286
|
+
|
|
287
|
+
call.resolve(["value":image.absoluteString])
|
|
288
|
+
}
|
|
289
|
+
}
|
|
290
|
+
}
|
|
291
|
+
|
|
292
|
+
|
|
293
|
+
@objc func stopRecordVideo(_ call: CAPPluginCall) {
|
|
294
|
+
|
|
295
|
+
self.cameraController.stopRecording { (error) in
|
|
296
|
+
|
|
297
|
+
}
|
|
298
|
+
}
|
|
220
299
|
|
|
221
300
|
}
|
|
@@ -14,8 +14,6 @@
|
|
|
14
14
|
4C2070D622DA87B100D1AD33 /* CoreImage.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 4C2070D522DA87B100D1AD33 /* CoreImage.framework */; };
|
|
15
15
|
4C2070D822DA87C600D1AD33 /* QuartzCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 4C2070D722DA87C500D1AD33 /* QuartzCore.framework */; };
|
|
16
16
|
4C2070DA22DA87CE00D1AD33 /* CoreVideo.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 4C2070D922DA87CE00D1AD33 /* CoreVideo.framework */; };
|
|
17
|
-
4C2070DC22DA87D700D1AD33 /* GLKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 4C2070DB22DA87D700D1AD33 /* GLKit.framework */; };
|
|
18
|
-
4C2070DE22DA87E700D1AD33 /* OpenGLES.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 4C2070DD22DA87E700D1AD33 /* OpenGLES.framework */; };
|
|
19
17
|
4C2070E022DA87F500D1AD33 /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 4C2070DF22DA87F500D1AD33 /* CoreGraphics.framework */; };
|
|
20
18
|
4C2070E222DA87FB00D1AD33 /* AssetsLibrary.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 4C2070E122DA87FB00D1AD33 /* AssetsLibrary.framework */; };
|
|
21
19
|
4C2070E422DA881600D1AD33 /* CoreLocation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 4C2070E322DA881600D1AD33 /* CoreLocation.framework */; };
|
|
@@ -77,8 +75,6 @@
|
|
|
77
75
|
4C2070E422DA881600D1AD33 /* CoreLocation.framework in Frameworks */,
|
|
78
76
|
4C2070E222DA87FB00D1AD33 /* AssetsLibrary.framework in Frameworks */,
|
|
79
77
|
4C2070E022DA87F500D1AD33 /* CoreGraphics.framework in Frameworks */,
|
|
80
|
-
4C2070DE22DA87E700D1AD33 /* OpenGLES.framework in Frameworks */,
|
|
81
|
-
4C2070DC22DA87D700D1AD33 /* GLKit.framework in Frameworks */,
|
|
82
78
|
4C2070D822DA87C600D1AD33 /* QuartzCore.framework in Frameworks */,
|
|
83
79
|
4C2070D622DA87B100D1AD33 /* CoreImage.framework in Frameworks */,
|
|
84
80
|
4C2070D222DA878E00D1AD33 /* ImageIO.framework in Frameworks */,
|
|
@@ -418,7 +414,7 @@
|
|
|
418
414
|
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
|
|
419
415
|
GCC_WARN_UNUSED_FUNCTION = YES;
|
|
420
416
|
GCC_WARN_UNUSED_VARIABLE = YES;
|
|
421
|
-
IPHONEOS_DEPLOYMENT_TARGET =
|
|
417
|
+
IPHONEOS_DEPLOYMENT_TARGET = 12.1;
|
|
422
418
|
MTL_ENABLE_DEBUG_INFO = YES;
|
|
423
419
|
ONLY_ACTIVE_ARCH = YES;
|
|
424
420
|
SDKROOT = iphoneos;
|
|
@@ -473,7 +469,7 @@
|
|
|
473
469
|
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
|
|
474
470
|
GCC_WARN_UNUSED_FUNCTION = YES;
|
|
475
471
|
GCC_WARN_UNUSED_VARIABLE = YES;
|
|
476
|
-
IPHONEOS_DEPLOYMENT_TARGET =
|
|
472
|
+
IPHONEOS_DEPLOYMENT_TARGET = 12.1;
|
|
477
473
|
MTL_ENABLE_DEBUG_INFO = NO;
|
|
478
474
|
SDKROOT = iphoneos;
|
|
479
475
|
SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule";
|
package/ios/Podfile
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
platform :ios, '
|
|
1
|
+
platform :ios, '12.1'
|
|
2
2
|
|
|
3
3
|
target 'Plugin' do
|
|
4
4
|
# Comment the next line if you're not using Swift and don't want to use dynamic frameworks
|
|
@@ -10,4 +10,4 @@ target 'PluginTests' do
|
|
|
10
10
|
use_frameworks!
|
|
11
11
|
|
|
12
12
|
pod 'Capacitor', :path => '../node_modules/@capacitor/ios'
|
|
13
|
-
end
|
|
13
|
+
end
|
package/ios/Podfile.lock
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
PODS:
|
|
2
|
-
- Capacitor (3.0.0
|
|
2
|
+
- Capacitor (3.0.0):
|
|
3
3
|
- CapacitorCordova
|
|
4
4
|
- CapacitorCordova (2.0.1)
|
|
5
5
|
|
|
@@ -15,9 +15,9 @@ EXTERNAL SOURCES:
|
|
|
15
15
|
:path: "../node_modules/@capacitor/ios"
|
|
16
16
|
|
|
17
17
|
SPEC CHECKSUMS:
|
|
18
|
-
Capacitor:
|
|
18
|
+
Capacitor: 06cd8cd01340f5b162e9528bf5569d87a6f29009
|
|
19
19
|
CapacitorCordova: 9fee2eb6780331b6ff09710d6a7d1f2e4707f1b9
|
|
20
20
|
|
|
21
|
-
PODFILE CHECKSUM:
|
|
21
|
+
PODFILE CHECKSUM: d3e2703a3105a8e75e11dfc45c25f5cbf9801486
|
|
22
22
|
|
|
23
|
-
COCOAPODS: 1.
|
|
23
|
+
COCOAPODS: 1.9.3
|
package/package.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@capacitor-community/camera-preview",
|
|
3
|
-
"version": "2.0.0-beta.
|
|
3
|
+
"version": "2.0.0-beta.2",
|
|
4
4
|
"description": "Camera preview",
|
|
5
5
|
"main": "dist/esm/index.js",
|
|
6
6
|
"types": "dist/esm/index.d.ts",
|
|
7
7
|
"scripts": {
|
|
8
8
|
"build": "npm run clean && tsc",
|
|
9
|
-
"clean": "
|
|
9
|
+
"clean": "rimraf './dist'",
|
|
10
10
|
"watch": "tsc --watch",
|
|
11
11
|
"prepublishOnly": "npm run build",
|
|
12
12
|
"prepare": "npm run build"
|
|
@@ -14,12 +14,13 @@
|
|
|
14
14
|
"author": "Ariel Hernandez Musa",
|
|
15
15
|
"license": "MIT",
|
|
16
16
|
"dependencies": {
|
|
17
|
-
"@capacitor/core": "
|
|
17
|
+
"@capacitor/core": "latest"
|
|
18
18
|
},
|
|
19
19
|
"devDependencies": {
|
|
20
|
-
"@capacitor/android": "
|
|
21
|
-
"@capacitor/ios": "
|
|
22
|
-
"
|
|
20
|
+
"@capacitor/android": "latest",
|
|
21
|
+
"@capacitor/ios": "latest",
|
|
22
|
+
"rimraf": "^3.0.2",
|
|
23
|
+
"typescript": "^4.3.2"
|
|
23
24
|
},
|
|
24
25
|
"files": [
|
|
25
26
|
"dist/",
|
package/android/local.properties
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
## This file must *NOT* be checked into Version Control Systems,
|
|
2
|
-
# as it contains information specific to your local configuration.
|
|
3
|
-
#
|
|
4
|
-
# Location of the SDK. This is only used by Gradle.
|
|
5
|
-
# For customization when using a Version Control System, please read the
|
|
6
|
-
# header note.
|
|
7
|
-
#Sun Jul 14 21:09:11 UYT 2019
|
|
8
|
-
sdk.dir=/Users/arielhernandezmusa/Library/Android/sdk
|
package/ios/Plugin.xcodeproj/xcuserdata/ahernandez.xcuserdatad/xcschemes/xcschememanagement.plist
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
-
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
|
3
|
-
<plist version="1.0">
|
|
4
|
-
<dict>
|
|
5
|
-
<key>SchemeUserState</key>
|
|
6
|
-
<dict>
|
|
7
|
-
<key>Plugin.xcscheme_^#shared#^_</key>
|
|
8
|
-
<dict>
|
|
9
|
-
<key>orderHint</key>
|
|
10
|
-
<integer>4</integer>
|
|
11
|
-
</dict>
|
|
12
|
-
</dict>
|
|
13
|
-
</dict>
|
|
14
|
-
</plist>
|
package/ios/Plugin.xcodeproj/xcuserdata/nielsvanharen.xcuserdatad/xcschemes/xcschememanagement.plist
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
-
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
|
3
|
-
<plist version="1.0">
|
|
4
|
-
<dict>
|
|
5
|
-
<key>SchemeUserState</key>
|
|
6
|
-
<dict>
|
|
7
|
-
<key>Plugin.xcscheme_^#shared#^_</key>
|
|
8
|
-
<dict>
|
|
9
|
-
<key>orderHint</key>
|
|
10
|
-
<integer>4</integer>
|
|
11
|
-
</dict>
|
|
12
|
-
</dict>
|
|
13
|
-
</dict>
|
|
14
|
-
</plist>
|
package/ios/Plugin.xcworkspace/xcuserdata/ahernandez.xcuserdatad/UserInterfaceState.xcuserstate
DELETED
|
Binary file
|
|
Binary file
|
package/ios/Plugin.xcworkspace/xcuserdata/nielsvanharen.xcuserdatad/UserInterfaceState.xcuserstate
DELETED
|
Binary file
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
Copyright 2015-present Drifty Co.
|
|
2
|
-
http://drifty.com/
|
|
3
|
-
|
|
4
|
-
MIT License
|
|
5
|
-
|
|
6
|
-
Permission is hereby granted, free of charge, to any person obtaining
|
|
7
|
-
a copy of this software and associated documentation files (the
|
|
8
|
-
"Software"), to deal in the Software without restriction, including
|
|
9
|
-
without limitation the rights to use, copy, modify, merge, publish,
|
|
10
|
-
distribute, sublicense, and/or sell copies of the Software, and to
|
|
11
|
-
permit persons to whom the Software is furnished to do so, subject to
|
|
12
|
-
the following conditions:
|
|
13
|
-
|
|
14
|
-
The above copyright notice and this permission notice shall be
|
|
15
|
-
included in all copies or substantial portions of the Software.
|
|
16
|
-
|
|
17
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
|
18
|
-
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
|
19
|
-
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
|
20
|
-
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
|
21
|
-
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
|
22
|
-
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
|
23
|
-
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
[![Build Status][circle-badge]][circle-badge-url]
|
|
2
|
-
|
|
3
|
-
# ⚡️ Cross-platform apps with JavaScript and the Web ⚡️
|
|
4
|
-
|
|
5
|
-
Capacitor is a cross-platform API and code execution layer that makes it easy to call Native SDKs from web code and to write custom Native plugins that your app might need. Additionally, Capacitor provides first-class Progressive Web App support so you can write one app and deploy it to the app stores, _and_ the mobile web.
|
|
6
|
-
|
|
7
|
-
Capacitor was created by the Ionic Framework team as a spiritual successor to Cordova, though it does have backward compatibility with the majority of Cordova plugins. Capacitor can be used without [Ionic Framework](https://ionicframework.com/docs/components), but since it's a core part of the Ionic Platform, it's recommended for the best app development experience.
|
|
8
|
-
|
|
9
|
-
Capacitor also comes with a Plugin API for building native plugins. On iOS, first-class Swift support is available, and much of the iOS Capacitor runtime is written in Swift. Plugins may also be written in Objective-C. On Android, writing plugins in Java and Kotlin is supported.
|
|
10
|
-
|
|
11
|
-
## Roadmap
|
|
12
|
-
|
|
13
|
-
_Disclaimer: Our roadmap is subject to change at any time and has no specific date guarantees_
|
|
14
|
-
|
|
15
|
-
2020 and beyond: The core Capacitor project is now stable. Maintenance is ongoing (including support for new mobile operating system versions, bugs, etc.). Going forward, most new functionality will be implemented as plugins. For the latest updates, track new releases [here](https://github.com/ionic-team/capacitor/releases) or milestones [here](https://github.com/ionic-team/capacitor/milestones).
|
|
16
|
-
|
|
17
|
-
[2019](https://blog.ionicframework.com/capacitor-in-2019-native-progressive-web-apps-for-all/)
|
|
18
|
-
|
|
19
|
-
2018
|
|
20
|
-
|
|
21
|
-
- __Cordova Plugin Integration__
|
|
22
|
-
- Preliminary support for using plugins from the existing Cordova community
|
|
23
|
-
- __Electron support__
|
|
24
|
-
- Support for building Electron apps and interacting with Node.js libraries
|
|
25
|
-
- __Enterprise Premium Plugins__
|
|
26
|
-
- Paid add-on plugins with support for common Enterprise use cases, such as storage, authentication, security, and more
|
|
27
|
-
- Developer Support options with SLAs and priority patches
|
|
28
|
-
- We are working with a few large teams/businesses as early development partners. Interested? Email [max@ionicframework.com](mailto:max@ionicframework.com)
|
|
29
|
-
|
|
30
|
-
## Contributing
|
|
31
|
-
|
|
32
|
-
Contributing to Capacitor may involve writing TypeScript, Swift/Objective-C, Java, or Markdown depending on the component you are working on. We are looking for help in any of these areas!
|
|
33
|
-
|
|
34
|
-
Please read the [Contributing](.github/CONTRIBUTING.md) guide for more information.
|
|
35
|
-
|
|
36
|
-
For details on updating the Capacitor website or documentation, [see here](site/CONTRIBUTING.md).
|
|
37
|
-
|
|
38
|
-
[circle-badge]: https://circleci.com/gh/ionic-team/capacitor.svg?style=shield
|
|
39
|
-
[circle-badge-url]: https://circleci.com/gh/ionic-team/capacitor
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
#import <UIKit/UIKit.h>
|
|
2
|
-
|
|
3
|
-
//! Project version number for CapacitorCordova.
|
|
4
|
-
FOUNDATION_EXPORT double CapacitorCordovaVersionNumber;
|
|
5
|
-
|
|
6
|
-
//! Project version string for CapacitorCordova.
|
|
7
|
-
FOUNDATION_EXPORT const unsigned char CapacitorCordovaVersionString[];
|
|
8
|
-
|
|
9
|
-
// In this header, you should import all the public headers of your framework using statements like #import <CapacitorCordova/PublicHeader.h>
|
|
10
|
-
|
|
11
|
-
#import <Cordova/CDV.h>
|
|
12
|
-
#import <Cordova/CDVCommandDelegateImpl.h>
|
|
13
|
-
#import <Cordova/CDVAvailability.h>
|
|
14
|
-
#import <Cordova/CDVPlugin.h>
|
|
15
|
-
#import <Cordova/CDVPluginResult.h>
|
|
16
|
-
#import <Cordova/CDVCommandDelegate.h>
|
|
17
|
-
#import <Cordova/CDVInvokedUrlCommand.h>
|
|
18
|
-
#import <Cordova/CDVConfigParser.h>
|
|
19
|
-
#import <Cordova/CDVViewController.h>
|
|
20
|
-
#import <Cordova/NSDictionary+CordovaPreferences.h>
|
|
21
|
-
#import <Cordova/CDVURLProtocol.h>
|
package/ios/Pods/CapacitorCordova/ios/CapacitorCordova/CapacitorCordova/Classes/Public/CDV.h
DELETED
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
Licensed to the Apache Software Foundation (ASF) under one
|
|
3
|
-
or more contributor license agreements. See the NOTICE file
|
|
4
|
-
distributed with this work for additional information
|
|
5
|
-
regarding copyright ownership. The ASF licenses this file
|
|
6
|
-
to you under the Apache License, Version 2.0 (the
|
|
7
|
-
"License"); you may not use this file except in compliance
|
|
8
|
-
with the License. You may obtain a copy of the License at
|
|
9
|
-
|
|
10
|
-
http://www.apache.org/licenses/LICENSE-2.0
|
|
11
|
-
|
|
12
|
-
Unless required by applicable law or agreed to in writing,
|
|
13
|
-
software distributed under the License is distributed on an
|
|
14
|
-
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
|
15
|
-
KIND, either express or implied. See the License for the
|
|
16
|
-
specific language governing permissions and limitations
|
|
17
|
-
under the License.
|
|
18
|
-
*/
|
|
19
|
-
|
|
20
|
-
#import "CDVAvailability.h"
|
|
21
|
-
#import "CDVPlugin.h"
|
|
22
|
-
#import "CDVPluginResult.h"
|
|
23
|
-
#import "CDVCommandDelegate.h"
|
|
24
|
-
#import "CDVInvokedUrlCommand.h"
|
|
25
|
-
#import "CDVViewController.h"
|
|
26
|
-
#import "CDVURLProtocol.h"
|
|
27
|
-
#import "CDVScreenOrientationDelegate.h"
|
|
28
|
-
|
|
@@ -1,109 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
Licensed to the Apache Software Foundation (ASF) under one
|
|
3
|
-
or more contributor license agreements. See the NOTICE file
|
|
4
|
-
distributed with this work for additional information
|
|
5
|
-
regarding copyright ownership. The ASF licenses this file
|
|
6
|
-
to you under the Apache License, Version 2.0 (the
|
|
7
|
-
"License"); you may not use this file except in compliance
|
|
8
|
-
with the License. You may obtain a copy of the License at
|
|
9
|
-
|
|
10
|
-
http://www.apache.org/licenses/LICENSE-2.0
|
|
11
|
-
|
|
12
|
-
Unless required by applicable law or agreed to in writing,
|
|
13
|
-
software distributed under the License is distributed on an
|
|
14
|
-
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
|
15
|
-
KIND, either express or implied. See the License for the
|
|
16
|
-
specific language governing permissions and limitations
|
|
17
|
-
under the License.
|
|
18
|
-
*/
|
|
19
|
-
|
|
20
|
-
#define __CORDOVA_IOS__
|
|
21
|
-
|
|
22
|
-
#define __CORDOVA_0_9_6 906
|
|
23
|
-
#define __CORDOVA_1_0_0 10000
|
|
24
|
-
#define __CORDOVA_1_1_0 10100
|
|
25
|
-
#define __CORDOVA_1_2_0 10200
|
|
26
|
-
#define __CORDOVA_1_3_0 10300
|
|
27
|
-
#define __CORDOVA_1_4_0 10400
|
|
28
|
-
#define __CORDOVA_1_4_1 10401
|
|
29
|
-
#define __CORDOVA_1_5_0 10500
|
|
30
|
-
#define __CORDOVA_1_6_0 10600
|
|
31
|
-
#define __CORDOVA_1_6_1 10601
|
|
32
|
-
#define __CORDOVA_1_7_0 10700
|
|
33
|
-
#define __CORDOVA_1_8_0 10800
|
|
34
|
-
#define __CORDOVA_1_8_1 10801
|
|
35
|
-
#define __CORDOVA_1_9_0 10900
|
|
36
|
-
#define __CORDOVA_2_0_0 20000
|
|
37
|
-
#define __CORDOVA_2_1_0 20100
|
|
38
|
-
#define __CORDOVA_2_2_0 20200
|
|
39
|
-
#define __CORDOVA_2_3_0 20300
|
|
40
|
-
#define __CORDOVA_2_4_0 20400
|
|
41
|
-
#define __CORDOVA_2_5_0 20500
|
|
42
|
-
#define __CORDOVA_2_6_0 20600
|
|
43
|
-
#define __CORDOVA_2_7_0 20700
|
|
44
|
-
#define __CORDOVA_2_8_0 20800
|
|
45
|
-
#define __CORDOVA_2_9_0 20900
|
|
46
|
-
#define __CORDOVA_3_0_0 30000
|
|
47
|
-
#define __CORDOVA_3_1_0 30100
|
|
48
|
-
#define __CORDOVA_3_2_0 30200
|
|
49
|
-
#define __CORDOVA_3_3_0 30300
|
|
50
|
-
#define __CORDOVA_3_4_0 30400
|
|
51
|
-
#define __CORDOVA_3_4_1 30401
|
|
52
|
-
#define __CORDOVA_3_5_0 30500
|
|
53
|
-
#define __CORDOVA_3_6_0 30600
|
|
54
|
-
#define __CORDOVA_3_7_0 30700
|
|
55
|
-
#define __CORDOVA_3_8_0 30800
|
|
56
|
-
#define __CORDOVA_3_9_0 30900
|
|
57
|
-
#define __CORDOVA_3_9_1 30901
|
|
58
|
-
#define __CORDOVA_3_9_2 30902
|
|
59
|
-
#define __CORDOVA_4_0_0 40000
|
|
60
|
-
#define __CORDOVA_4_0_1 40001
|
|
61
|
-
#define __CORDOVA_4_1_0 40100
|
|
62
|
-
#define __CORDOVA_4_1_1 40101
|
|
63
|
-
#define __CORDOVA_4_2_0 40200
|
|
64
|
-
#define __CORDOVA_4_2_1 40201
|
|
65
|
-
#define __CORDOVA_4_3_0 40300
|
|
66
|
-
#define __CORDOVA_4_3_1 40301
|
|
67
|
-
#define __CORDOVA_4_4_0 40400
|
|
68
|
-
#define __CORDOVA_4_5_0 40500
|
|
69
|
-
#define __CORDOVA_4_5_1 40501
|
|
70
|
-
#define __CORDOVA_4_5_2 40502
|
|
71
|
-
#define __CORDOVA_4_5_4 40504
|
|
72
|
-
/* coho:next-version,insert-before */
|
|
73
|
-
#define __CORDOVA_NA 99999 /* not available */
|
|
74
|
-
|
|
75
|
-
/*
|
|
76
|
-
#if CORDOVA_VERSION_MIN_REQUIRED >= __CORDOVA_4_0_0
|
|
77
|
-
// do something when its at least 4.0.0
|
|
78
|
-
#else
|
|
79
|
-
// do something else (non 4.0.0)
|
|
80
|
-
#endif
|
|
81
|
-
*/
|
|
82
|
-
#ifndef CORDOVA_VERSION_MIN_REQUIRED
|
|
83
|
-
/* coho:next-version-min-required,replace-after */
|
|
84
|
-
#define CORDOVA_VERSION_MIN_REQUIRED __CORDOVA_4_5_4
|
|
85
|
-
#endif
|
|
86
|
-
|
|
87
|
-
/*
|
|
88
|
-
Returns YES if it is at least version specified as NSString(X)
|
|
89
|
-
Usage:
|
|
90
|
-
if (IsAtLeastiOSVersion(@"5.1")) {
|
|
91
|
-
// do something for iOS 5.1 or greater
|
|
92
|
-
}
|
|
93
|
-
*/
|
|
94
|
-
#define IsAtLeastiOSVersion(X) ([[[UIDevice currentDevice] systemVersion] compare:X options:NSNumericSearch] != NSOrderedAscending)
|
|
95
|
-
|
|
96
|
-
/* Return the string version of the decimal version */
|
|
97
|
-
#define CDV_VERSION [NSString stringWithFormat:@"%d.%d.%d", \
|
|
98
|
-
(CORDOVA_VERSION_MIN_REQUIRED / 10000), \
|
|
99
|
-
(CORDOVA_VERSION_MIN_REQUIRED % 10000) / 100, \
|
|
100
|
-
(CORDOVA_VERSION_MIN_REQUIRED % 10000) % 100]
|
|
101
|
-
|
|
102
|
-
// Enable this to log all exec() calls.
|
|
103
|
-
#define CDV_ENABLE_EXEC_LOGGING 0
|
|
104
|
-
#if CDV_ENABLE_EXEC_LOGGING
|
|
105
|
-
#define CDV_EXEC_LOG NSLog
|
|
106
|
-
#else
|
|
107
|
-
#define CDV_EXEC_LOG(...) do { \
|
|
108
|
-
} while (NO)
|
|
109
|
-
#endif
|