@capacitor-community/camera-preview 5.0.0 → 6.0.1

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.
Files changed (109) hide show
  1. package/CapacitorCommunityCameraPreview.podspec +16 -13
  2. package/README.md +12 -2
  3. package/android/build.gradle +3 -3
  4. package/android/gradle/wrapper/gradle-wrapper.jar +0 -0
  5. package/android/gradle/wrapper/gradle-wrapper.properties +2 -1
  6. package/android/gradlew +8 -4
  7. package/android/src/main/java/com/ahm/capacitor/camera/preview/CameraPreview.java +8 -9
  8. package/dist/esm/definitions.d.ts +8 -5
  9. package/dist/esm/definitions.js.map +1 -1
  10. package/dist/esm/index.js.map +1 -1
  11. package/dist/esm/web.d.ts +6 -3
  12. package/dist/esm/web.js +10 -5
  13. package/dist/esm/web.js.map +1 -1
  14. package/dist/plugin.cjs.js +10 -7
  15. package/dist/plugin.cjs.js.map +1 -1
  16. package/dist/plugin.js +11 -8
  17. package/dist/plugin.js.map +1 -1
  18. package/ios/Plugin/Plugin.m +1 -0
  19. package/ios/Plugin/Plugin.swift +10 -0
  20. package/ios/PluginTests/PluginTests.swift +0 -19
  21. package/ios/Podfile.lock +5 -5
  22. package/package.json +24 -22
  23. package/android/.gradle/8.0.2/checksums/checksums.lock +0 -0
  24. package/android/.gradle/8.0.2/checksums/md5-checksums.bin +0 -0
  25. package/android/.gradle/8.0.2/checksums/sha1-checksums.bin +0 -0
  26. package/android/.gradle/8.0.2/dependencies-accessors/dependencies-accessors.lock +0 -0
  27. package/android/.gradle/8.0.2/dependencies-accessors/gc.properties +0 -0
  28. package/android/.gradle/8.0.2/executionHistory/executionHistory.bin +0 -0
  29. package/android/.gradle/8.0.2/executionHistory/executionHistory.lock +0 -0
  30. package/android/.gradle/8.0.2/fileChanges/last-build.bin +0 -0
  31. package/android/.gradle/8.0.2/fileHashes/fileHashes.bin +0 -0
  32. package/android/.gradle/8.0.2/fileHashes/fileHashes.lock +0 -0
  33. package/android/.gradle/8.0.2/fileHashes/resourceHashesCache.bin +0 -0
  34. package/android/.gradle/8.0.2/gc.properties +0 -0
  35. package/android/.gradle/buildOutputCleanup/buildOutputCleanup.lock +0 -0
  36. package/android/.gradle/buildOutputCleanup/cache.properties +0 -2
  37. package/android/.gradle/buildOutputCleanup/outputFiles.bin +0 -0
  38. package/android/.gradle/file-system.probe +0 -0
  39. package/android/.gradle/vcs-1/gc.properties +0 -0
  40. package/ios/Pods/CapacitorCordova/LICENSE +0 -23
  41. package/ios/Pods/CapacitorCordova/README.md +0 -39
  42. package/ios/Pods/CapacitorCordova/ios/CapacitorCordova/CapacitorCordova/CapacitorCordova.h +0 -21
  43. package/ios/Pods/CapacitorCordova/ios/CapacitorCordova/CapacitorCordova/Classes/Public/AppDelegate.h +0 -8
  44. package/ios/Pods/CapacitorCordova/ios/CapacitorCordova/CapacitorCordova/Classes/Public/AppDelegate.m +0 -5
  45. package/ios/Pods/CapacitorCordova/ios/CapacitorCordova/CapacitorCordova/Classes/Public/CDV.h +0 -28
  46. package/ios/Pods/CapacitorCordova/ios/CapacitorCordova/CapacitorCordova/Classes/Public/CDVAvailability.h +0 -109
  47. package/ios/Pods/CapacitorCordova/ios/CapacitorCordova/CapacitorCordova/Classes/Public/CDVCommandDelegate.h +0 -51
  48. package/ios/Pods/CapacitorCordova/ios/CapacitorCordova/CapacitorCordova/Classes/Public/CDVCommandDelegateImpl.h +0 -39
  49. package/ios/Pods/CapacitorCordova/ios/CapacitorCordova/CapacitorCordova/Classes/Public/CDVCommandDelegateImpl.m +0 -154
  50. package/ios/Pods/CapacitorCordova/ios/CapacitorCordova/CapacitorCordova/Classes/Public/CDVConfigParser.h +0 -31
  51. package/ios/Pods/CapacitorCordova/ios/CapacitorCordova/CapacitorCordova/Classes/Public/CDVConfigParser.m +0 -81
  52. package/ios/Pods/CapacitorCordova/ios/CapacitorCordova/CapacitorCordova/Classes/Public/CDVInvokedUrlCommand.h +0 -52
  53. package/ios/Pods/CapacitorCordova/ios/CapacitorCordova/CapacitorCordova/Classes/Public/CDVInvokedUrlCommand.m +0 -116
  54. package/ios/Pods/CapacitorCordova/ios/CapacitorCordova/CapacitorCordova/Classes/Public/CDVPlugin.h +0 -81
  55. package/ios/Pods/CapacitorCordova/ios/CapacitorCordova/CapacitorCordova/Classes/Public/CDVPlugin.m +0 -154
  56. package/ios/Pods/CapacitorCordova/ios/CapacitorCordova/CapacitorCordova/Classes/Public/CDVPluginManager.h +0 -25
  57. package/ios/Pods/CapacitorCordova/ios/CapacitorCordova/CapacitorCordova/Classes/Public/CDVPluginManager.m +0 -77
  58. package/ios/Pods/CapacitorCordova/ios/CapacitorCordova/CapacitorCordova/Classes/Public/CDVPluginResult.h +0 -82
  59. package/ios/Pods/CapacitorCordova/ios/CapacitorCordova/CapacitorCordova/Classes/Public/CDVPluginResult.m +0 -216
  60. package/ios/Pods/CapacitorCordova/ios/CapacitorCordova/CapacitorCordova/Classes/Public/CDVScreenOrientationDelegate.h +0 -33
  61. package/ios/Pods/CapacitorCordova/ios/CapacitorCordova/CapacitorCordova/Classes/Public/CDVUIWebViewDelegate.h +0 -41
  62. package/ios/Pods/CapacitorCordova/ios/CapacitorCordova/CapacitorCordova/Classes/Public/CDVUIWebViewDelegate.m +0 -399
  63. package/ios/Pods/CapacitorCordova/ios/CapacitorCordova/CapacitorCordova/Classes/Public/CDVURLProtocol.h +0 -27
  64. package/ios/Pods/CapacitorCordova/ios/CapacitorCordova/CapacitorCordova/Classes/Public/CDVURLProtocol.m +0 -74
  65. package/ios/Pods/CapacitorCordova/ios/CapacitorCordova/CapacitorCordova/Classes/Public/CDVUserAgentUtil.h +0 -27
  66. package/ios/Pods/CapacitorCordova/ios/CapacitorCordova/CapacitorCordova/Classes/Public/CDVUserAgentUtil.m +0 -156
  67. package/ios/Pods/CapacitorCordova/ios/CapacitorCordova/CapacitorCordova/Classes/Public/CDVViewController.h +0 -30
  68. package/ios/Pods/CapacitorCordova/ios/CapacitorCordova/CapacitorCordova/Classes/Public/CDVViewController.m +0 -34
  69. package/ios/Pods/CapacitorCordova/ios/CapacitorCordova/CapacitorCordova/Classes/Public/NSDictionary+CordovaPreferences.h +0 -35
  70. package/ios/Pods/CapacitorCordova/ios/CapacitorCordova/CapacitorCordova/Classes/Public/NSDictionary+CordovaPreferences.m +0 -63
  71. package/ios/Pods/Local Podspecs/Capacitor.podspec.json +0 -34
  72. package/ios/Pods/Local Podspecs/CapacitorCordova.podspec.json +0 -26
  73. package/ios/Pods/Manifest.lock +0 -22
  74. package/ios/Pods/Pods.xcodeproj/project.pbxproj +0 -1374
  75. package/ios/Pods/Pods.xcodeproj/xcuserdata/julionic.xcuserdatad/xcschemes/Capacitor.xcscheme +0 -58
  76. package/ios/Pods/Pods.xcodeproj/xcuserdata/julionic.xcuserdatad/xcschemes/CapacitorCordova.xcscheme +0 -58
  77. package/ios/Pods/Pods.xcodeproj/xcuserdata/julionic.xcuserdatad/xcschemes/Pods-Plugin.xcscheme +0 -58
  78. package/ios/Pods/Pods.xcodeproj/xcuserdata/julionic.xcuserdatad/xcschemes/Pods-PluginTests.xcscheme +0 -58
  79. package/ios/Pods/Pods.xcodeproj/xcuserdata/julionic.xcuserdatad/xcschemes/xcschememanagement.plist +0 -31
  80. package/ios/Pods/Target Support Files/Capacitor/Capacitor-Info.plist +0 -26
  81. package/ios/Pods/Target Support Files/Capacitor/Capacitor-dummy.m +0 -5
  82. package/ios/Pods/Target Support Files/Capacitor/Capacitor-prefix.pch +0 -12
  83. package/ios/Pods/Target Support Files/Capacitor/Capacitor.debug.xcconfig +0 -15
  84. package/ios/Pods/Target Support Files/Capacitor/Capacitor.modulemap +0 -8
  85. package/ios/Pods/Target Support Files/Capacitor/Capacitor.release.xcconfig +0 -15
  86. package/ios/Pods/Target Support Files/CapacitorCordova/CapacitorCordova-Info.plist +0 -26
  87. package/ios/Pods/Target Support Files/CapacitorCordova/CapacitorCordova-dummy.m +0 -5
  88. package/ios/Pods/Target Support Files/CapacitorCordova/CapacitorCordova-prefix.pch +0 -12
  89. package/ios/Pods/Target Support Files/CapacitorCordova/CapacitorCordova-umbrella.h +0 -32
  90. package/ios/Pods/Target Support Files/CapacitorCordova/CapacitorCordova.debug.xcconfig +0 -12
  91. package/ios/Pods/Target Support Files/CapacitorCordova/CapacitorCordova.modulemap +0 -6
  92. package/ios/Pods/Target Support Files/CapacitorCordova/CapacitorCordova.release.xcconfig +0 -12
  93. package/ios/Pods/Target Support Files/Pods-Plugin/Pods-Plugin-Info.plist +0 -26
  94. package/ios/Pods/Target Support Files/Pods-Plugin/Pods-Plugin-acknowledgements.markdown +0 -53
  95. package/ios/Pods/Target Support Files/Pods-Plugin/Pods-Plugin-acknowledgements.plist +0 -91
  96. package/ios/Pods/Target Support Files/Pods-Plugin/Pods-Plugin-dummy.m +0 -5
  97. package/ios/Pods/Target Support Files/Pods-Plugin/Pods-Plugin-umbrella.h +0 -16
  98. package/ios/Pods/Target Support Files/Pods-Plugin/Pods-Plugin.debug.xcconfig +0 -14
  99. package/ios/Pods/Target Support Files/Pods-Plugin/Pods-Plugin.modulemap +0 -6
  100. package/ios/Pods/Target Support Files/Pods-Plugin/Pods-Plugin.release.xcconfig +0 -14
  101. package/ios/Pods/Target Support Files/Pods-PluginTests/Pods-PluginTests-Info.plist +0 -26
  102. package/ios/Pods/Target Support Files/Pods-PluginTests/Pods-PluginTests-acknowledgements.markdown +0 -53
  103. package/ios/Pods/Target Support Files/Pods-PluginTests/Pods-PluginTests-acknowledgements.plist +0 -91
  104. package/ios/Pods/Target Support Files/Pods-PluginTests/Pods-PluginTests-dummy.m +0 -5
  105. package/ios/Pods/Target Support Files/Pods-PluginTests/Pods-PluginTests-frameworks.sh +0 -188
  106. package/ios/Pods/Target Support Files/Pods-PluginTests/Pods-PluginTests-umbrella.h +0 -16
  107. package/ios/Pods/Target Support Files/Pods-PluginTests/Pods-PluginTests.debug.xcconfig +0 -15
  108. package/ios/Pods/Target Support Files/Pods-PluginTests/Pods-PluginTests.modulemap +0 -6
  109. package/ios/Pods/Target Support Files/Pods-PluginTests/Pods-PluginTests.release.xcconfig +0 -15
