@capacitor/camera 6.0.0-alpha.1 → 6.0.0-beta.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/CapacitorCamera.podspec +1 -1
- package/Package.swift +28 -0
- package/README.md +1 -1
- package/android/build.gradle +3 -3
- package/ios/{Plugin → Sources/CameraPlugin}/CameraPlugin.swift +11 -1
- package/ios/Tests/CameraPluginTests/CameraPluginTests.swift +12 -0
- package/package.json +7 -5
- package/ios/Plugin/CameraPlugin.h +0 -10
- package/ios/Plugin/CameraPlugin.m +0 -11
- package/ios/Plugin/Info.plist +0 -24
- /package/ios/{Plugin → Sources/CameraPlugin}/CameraExtensions.swift +0 -0
- /package/ios/{Plugin → Sources/CameraPlugin}/CameraTypes.swift +0 -0
- /package/ios/{Plugin → Sources/CameraPlugin}/ImageSaver.swift +0 -0
package/CapacitorCamera.podspec
CHANGED
|
@@ -10,7 +10,7 @@ Pod::Spec.new do |s|
|
|
|
10
10
|
s.homepage = 'https://capacitorjs.com'
|
|
11
11
|
s.author = package['author']
|
|
12
12
|
s.source = { :git => 'https://github.com/ionic-team/capacitor-plugins.git', :tag => package['name'] + '@' + package['version'] }
|
|
13
|
-
s.source_files = 'ios/
|
|
13
|
+
s.source_files = 'ios/Sources/**/*.{swift,h,m,c,cc,mm,cpp}', 'camera/ios/Sources/**/*.{swift,h,m,c,cc,mm,cpp}'
|
|
14
14
|
s.ios.deployment_target = '13.0'
|
|
15
15
|
s.dependency 'Capacitor'
|
|
16
16
|
s.swift_version = '5.1'
|
package/Package.swift
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
// swift-tools-version: 5.9
|
|
2
|
+
import PackageDescription
|
|
3
|
+
|
|
4
|
+
let package = Package(
|
|
5
|
+
name: "CapacitorCamera",
|
|
6
|
+
platforms: [.iOS(.v13)],
|
|
7
|
+
products: [
|
|
8
|
+
.library(
|
|
9
|
+
name: "CameraPlugin",
|
|
10
|
+
targets: ["CameraPlugin"])
|
|
11
|
+
],
|
|
12
|
+
dependencies: [
|
|
13
|
+
.package(url: "https://github.com/ionic-team/capacitor6-spm-test.git", branch: "main")
|
|
14
|
+
],
|
|
15
|
+
targets: [
|
|
16
|
+
.target(
|
|
17
|
+
name: "CameraPlugin",
|
|
18
|
+
dependencies: [
|
|
19
|
+
.product(name: "Capacitor", package: "capacitor6-spm-test"),
|
|
20
|
+
.product(name: "Cordova", package: "capacitor6-spm-test")
|
|
21
|
+
],
|
|
22
|
+
path: "ios/Sources/CameraPlugin"),
|
|
23
|
+
.testTarget(
|
|
24
|
+
name: "CameraPluginTests",
|
|
25
|
+
dependencies: ["CameraPlugin"],
|
|
26
|
+
path: "ios/Tests/CameraPluginTests")
|
|
27
|
+
]
|
|
28
|
+
)
|
package/README.md
CHANGED
|
@@ -46,7 +46,7 @@ Additionally, because the Camera API launches a separate Activity to handle taki
|
|
|
46
46
|
This plugin will use the following project variables (defined in your app's `variables.gradle` file):
|
|
47
47
|
|
|
48
48
|
- `androidxExifInterfaceVersion`: version of `androidx.exifinterface:exifinterface` (default: `1.3.6`)
|
|
49
|
-
- `androidxMaterialVersion`: version of `com.google.android.material:material` (default: `1.
|
|
49
|
+
- `androidxMaterialVersion`: version of `com.google.android.material:material` (default: `1.10.0`)
|
|
50
50
|
|
|
51
51
|
## PWA Notes
|
|
52
52
|
|
package/android/build.gradle
CHANGED
|
@@ -5,7 +5,7 @@ ext {
|
|
|
5
5
|
androidxEspressoCoreVersion = project.hasProperty('androidxEspressoCoreVersion') ? rootProject.ext.androidxEspressoCoreVersion : '3.5.1'
|
|
6
6
|
androidxExifInterfaceVersion = project.hasProperty('androidxExifInterfaceVersion') ? rootProject.ext.androidxExifInterfaceVersion : '1.3.6'
|
|
7
7
|
androidxJunitVersion = project.hasProperty('androidxJunitVersion') ? rootProject.ext.androidxJunitVersion : '1.1.5'
|
|
8
|
-
androidxMaterialVersion = project.hasProperty('androidxMaterialVersion') ? rootProject.ext.androidxMaterialVersion : '1.
|
|
8
|
+
androidxMaterialVersion = project.hasProperty('androidxMaterialVersion') ? rootProject.ext.androidxMaterialVersion : '1.10.0'
|
|
9
9
|
}
|
|
10
10
|
|
|
11
11
|
buildscript {
|
|
@@ -17,7 +17,7 @@ buildscript {
|
|
|
17
17
|
}
|
|
18
18
|
}
|
|
19
19
|
dependencies {
|
|
20
|
-
classpath 'com.android.tools.build:gradle:8.2.0
|
|
20
|
+
classpath 'com.android.tools.build:gradle:8.2.0'
|
|
21
21
|
if (System.getenv("CAP_PLUGIN_PUBLISH") == "true") {
|
|
22
22
|
classpath 'io.github.gradle-nexus:publish-plugin:1.3.0'
|
|
23
23
|
}
|
|
@@ -33,7 +33,7 @@ if (System.getenv("CAP_PLUGIN_PUBLISH") == "true") {
|
|
|
33
33
|
|
|
34
34
|
android {
|
|
35
35
|
namespace "com.capacitorjs.plugins.camera"
|
|
36
|
-
|
|
36
|
+
compileSdk project.hasProperty('compileSdkVersion') ? rootProject.ext.compileSdkVersion : 34
|
|
37
37
|
defaultConfig {
|
|
38
38
|
minSdkVersion project.hasProperty('minSdkVersion') ? rootProject.ext.minSdkVersion : 22
|
|
39
39
|
targetSdkVersion project.hasProperty('targetSdkVersion') ? rootProject.ext.targetSdkVersion : 34
|
|
@@ -4,7 +4,17 @@ import Photos
|
|
|
4
4
|
import PhotosUI
|
|
5
5
|
|
|
6
6
|
@objc(CAPCameraPlugin)
|
|
7
|
-
public class CameraPlugin: CAPPlugin {
|
|
7
|
+
public class CameraPlugin: CAPPlugin, CAPBridgedPlugin {
|
|
8
|
+
public let identifier = "CAPCameraPlugin"
|
|
9
|
+
public let jsName = "Camera"
|
|
10
|
+
public let pluginMethods: [CAPPluginMethod] = [
|
|
11
|
+
CAPPluginMethod(name: "getPhoto", returnType: CAPPluginReturnPromise),
|
|
12
|
+
CAPPluginMethod(name: "pickImages", returnType: CAPPluginReturnPromise),
|
|
13
|
+
CAPPluginMethod(name: "checkPermissions", returnType: CAPPluginReturnPromise),
|
|
14
|
+
CAPPluginMethod(name: "requestPermissions", returnType: CAPPluginReturnPromise),
|
|
15
|
+
CAPPluginMethod(name: "pickLimitedLibraryPhotos", returnType: CAPPluginReturnPromise),
|
|
16
|
+
CAPPluginMethod(name: "getLimitedLibraryPhotos", returnType: CAPPluginReturnPromise)
|
|
17
|
+
]
|
|
8
18
|
private var call: CAPPluginCall?
|
|
9
19
|
private var settings = CameraSettings()
|
|
10
20
|
private let defaultSource = CameraSource.prompt
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import XCTest
|
|
2
|
+
@testable import CameraPlugin
|
|
3
|
+
|
|
4
|
+
final class CameraPluginTests: XCTestCase {
|
|
5
|
+
func testExample() throws {
|
|
6
|
+
// XCTest Documentation
|
|
7
|
+
// https://developer.apple.com/documentation/xctest
|
|
8
|
+
|
|
9
|
+
// Defining Test Cases and Test Methods
|
|
10
|
+
// https://developer.apple.com/documentation/xctest/defining_test_cases_and_test_methods
|
|
11
|
+
}
|
|
12
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@capacitor/camera",
|
|
3
|
-
"version": "6.0.0-
|
|
3
|
+
"version": "6.0.0-beta.0",
|
|
4
4
|
"description": "The Camera API provides the ability to take a photo with the camera or choose an existing one from the photo album.",
|
|
5
5
|
"main": "dist/plugin.cjs.js",
|
|
6
6
|
"module": "dist/esm/index.js",
|
|
@@ -10,7 +10,9 @@
|
|
|
10
10
|
"android/src/main/",
|
|
11
11
|
"android/build.gradle",
|
|
12
12
|
"dist/",
|
|
13
|
-
"ios/
|
|
13
|
+
"ios/Sources",
|
|
14
|
+
"ios/Tests",
|
|
15
|
+
"Package.swift",
|
|
14
16
|
"CapacitorCamera.podspec"
|
|
15
17
|
],
|
|
16
18
|
"author": "Ionic <hi@ionicframework.com>",
|
|
@@ -29,7 +31,7 @@
|
|
|
29
31
|
],
|
|
30
32
|
"scripts": {
|
|
31
33
|
"verify": "npm run verify:ios && npm run verify:android && npm run verify:web",
|
|
32
|
-
"verify:ios": "
|
|
34
|
+
"verify:ios": "xcodebuild build -scheme CapacitorCamera -sdk iphonesimulator17.0 -destination 'OS=17.0,name=iPhone 15'",
|
|
33
35
|
"verify:android": "cd android && ./gradlew clean build test && cd ..",
|
|
34
36
|
"verify:web": "npm run build",
|
|
35
37
|
"lint": "npm run eslint && npm run prettier -- --check && npm run swiftlint -- lint",
|
|
@@ -61,7 +63,7 @@
|
|
|
61
63
|
"typescript": "~4.1.5"
|
|
62
64
|
},
|
|
63
65
|
"peerDependencies": {
|
|
64
|
-
"@capacitor/core": "
|
|
66
|
+
"@capacitor/core": "next"
|
|
65
67
|
},
|
|
66
68
|
"prettier": "@ionic/prettier-config",
|
|
67
69
|
"swiftlint": "@ionic/swiftlint-config",
|
|
@@ -79,5 +81,5 @@
|
|
|
79
81
|
"publishConfig": {
|
|
80
82
|
"access": "public"
|
|
81
83
|
},
|
|
82
|
-
"gitHead": "
|
|
84
|
+
"gitHead": "6e31d104334377cbaafe67a1fe58e252dba79c04"
|
|
83
85
|
}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
#import <UIKit/UIKit.h>
|
|
2
|
-
|
|
3
|
-
//! Project version number for Plugin.
|
|
4
|
-
FOUNDATION_EXPORT double PluginVersionNumber;
|
|
5
|
-
|
|
6
|
-
//! Project version string for Plugin.
|
|
7
|
-
FOUNDATION_EXPORT const unsigned char PluginVersionString[];
|
|
8
|
-
|
|
9
|
-
// In this header, you should import all the public headers of your framework using statements like #import <Plugin/PublicHeader.h>
|
|
10
|
-
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
#import <Foundation/Foundation.h>
|
|
2
|
-
#import <Capacitor/Capacitor.h>
|
|
3
|
-
|
|
4
|
-
CAP_PLUGIN(CAPCameraPlugin, "Camera",
|
|
5
|
-
CAP_PLUGIN_METHOD(getPhoto, CAPPluginReturnPromise);
|
|
6
|
-
CAP_PLUGIN_METHOD(pickImages, CAPPluginReturnPromise);
|
|
7
|
-
CAP_PLUGIN_METHOD(checkPermissions, CAPPluginReturnPromise);
|
|
8
|
-
CAP_PLUGIN_METHOD(requestPermissions, CAPPluginReturnPromise);
|
|
9
|
-
CAP_PLUGIN_METHOD(pickLimitedLibraryPhotos, CAPPluginReturnPromise);
|
|
10
|
-
CAP_PLUGIN_METHOD(getLimitedLibraryPhotos, CAPPluginReturnPromise);
|
|
11
|
-
)
|
package/ios/Plugin/Info.plist
DELETED
|
@@ -1,24 +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>CFBundleDevelopmentRegion</key>
|
|
6
|
-
<string>$(DEVELOPMENT_LANGUAGE)</string>
|
|
7
|
-
<key>CFBundleExecutable</key>
|
|
8
|
-
<string>$(EXECUTABLE_NAME)</string>
|
|
9
|
-
<key>CFBundleIdentifier</key>
|
|
10
|
-
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
|
|
11
|
-
<key>CFBundleInfoDictionaryVersion</key>
|
|
12
|
-
<string>6.0</string>
|
|
13
|
-
<key>CFBundleName</key>
|
|
14
|
-
<string>$(PRODUCT_NAME)</string>
|
|
15
|
-
<key>CFBundlePackageType</key>
|
|
16
|
-
<string>FMWK</string>
|
|
17
|
-
<key>CFBundleShortVersionString</key>
|
|
18
|
-
<string>1.0</string>
|
|
19
|
-
<key>CFBundleVersion</key>
|
|
20
|
-
<string>$(CURRENT_PROJECT_VERSION)</string>
|
|
21
|
-
<key>NSPrincipalClass</key>
|
|
22
|
-
<string></string>
|
|
23
|
-
</dict>
|
|
24
|
-
</plist>
|
|
File without changes
|
|
File without changes
|
|
File without changes
|