Ángel G. Romero Rosario 2 gadus atpakaļ
vecāks
revīzija
c69eb35d5c

+ 2
- 1
.gitignore Parādīt failu

@@ -2,4 +2,5 @@ node_modules/
2 2
 public/
3 3
 ios/
4 4
 android/
5
-build/
5
+build/
6
+.vscode/

+ 1
- 0
android/app/capacitor.build.gradle Parādīt failu

@@ -10,6 +10,7 @@ android {
10 10
 apply from: "../capacitor-cordova-android-plugins/cordova.variables.gradle"
11 11
 dependencies {
12 12
     implementation project(':capacitor-app')
13
+    implementation project(':capacitor-camera')
13 14
     implementation project(':capacitor-haptics')
14 15
     implementation project(':capacitor-keyboard')
15 16
     implementation project(':capacitor-status-bar')

+ 3
- 0
android/capacitor.settings.gradle Parādīt failu

@@ -5,6 +5,9 @@ project(':capacitor-android').projectDir = new File('../node_modules/@capacitor/
5 5
 include ':capacitor-app'
6 6
 project(':capacitor-app').projectDir = new File('../node_modules/@capacitor/app/android')
7 7
 
8
+include ':capacitor-camera'
9
+project(':capacitor-camera').projectDir = new File('../node_modules/@capacitor/camera/android')
10
+
8 11
 include ':capacitor-haptics'
9 12
 project(':capacitor-haptics').projectDir = new File('../node_modules/@capacitor/haptics/android')
10 13
 

+ 10
- 0
capacitor.config 2.ts Parādīt failu

@@ -0,0 +1,10 @@
1
+import { CapacitorConfig } from '@capacitor/cli';
2
+
3
+const config: CapacitorConfig = {
4
+  appId: 'io.ionic.starter',
5
+  appName: 'TPCApp',
6
+  webDir: 'build',
7
+  bundledWebRuntime: false
8
+};
9
+
10
+export default config;

+ 6
- 0
ios/App/App/Info.plist Parādīt failu

@@ -45,5 +45,11 @@
45 45
 	</array>
46 46
 	<key>UIViewControllerBasedStatusBarAppearance</key>
47 47
 	<true/>
48
+	<key>NSCameraUsageDescription</key>
49
+	<string>To capture images</string>
50
+	<key>NSPhotoLibraryAddUsageDescription</key>
51
+	<string>To add images</string>
52
+	<key>NSPhotoLibraryUsageDescription</key>
53
+	<string>To store images</string>
48 54
 </dict>
49 55
 </plist>

+ 1
- 0
ios/App/Podfile Parādīt failu

@@ -12,6 +12,7 @@ def capacitor_pods
12 12
   pod 'Capacitor', :path => '../../node_modules/@capacitor/ios'
13 13
   pod 'CapacitorCordova', :path => '../../node_modules/@capacitor/ios'
14 14
   pod 'CapacitorApp', :path => '../../node_modules/@capacitor/app'
15
+  pod 'CapacitorCamera', :path => '../../node_modules/@capacitor/camera'
15 16
   pod 'CapacitorHaptics', :path => '../../node_modules/@capacitor/haptics'
16 17
   pod 'CapacitorKeyboard', :path => '../../node_modules/@capacitor/keyboard'
17 18
   pod 'CapacitorStatusBar', :path => '../../node_modules/@capacitor/status-bar'

+ 30
- 0
package-lock.json Parādīt failu

@@ -10,7 +10,9 @@
10 10
       "dependencies": {
11 11
         "@capacitor/android": "4.5.0",
12 12
         "@capacitor/app": "4.1.1",
13
+        "@capacitor/camera": "^4.1.4",
13 14
         "@capacitor/core": "4.5.0",
15
+        "@capacitor/filesystem": "^4.1.4",
14 16
         "@capacitor/haptics": "4.1.0",
15 17
         "@capacitor/ios": "4.5.0",
16 18
         "@capacitor/keyboard": "4.1.0",
@@ -2098,6 +2100,14 @@
2098 2100
         "@capacitor/core": "^4.0.0"
2099 2101
       }
2100 2102
     },
2103
+    "node_modules/@capacitor/camera": {
2104
+      "version": "4.1.4",
2105
+      "resolved": "https://registry.npmjs.org/@capacitor/camera/-/camera-4.1.4.tgz",
2106
+      "integrity": "sha512-7f4n7PlnstYsdGyxc0Kc4hIyS6csFLOjXvffm7pJsuy9pSo+kfdOPdYgGg360QwbUAmA+Yv+J1ZW1eFIwgvWrQ==",
2107
+      "peerDependencies": {
2108
+        "@capacitor/core": "^4.0.0"
2109
+      }
2110
+    },
2101 2111
     "node_modules/@capacitor/cli": {
2102 2112
       "version": "4.5.0",
2103 2113
       "resolved": "https://registry.npmjs.org/@capacitor/cli/-/cli-4.5.0.tgz",
@@ -2156,6 +2166,14 @@
2156 2166
         "tslib": "^2.1.0"
2157 2167
       }
2158 2168
     },
2169
+    "node_modules/@capacitor/filesystem": {
2170
+      "version": "4.1.4",
2171
+      "resolved": "https://registry.npmjs.org/@capacitor/filesystem/-/filesystem-4.1.4.tgz",
2172
+      "integrity": "sha512-ivko1RNK4hq63xhMacq8D6D97N5/SAafTsrmY/pghYrG6Cl2SEY0+IgRu7V9/VWeN3FSplyUPucjUTAFQxXN5g==",
2173
+      "peerDependencies": {
2174
+        "@capacitor/core": "^4.0.0"
2175
+      }
2176
+    },
2159 2177
     "node_modules/@capacitor/haptics": {
2160 2178
       "version": "4.1.0",
2161 2179
       "resolved": "https://registry.npmjs.org/@capacitor/haptics/-/haptics-4.1.0.tgz",
@@ -18922,6 +18940,12 @@
18922 18940
       "integrity": "sha512-SJcJA1rhFQyeH6eLfUEbdKkHzAwzahJNVPNXmU88fdmXpMgM2dJGzZj1vrm6e21aQq+Z4aBVLJ2RCdj92zD7wg==",
18923 18941
       "requires": {}
18924 18942
     },
18943
+    "@capacitor/camera": {
18944
+      "version": "4.1.4",
18945
+      "resolved": "https://registry.npmjs.org/@capacitor/camera/-/camera-4.1.4.tgz",
18946
+      "integrity": "sha512-7f4n7PlnstYsdGyxc0Kc4hIyS6csFLOjXvffm7pJsuy9pSo+kfdOPdYgGg360QwbUAmA+Yv+J1ZW1eFIwgvWrQ==",
18947
+      "requires": {}
18948
+    },
18925 18949
     "@capacitor/cli": {
18926 18950
       "version": "4.5.0",
18927 18951
       "resolved": "https://registry.npmjs.org/@capacitor/cli/-/cli-4.5.0.tgz",
@@ -18969,6 +18993,12 @@
18969 18993
         "tslib": "^2.1.0"
18970 18994
       }
18971 18995
     },