@@ -13,23 +13,4 @@ class PluginTests: XCTestCase {
13
13
  // Put teardown code here. This method is called after the invocation of each test method in the class.
14
14
  super.tearDown()
15
15
  }
16
-
17
- func testEcho() {
18
- // This is an example of a functional test case for a plugin.
19
- // Use XCTAssert and related functions to verify your tests produce the correct results.
20
-
21
- let value = "Hello, World!"
22
- let plugin = MyPlugin()
23
-
24
- let call = CAPPluginCall(callbackId: "test", options: [
25
- "value": value
26
- ], success: { (result, _) in
27
- let resultValue = result!.data["value"] as? String
28
- XCTAssertEqual(value, resultValue)
29
- }, error: { (_) in
30
- XCTFail("Error shouldn't have been called")
31
- })
32
-
33
- plugin.echo(call!)
34
- }
35
16
  }
package/ios/Podfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PODS:
2
- - Capacitor (5.0.3):
2
+ - Capacitor (6.2.0):
3
3
  - CapacitorCordova
4
- - CapacitorCordova (5.0.3)
4
+ - CapacitorCordova (6.2.0)
5
5
 
6
6
  DEPENDENCIES:
7
7
  - "Capacitor (from `../node_modules/@capacitor/ios`)"
@@ -14,9 +14,9 @@ EXTERNAL SOURCES:
14
14
  :path: "../node_modules/@capacitor/ios"
