@capacitor/haptics 5.0.7-nightly-20231108T150452.0 → 6.0.0-alpha.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.
@@ -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/Plugin/**/*.{swift,h,m,c,cc,mm,cpp}', 'haptics/ios/Plugin/**/*.{swift,h,m,c,cc,mm,cpp}'
13
+ s.source_files = 'ios/Sources/**/*.{swift,h,m,c,cc,mm,cpp}', 'haptics/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: "CapacitorHapticsPlugin",
6
+ platforms: [.iOS(.v13)],
7
+ products: [
8
+ .library(
9
+ name: "HapticsPlugin",
10
+ targets: ["HapticsPlugin"])
11
+ ],
12
+ dependencies: [
13
+ .package(url: "https://github.com/ionic-team/capacitor6-spm-test.git", branch: "main")
14
+ ],
15
+ targets: [
16
+ .target(
17
+ name: "HapticsPlugin",
18
+ dependencies: [
19
+ .product(name: "Capacitor", package: "capacitor6-spm-test"),
20
+ .product(name: "Cordova", package: "capacitor6-spm-test")
21
+ ],
22
+ path: "ios/Sources/HapticsPlugin"),
23
+ .testTarget(
24
+ name: "HapticsPluginTests",
25
+ dependencies: ["HapticsPlugin"],
26
+ path: "ios/Tests/HapticsPluginTests")
27
+ ]
28
+ )
@@ -31,7 +31,7 @@ if (System.getenv("CAP_PLUGIN_PUBLISH") == "true") {
31
31
 
32
32
  android {
33
33
  namespace "com.capacitorjs.plugins.haptics"
34
- compileSdkVersion project.hasProperty('compileSdkVersion') ? rootProject.ext.compileSdkVersion : 34
34
+ compileSdk project.hasProperty('compileSdkVersion') ? rootProject.ext.compileSdkVersion : 34
35
35
  defaultConfig {
36
36
  minSdkVersion project.hasProperty('minSdkVersion') ? rootProject.ext.minSdkVersion : 22
37
37
  targetSdkVersion project.hasProperty('targetSdkVersion') ? rootProject.ext.targetSdkVersion : 34
@@ -1,7 +1,17 @@
1
1
  import Capacitor
2
2
 
3
3
  @objc(HapticsPlugin)
4
- public class HapticsPlugin: CAPPlugin {
4
+ public class HapticsPlugin: CAPPlugin, CAPBridgedPlugin {
5
+ public let identifier = "HapticsPlugin"
6
+ public let jsName = "Haptics"
7
+ public let pluginMethods: [CAPPluginMethod] = [
8
+ CAPPluginMethod(name: "impact", returnType: CAPPluginReturnPromise),
9
+ CAPPluginMethod(name: "notification", returnType: CAPPluginReturnPromise),
10
+ CAPPluginMethod(name: "selectionStart", returnType: CAPPluginReturnPromise),
11
+ CAPPluginMethod(name: "selectionChanged", returnType: CAPPluginReturnPromise),
12
+ CAPPluginMethod(name: "selectionEnd", returnType: CAPPluginReturnPromise),
13
+ CAPPluginMethod(name: "vibrate", returnType: CAPPluginReturnPromise)
14
+ ]
5
15
  private let implementation = Haptics()
6
16
 
7
17
  @objc public func impact(_ call: CAPPluginCall) {
@@ -0,0 +1,12 @@
1
+ import XCTest
2
+ @testable import HapticsPlugin
3
+
4
+ final class HapticsPluginTests: 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/haptics",
3
- "version": "5.0.7-nightly-20231108T150452.0",
3
+ "version": "6.0.0-alpha.2",
4
4
  "description": "The Haptics API provides physical feedback to the user through touch or vibration.",
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/Plugin/",
13
+ "ios/Sources",
14
+ "ios/Tests",
15
+ "Package.swift",
14
16
  "CapacitorHaptics.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": "cd ios && pod install && xcodebuild -workspace Plugin.xcworkspace -scheme Plugin -destination generic/platform=iOS && cd ..",
34
+ "verify:ios": "xcodebuild build -scheme CapacitorHapticsPlugin -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",
@@ -45,10 +47,10 @@
45
47
  "publish:cocoapod": "pod trunk push ./CapacitorHaptics.podspec --allow-warnings"
46
48
  },
47
49
  "devDependencies": {
48
- "@capacitor/android": "^5.0.0",
49
- "@capacitor/core": "^5.0.0",
50
+ "@capacitor/android": "next",
51
+ "@capacitor/core": "next",
50
52
  "@capacitor/docgen": "0.2.0",
51
- "@capacitor/ios": "^5.0.0",
53
+ "@capacitor/ios": "next",
52
54
  "@ionic/eslint-config": "^0.3.0",
53
55
  "@ionic/prettier-config": "~1.0.1",
54
56
  "@ionic/swiftlint-config": "^1.1.2",
@@ -61,7 +63,7 @@
61
63
  "typescript": "~4.1.5"
62
64
  },
63
65
  "peerDependencies": {
64
- "@capacitor/core": "^5.0.0"
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": "c44bf164b01d5f5ed405695f06efd36a881c4272"
84
+ "gitHead": "af95940154b4286542e776f348c58faccbf16803"
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,13 +0,0 @@
1
- #import <Foundation/Foundation.h>
2
- #import <Capacitor/Capacitor.h>
3
-
4
- // Define the plugin using the CAP_PLUGIN Macro, and
5
- // each method the plugin supports using the CAP_PLUGIN_METHOD macro.
6
- CAP_PLUGIN(HapticsPlugin, "Haptics",
7
- CAP_PLUGIN_METHOD(impact, CAPPluginReturnPromise);
8
- CAP_PLUGIN_METHOD(notification, CAPPluginReturnPromise);
9
- CAP_PLUGIN_METHOD(selectionStart, CAPPluginReturnPromise);
10
- CAP_PLUGIN_METHOD(selectionChanged, CAPPluginReturnPromise);
11
- CAP_PLUGIN_METHOD(selectionEnd, CAPPluginReturnPromise);
12
- CAP_PLUGIN_METHOD(vibrate, CAPPluginReturnPromise);
13
- )
@@ -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>