18996
+    "@capacitor/filesystem": {
18997
+      "version": "4.1.4",
18998
+      "resolved": "https://registry.npmjs.org/@capacitor/filesystem/-/filesystem-4.1.4.tgz",
18999
+      "integrity": "sha512-ivko1RNK4hq63xhMacq8D6D97N5/SAafTsrmY/pghYrG6Cl2SEY0+IgRu7V9/VWeN3FSplyUPucjUTAFQxXN5g==",
19000
+      "requires": {}
19001
+    },
18972 19002
     "@capacitor/haptics": {
18973 19003
       "version": "4.1.0",
18974 19004
       "resolved": "https://registry.npmjs.org/@capacitor/haptics/-/haptics-4.1.0.tgz",

+ 2
- 0
package.json Parādīt failu

@@ -5,7 +5,9 @@
5 5
   "dependencies": {
6 6
     "@capacitor/android": "4.5.0",
7 7
     "@capacitor/app": "4.1.1",
8
+    "@capacitor/camera": "^4.1.4",
8 9
     "@capacitor/core": "4.5.0",
10
+    "@capacitor/filesystem": "^4.1.4",
9 11
     "@capacitor/haptics": "4.1.0",
10 12
     "@capacitor/ios": "4.5.0",
11 13
     "@capacitor/keyboard": "4.1.0",

+ 14
- 0
src/pages/components/saveMoti.tsx Parādīt failu

@@ -0,0 +1,14 @@
1
+import { Camera, CameraResultType, CameraSource, Photo } from '@capacitor/camera';
2
+
3
+
4
+import '../styles/styles.css';
5
+
6
+const Image_Dir = 'stored-images';
7
+
8
+
9
+export class saveMoti {
10
+    
11
+    async selectImage(){
12
+        const image = await Camera.getPhoto()
13
+    }
14
+}