15
15
 
16
16
  SPEC CHECKSUMS:
17
- Capacitor: 304a960e431f9e6f78556554ca71c41c1b2b9680
18
- CapacitorCordova: def732a63679698df6fb392bbe6d269a0b61e937
17
+ Capacitor: 1f3c7b9802d958cd8c4eb63895fff85dff2e1eea
18
+ CapacitorCordova: b33e7f4aa4ed105dd43283acdd940964374a87d9
19
19
 
20
20
  PODFILE CHECKSUM: 14e8b2400457751b865e1c327e7cfa1c6fa67da6
21
21
 
22
- COCOAPODS: 1.11.3
22
+ COCOAPODS: 1.15.2
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@capacitor-community/camera-preview",
3
- "version": "5.0.0",
3
+ "version": "6.0.1",
4
4
  "description": "Camera preview",
5
5
  "main": "dist/plugin.cjs.js",
6
6
  "module": "dist/esm/index.js",
@@ -11,41 +11,39 @@
11
11
  "verify:ios": "cd ios && pod install && xcodebuild -workspace Plugin.xcworkspace -scheme Plugin -destination generic/platform=iOS && cd ..",
12
12
  "verify:android": "cd android && ./gradlew clean build test && cd ..",
13
13
  "verify:web": "npm run build",
