Browse Source

some changes

Ángel G. Romero Rosario 2 years ago
parent
commit
c69eb35d5c

+ 2
- 1
.gitignore View File

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

+ 1
- 0
android/app/capacitor.build.gradle View File

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

+ 3
- 0
android/capacitor.settings.gradle View File

5
 include ':capacitor-app'
5
 include ':capacitor-app'
6
 project(':capacitor-app').projectDir = new File('../node_modules/@capacitor/app/android')
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
 include ':capacitor-haptics'
11
 include ':capacitor-haptics'
9
 project(':capacitor-haptics').projectDir = new File('../node_modules/@capacitor/haptics/android')
12
 project(':capacitor-haptics').projectDir = new File('../node_modules/@capacitor/haptics/android')
10
 
13
 

+ 10
- 0
capacitor.config 2.ts View File

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 View File

45
 	</array>
45
 	</array>
46
 	<key>UIViewControllerBasedStatusBarAppearance</key>
46
 	<key>UIViewControllerBasedStatusBarAppearance</key>
47
 	<true/>
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
 </dict>
54
 </dict>
49
 </plist>
55
 </plist>

+ 1
- 0
ios/App/Podfile View File

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

+ 30
- 0
package-lock.json View File

10
       "dependencies": {
10
       "dependencies": {
11
         "@capacitor/android": "4.5.0",
11
         "@capacitor/android": "4.5.0",
12
         "@capacitor/app": "4.1.1",
12
         "@capacitor/app": "4.1.1",
13
+        "@capacitor/camera": "^4.1.4",
13
         "@capacitor/core": "4.5.0",
14
         "@capacitor/core": "4.5.0",
15
+        "@capacitor/filesystem": "^4.1.4",
14
         "@capacitor/haptics": "4.1.0",
16
         "@capacitor/haptics": "4.1.0",
15
         "@capacitor/ios": "4.5.0",
17
         "@capacitor/ios": "4.5.0",
16
         "@capacitor/keyboard": "4.1.0",
18
         "@capacitor/keyboard": "4.1.0",
2098
         "@capacitor/core": "^4.0.0"
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
     "node_modules/@capacitor/cli": {
2111
     "node_modules/@capacitor/cli": {
2102
       "version": "4.5.0",
2112
       "version": "4.5.0",
2103
       "resolved": "https://registry.npmjs.org/@capacitor/cli/-/cli-4.5.0.tgz",
2113
       "resolved": "https://registry.npmjs.org/@capacitor/cli/-/cli-4.5.0.tgz",
2156
         "tslib": "^2.1.0"
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
     "node_modules/@capacitor/haptics": {
2177
     "node_modules/@capacitor/haptics": {
2160
       "version": "4.1.0",
2178
       "version": "4.1.0",
2161
       "resolved": "https://registry.npmjs.org/@capacitor/haptics/-/haptics-4.1.0.tgz",
2179
       "resolved": "https://registry.npmjs.org/@capacitor/haptics/-/haptics-4.1.0.tgz",
18922
       "integrity": "sha512-SJcJA1rhFQyeH6eLfUEbdKkHzAwzahJNVPNXmU88fdmXpMgM2dJGzZj1vrm6e21aQq+Z4aBVLJ2RCdj92zD7wg==",
18940
       "integrity": "sha512-SJcJA1rhFQyeH6eLfUEbdKkHzAwzahJNVPNXmU88fdmXpMgM2dJGzZj1vrm6e21aQq+Z4aBVLJ2RCdj92zD7wg==",
18923
       "requires": {}
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
     "@capacitor/cli": {
18949
     "@capacitor/cli": {
18926
       "version": "4.5.0",
18950
       "version": "4.5.0",
18927
       "resolved": "https://registry.npmjs.org/@capacitor/cli/-/cli-4.5.0.tgz",
18951
       "resolved": "https://registry.npmjs.org/@capacitor/cli/-/cli-4.5.0.tgz",
18969
         "tslib": "^2.1.0"
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
     "@capacitor/haptics": {
19002
     "@capacitor/haptics": {
18973
       "version": "4.1.0",
19003
       "version": "4.1.0",
18974
       "resolved": "https://registry.npmjs.org/@capacitor/haptics/-/haptics-4.1.0.tgz",
19004
       "resolved": "https://registry.npmjs.org/@capacitor/haptics/-/haptics-4.1.0.tgz",

+ 2
- 0
package.json View File

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

+ 14
- 0
src/pages/components/saveMoti.tsx View File

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
+}