14
- "build": "npm run clean && tsc && rollup -c rollup.config.js",
14
+ "build": "npm run clean && tsc && rollup -c rollup.config.mjs",
15
15
  "clean": "rimraf './dist'",
16
16
  "watch": "tsc --watch",
17
- "lint": "concurrently -g \"npm:eslint\" \"npm:prettier -- --check\" \"npm run swiftlint -- lint ios\"",
17
+ "lint": "concurrently -g \"npm:eslint\" \"npm:prettier -- --check --plugin=prettier-plugin-java\" \"npm run swiftlint -- lint ios\"",
18
18
  "fmt": "concurrently -g \"npm:eslint -- --fix\" \"npm:prettier -- --write\" \"npm:swiftlint -- lint --fix --format ios\"",
19
19
  "eslint": "eslint . --ext ts",
20
20
  "prettier": "prettier \"**/*.{css,html,ts,js,java}\"",
21
21
  "swiftlint": "node-swiftlint",
22
22
  "prepublishOnly": "npm run build",
23
- "prepare": "husky install && npm run build",
24
- "release": "np --any-branch --yolo"
23
+ "prepare": "husky install && npm run build"
25
24
  },
26
25
  "author": "Ariel Hernandez Musa",
27
26
  "license": "MIT",
28
27
  "devDependencies": {
29
- "@capacitor/android": "^5.0.0",
30
- "@capacitor/core": "^5.0.0",
31
- "@capacitor/ios": "^5.0.0",
32
- "@ionic/eslint-config": "^0.3.0",
33
- "@ionic/prettier-config": "^2.0.0",
34
- "@ionic/swiftlint-config": "^1.1.2",
35
- "concurrently": "^7.0.0",
36
- "eslint": "^7.32.0",
37
- "husky": "^7.0.4",
38
- "np": "^7.7.0",
39
- "prettier": "^2.5.1",
40
- "prettier-plugin-java": "^1.6.1",
41
- "pretty-quick": "^3.1.3",
42
- "rimraf": "^3.0.2",
43
- "rollup": "^2.79.1",
44
- "swiftlint": "^1.0.1",
28
+ "@capacitor/android": "^6.2.0",
29
+ "@capacitor/core": "^6.2.0",
30
+ "@capacitor/ios": "^6.2.0",
31
+ "@ionic/eslint-config": "^0.4.0",
32
+ "@ionic/prettier-config": "^4.0.0",
33
+ "@ionic/swiftlint-config": "^2.0.0",
34
+ "concurrently": "^9.1.0",
35
+ "eslint": "^8.57.1",
36
+ "husky": "^9.1.7",
37
+ "prettier": "^3.4.2",
38
+ "prettier-plugin-java": "^2.6.5",
39
+ "pretty-quick": "^4.0.0",
40
+ "rimraf": "^6.0.1",
41
+ "rollup": "^4.28.1",
42
+ "swiftlint": "^2.0.0",
45
43
  "typescript": "^4.3.2"
46
44
  },
47
45
  "peerDependencies": {
48
- "@capacitor/core": "^5.0.0"
46
+ "@capacitor/core": "^6.0.0"
49
47
  },
50
48
  "husky": {
51
49
  "hooks": {
@@ -82,5 +80,9 @@
82
80
  },
83
81
  "bugs": {
84
82
  "url": "https://github.com/capacitor-community/camera-preview/issues"
83
+ },
84
+ "engines": {
85
+ "node": ">=18.0.0",
86
+ "npm": ">=9.0.0"
85
87
  }
86
88
  }
File without changes
@@ -1,2 +0,0 @@
1
- #Fri May 19 14:57:02 CEST 2023
2
- gradle.version=8.0.2
Binary file
File without changes
@@ -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>
@@ -1,8 +0,0 @@
1
- #import <Foundation/Foundation.h>
2
- #import "CDVViewController.h"
3
-
4
- @interface AppDelegate : NSObject
5
-
6
- @property (nonatomic, strong) CDVViewController* viewController;
7
-
8
- @end
@@ -1,5 +0,0 @@
1
- #import "AppDelegate.h"
2
-
3
- @implementation AppDelegate
4
-
5
- @end
@@ -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
@@ -1,51 +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 "CDVInvokedUrlCommand.h"
21
-
22
- @class CDVPlugin;
23
- @class CDVPluginResult;
24
-
25
- typedef NSURL* (^ UrlTransformerBlock)(NSURL*);
26
-
27
- @protocol CDVCommandDelegate <NSObject>
28
-
29
- @property (nonatomic, readonly) NSDictionary* settings;
30
- @property (nonatomic, copy) UrlTransformerBlock urlTransformer;
31
-
32
- - (NSString*)pathForResource:(NSString*)resourcepath;
33
- - (id)getCommandInstance:(NSString*)pluginName;
34
-
35
- // Sends a plugin result to the JS. This is thread-safe.
36
- - (void)sendPluginResult:(CDVPluginResult*)result callbackId:(NSString*)callbackId;
37
- // Evaluates the given JS. This is thread-safe.
38
- - (void)evalJs:(NSString*)js;
39
- // Can be used to evaluate JS right away instead of scheduling it on the run-loop.
40
- // This is required for dispatch resign and pause events, but should not be used
41
- // without reason. Without the run-loop delay, alerts used in JS callbacks may result
42
- // in dead-lock. This method must be called from the UI thread.
43
- - (void)evalJs:(NSString*)js scheduledOnRunLoop:(BOOL)scheduledOnRunLoop;
44
- // Run the javascript
45
- - (void)evalJsHelper2:(NSString*)js;
46
- // Runs the given block on a background thread using a shared thread-pool.
47
- - (void)runInBackground:(void (^)())block;
48
- // Returns the User-Agent of the associated UIWebView.
49
- - (NSString*)userAgent;
50
-
51
- @end
@@ -1,39 +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 <UIKit/UIKit.h>
21
- #import "CDVCommandDelegate.h"
22
- #import <WebKit/WebKit.h>
23
- #import "CDVPluginManager.h"
24
-
25
- @class CDVViewController;
26
- @class CDVCommandQueue;
27
-
28
- @interface CDVCommandDelegateImpl : NSObject <CDVCommandDelegate>{
29
- @private
30
- __weak WKWebView* _webView;
31
- __weak CDVPluginManager* _manager;
32
- NSRegularExpression* _callbackIdPattern;
33
- @protected
34
- __weak CDVCommandQueue* _commandQueue;
35
- BOOL _delayResponses;
36
- }
37
- - (id)initWithWebView:(WKWebView*)webView pluginManager:(CDVPluginManager *)manager;
38
- - (void)flushCommandQueueWithDelayedJs;
39
- @end
@@ -1,154 +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 "CDVCommandDelegateImpl.h"
21
- #import "CDVPluginResult.h"
22
- #import <WebKit/WebKit.h>
23
-
24
- @implementation CDVCommandDelegateImpl
25
-
26
- @synthesize urlTransformer;
27
-
28
- - (id)initWithWebView:(WKWebView*)webView pluginManager:(CDVPluginManager *)manager
29
- {
30
- self = [super init];
31
- if (self != nil) {
32
- _webView = webView;
33
- _manager = manager;
34
- NSError* err = nil;
35
- _callbackIdPattern = [NSRegularExpression regularExpressionWithPattern:@"[^A-Za-z0-9._-]" options:0 error:&err];
36
- if (err != nil) {
37
- // Couldn't initialize Regex
38
- NSLog(@"Error: Couldn't initialize regex");
39
- _callbackIdPattern = nil;
40
- }
41
- }
42
- return self;
43
- }
44
-
45
- - (NSString*)pathForResource:(NSString*)resourcepath
46
- {
47
- NSBundle* mainBundle = [NSBundle mainBundle];
48
- NSMutableArray* directoryParts = [NSMutableArray arrayWithArray:[resourcepath componentsSeparatedByString:@"/"]];
49
- NSString* filename = [directoryParts lastObject];
50
-
51
- [directoryParts removeLastObject];
52
-
53
- NSString* directoryPartsJoined = [directoryParts componentsJoinedByString:@"/"];
54
- NSString* baseFolder = @"public";
55
- NSString* directoryStr = baseFolder;
56
-
57
- if ([directoryPartsJoined length] > 0) {
58
- directoryStr = [NSString stringWithFormat:@"%@/%@", baseFolder, [directoryParts componentsJoinedByString:@"/"]];
59
- }
60
-
61
- return [mainBundle pathForResource:filename ofType:@"" inDirectory:directoryStr];
62
- }
63
-
64
- - (void)flushCommandQueueWithDelayedJs
65
- {
66
- _delayResponses = YES;
67
- _delayResponses = NO;
68
- }
69
-
70
- - (void)evalJsHelper2:(NSString*)js
71
- {
72
- dispatch_async(dispatch_get_main_queue(), ^{
73
- [_webView evaluateJavaScript:js completionHandler:^(id obj, NSError* error) {
74
- // TODO: obj can be something other than string
75
- if ([obj isKindOfClass:[NSString class]]) {
76
- NSString* commandsJSON = (NSString*)obj;
77
- if ([commandsJSON length] > 0) {
78
- NSLog(@"Exec: Retrieved new exec messages by chaining.");
79
- }
80
- }
81
- }];
82
- });
83
- }
84
-
85
- - (BOOL)isValidCallbackId:(NSString*)callbackId
86
- {
87
- if ((callbackId == nil) || (_callbackIdPattern == nil)) {
88
- return NO;
89
- }
90
-
91
- // Disallow if too long or if any invalid characters were found.
92
- if (([callbackId length] > 100) || [_callbackIdPattern firstMatchInString:callbackId options:0 range:NSMakeRange(0, [callbackId length])]) {
93
- return NO;
94
- }
95
- return YES;
96
- }
97
-
98
- - (void)sendPluginResult:(CDVPluginResult*)result callbackId:(NSString*)callbackId
99
- {
100
- // This occurs when there is are no win/fail callbacks for the call.
101
- if ([@"INVALID" isEqualToString:callbackId]) {
102
- return;
103
- }
104
- // This occurs when the callback id is malformed.
105
- if (![self isValidCallbackId:callbackId]) {
106
- NSLog(@"Invalid callback id received by sendPluginResult");
107
- return;
108
- }
109
- int status = [result.status intValue];
110
- BOOL keepCallback = [result.keepCallback boolValue];
111
- NSString* argumentsAsJSON = [result argumentsAsJSON];
112
- BOOL debug = NO;
113
-
114
- #ifdef DEBUG
115
- debug = YES;
116
- #endif
117
-
118
- NSString* js = [NSString stringWithFormat:@"cordova.require('cordova/exec').nativeCallback('%@',%d,%@,%d, %d)", callbackId, status, argumentsAsJSON, keepCallback, debug];
119
-
120
- [self evalJsHelper2:js];
121
- }
122
-
123
- - (void)evalJs:(NSString*)js
124
- {
125
- [self evalJs:js scheduledOnRunLoop:YES];
126
- }
127
-
128
- - (void)evalJs:(NSString*)js scheduledOnRunLoop:(BOOL)scheduledOnRunLoop
129
- {
130
- js = [NSString stringWithFormat:@"try{cordova.require('cordova/exec').nativeEvalAndFetch(function(){%@})}catch(e){console.log('exception nativeEvalAndFetch : '+e);};", js];
131
- [self evalJsHelper2:js];
132
- }
133
-
134
- - (id)getCommandInstance:(NSString*)pluginName
135
- {
136
- return [_manager getCommandInstance:pluginName];
137
- }
138
-
139
- - (void)runInBackground:(void (^)())block
140
- {
141
- dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), block);
142
- }
143
-
144
- - (NSString*)userAgent
145
- {
146
- return nil;
147
- }
148
-
149
- - (NSDictionary*)settings
150
- {
151
- return _manager.settings;
152
- }
153
-
154
- @end