From 73200a6359b85a0787659b288aeae3f0273f8428 Mon Sep 17 00:00:00 2001 From: Christian Spiewok Date: Mon, 30 Jan 2023 12:52:42 +0100 Subject: [PATCH] Capacitor 4.0 upgrade --- android/build.gradle | 10 +-- .../GetFeedbackCapacitorPlugin.java | 37 ++++++----- ios/Plugin.xcodeproj/project.pbxproj | 20 ++++-- ios/Plugin/GetFeedbackCapacitorPlugin.swift | 66 +++++++++---------- ios/Podfile | 10 ++- package-lock.json | 46 ++++++------- package.json | 6 +- src/definitions.ts | 6 +- src/web.ts | 33 ++++++---- 9 files changed, 128 insertions(+), 106 deletions(-) diff --git a/android/build.gradle b/android/build.gradle index fd73a63..975d6ac 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -1,8 +1,8 @@ ext { - junitVersion = project.hasProperty('junitVersion') ? rootProject.ext.junitVersion : '4.13.1' - androidxAppCompatVersion = project.hasProperty('androidxAppCompatVersion') ? rootProject.ext.androidxAppCompatVersion : '1.2.0' - androidxJunitVersion = project.hasProperty('androidxJunitVersion') ? rootProject.ext.androidxJunitVersion : '1.1.2' - androidxEspressoCoreVersion = project.hasProperty('androidxEspressoCoreVersion') ? rootProject.ext.androidxEspressoCoreVersion : '3.3.0' + junitVersion = project.hasProperty('junitVersion') ? rootProject.ext.junitVersion : '4.13.2' + androidxAppCompatVersion = project.hasProperty('androidxAppCompatVersion') ? rootProject.ext.androidxAppCompatVersion : '1.4.2' + androidxJunitVersion = project.hasProperty('androidxJunitVersion') ? rootProject.ext.androidxJunitVersion : '1.1.3' + androidxEspressoCoreVersion = project.hasProperty('androidxEspressoCoreVersion') ? rootProject.ext.androidxEspressoCoreVersion : '3.4.0' } buildscript { @@ -20,7 +20,7 @@ apply plugin: 'com.android.library' android { compileSdkVersion project.hasProperty('compileSdkVersion') ? rootProject.ext.compileSdkVersion : 31 defaultConfig { - minSdkVersion project.hasProperty('minSdkVersion') ? rootProject.ext.minSdkVersion : 19 + minSdkVersion project.hasProperty('minSdkVersion') ? rootProject.ext.minSdkVersion : 22 targetSdkVersion project.hasProperty('targetSdkVersion') ? rootProject.ext.targetSdkVersion : 31 versionCode 1 versionName "1.0" diff --git a/android/src/main/java/com/getfeedback/getfeedbackcapacitor/GetFeedbackCapacitorPlugin.java b/android/src/main/java/com/getfeedback/getfeedbackcapacitor/GetFeedbackCapacitorPlugin.java index 719ca89..3fba544 100644 --- a/android/src/main/java/com/getfeedback/getfeedbackcapacitor/GetFeedbackCapacitorPlugin.java +++ b/android/src/main/java/com/getfeedback/getfeedbackcapacitor/GetFeedbackCapacitorPlugin.java @@ -7,36 +7,31 @@ import android.content.IntentFilter; import android.graphics.Bitmap; import android.util.Log; - import androidx.annotation.NonNull; import androidx.fragment.app.Fragment; import androidx.fragment.app.FragmentActivity; import androidx.fragment.app.FragmentManager; import androidx.localbroadcastmanager.content.LocalBroadcastManager; - import com.getcapacitor.JSArray; import com.getcapacitor.JSObject; import com.getcapacitor.Plugin; import com.getcapacitor.PluginCall; import com.getcapacitor.PluginMethod; import com.getcapacitor.annotation.CapacitorPlugin; - import com.usabilla.sdk.ubform.UbConstants; import com.usabilla.sdk.ubform.Usabilla; import com.usabilla.sdk.ubform.UsabillaFormCallback; import com.usabilla.sdk.ubform.sdk.entity.FeedbackResult; import com.usabilla.sdk.ubform.sdk.form.FormClient; - -import org.jetbrains.annotations.NotNull; -import org.json.JSONException; -import org.json.JSONObject; - import java.util.ArrayList; import java.util.Arrays; import java.util.HashMap; import java.util.Iterator; import java.util.List; import java.util.Map; +import org.jetbrains.annotations.NotNull; +import org.json.JSONException; +import org.json.JSONObject; @CapacitorPlugin(name = "GetFeedbackCapacitor") public class GetFeedbackCapacitorPlugin extends Plugin implements UsabillaFormCallback { @@ -66,7 +61,7 @@ public void onReceive(Context context, Intent intent) { call.resolve(result); bridge.releaseCall(call); } else { - PluginCall callStandardEvent = bridge.getSavedCall(standardEventsCallID); + PluginCall callStandardEvent = bridge.getSavedCall(standardEventsCallID); callStandardEvent.resolve(result); } } @@ -95,8 +90,12 @@ public void onReceive(Context context, Intent intent) { @Override public void load() { super.load(); - LocalBroadcastManager.getInstance(getActivity()).registerReceiver(closingFormReceiver, new IntentFilter(UbConstants.INTENT_CLOSE_FORM)); - LocalBroadcastManager.getInstance(getActivity()).registerReceiver(closingCampaignReceiver, new IntentFilter(UbConstants.INTENT_CLOSE_CAMPAIGN)); + LocalBroadcastManager + .getInstance(getActivity()) + .registerReceiver(closingFormReceiver, new IntentFilter(UbConstants.INTENT_CLOSE_FORM)); + LocalBroadcastManager + .getInstance(getActivity()) + .registerReceiver(closingCampaignReceiver, new IntentFilter(UbConstants.INTENT_CLOSE_CAMPAIGN)); } @Override @@ -130,7 +129,7 @@ public void loadFeedbackForm(@NotNull PluginCall call) { String formID = call.getString("formID"); bridge.saveCall(call); passiveCallbackId = call.getCallbackId(); - getfeedback.loadFeedbackForm(formID, null, null,this); + getfeedback.loadFeedbackForm(formID, null, null, this); } @PluginMethod @@ -167,7 +166,7 @@ public void setCustomVariables(@NotNull PluginCall call) { JSObject customVars = call.getObject("customVariables"); final HashMap customVariables = new HashMap<>(); if (customVars != null) { - for (Iterator it = customVars.keys(); it.hasNext(); ) { + for (Iterator it = customVars.keys(); it.hasNext();) { final String key = it.next(); Object value; try { @@ -215,7 +214,6 @@ public boolean dismiss(@NotNull PluginCall call) { return false; } - @PluginMethod public void setDebugEnabled(@NonNull PluginCall call) { final boolean debugEnabled = call.getBoolean("debugEnabled"); @@ -224,8 +222,8 @@ public void setDebugEnabled(@NonNull PluginCall call) { @PluginMethod public void setDataMasking(@NonNull PluginCall call) { - JSArray masks = call.getArray("masks",defaultDataMasks); - String character = call.getString("character",defaultMaskCharacter); + JSArray masks = call.getArray("masks", defaultDataMasks); + String character = call.getString("character", defaultMaskCharacter); List listMasks = null; try { listMasks = masks.toList(); @@ -259,7 +257,10 @@ public void formLoadSuccess(@NotNull FormClient formClient) { form = formClient.getFragment(); final Activity activity = getActivity(); if (activity instanceof FragmentActivity && form != null) { - ((FragmentActivity) activity).getSupportFragmentManager().beginTransaction().replace(android.R.id.content, form, FRAGMENT_TAG).commit(); + ((FragmentActivity) activity).getSupportFragmentManager() + .beginTransaction() + .replace(android.R.id.content, form, FRAGMENT_TAG) + .commit(); form = null; } } @@ -286,4 +287,4 @@ private JSObject getResult(Intent intent, String feedbackResultType) { public void mainButtonTextUpdated(@NotNull String s) { // To fill with handling required when the main button text changes } -} \ No newline at end of file +} diff --git a/ios/Plugin.xcodeproj/project.pbxproj b/ios/Plugin.xcodeproj/project.pbxproj index 0ae24b7..92917b1 100644 --- a/ios/Plugin.xcodeproj/project.pbxproj +++ b/ios/Plugin.xcodeproj/project.pbxproj @@ -9,7 +9,6 @@ /* Begin PBXBuildFile section */ 03FC29A292ACC40490383A1F /* Pods_Plugin.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3B2A61DA5A1F2DD4F959604D /* Pods_Plugin.framework */; }; 20C0B05DCFC8E3958A738AF2 /* Pods_PluginTests.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = F6753A823D3815DB436415E3 /* Pods_PluginTests.framework */; }; - 2F98D68224C9AAE500613A4C /* GetFeedbackCapacitor.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2F98D68124C9AAE400613A4C /* GetFeedbackCapacitor.swift */; }; 50ADFF92201F53D600D50D53 /* Plugin.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 50ADFF88201F53D600D50D53 /* Plugin.framework */; }; 50ADFF97201F53D600D50D53 /* GetFeedbackCapacitorTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 50ADFF96201F53D600D50D53 /* GetFeedbackCapacitorTests.swift */; }; 50ADFF99201F53D600D50D53 /* GetFeedbackCapacitorPlugin.h in Headers */ = {isa = PBXBuildFile; fileRef = 50ADFF8B201F53D600D50D53 /* GetFeedbackCapacitorPlugin.h */; settings = {ATTRIBUTES = (Public, ); }; }; @@ -29,7 +28,6 @@ /* End PBXContainerItemProxy section */ /* Begin PBXFileReference section */ - 2F98D68124C9AAE400613A4C /* GetFeedbackCapacitor.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = GetFeedbackCapacitor.swift; sourceTree = ""; }; 3B2A61DA5A1F2DD4F959604D /* Pods_Plugin.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_Plugin.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 50ADFF88201F53D600D50D53 /* Plugin.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Plugin.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 50ADFF8B201F53D600D50D53 /* GetFeedbackCapacitorPlugin.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GetFeedbackCapacitorPlugin.h; sourceTree = ""; }; @@ -93,7 +91,6 @@ isa = PBXGroup; children = ( 50E1A94720377CB70090CE1A /* GetFeedbackCapacitorPlugin.swift */, - 2F98D68124C9AAE400613A4C /* GetFeedbackCapacitor.swift */, 50ADFF8B201F53D600D50D53 /* GetFeedbackCapacitorPlugin.h */, 50ADFFA72020EE4F00D50D53 /* GetFeedbackCapacitorPlugin.m */, 50ADFF8C201F53D600D50D53 /* Info.plist */, @@ -270,7 +267,7 @@ "${PODS_ROOT}/Target Support Files/Pods-PluginTests/Pods-PluginTests-frameworks.sh", "${BUILT_PRODUCTS_DIR}/Capacitor/Capacitor.framework", "${BUILT_PRODUCTS_DIR}/CapacitorCordova/Cordova.framework", - "${PODS_XCFRAMEWORKS_BUILD_DIR}/Usabilla/Usabilla.framework/Usabilla", + "${PODS_ROOT}/Usabilla/Usabilla.framework", ); name = "[CP] Embed Pods Frameworks"; outputPaths = ( @@ -309,7 +306,6 @@ buildActionMask = 2147483647; files = ( 50E1A94820377CB70090CE1A /* GetFeedbackCapacitorPlugin.swift in Sources */, - 2F98D68224C9AAE500613A4C /* GetFeedbackCapacitor.swift in Sources */, 50ADFFA82020EE4F00D50D53 /* GetFeedbackCapacitorPlugin.m in Sources */, ); runOnlyForDeploymentPostprocessing = 0; @@ -471,12 +467,14 @@ DYLIB_INSTALL_NAME_BASE = "@rpath"; INFOPLIST_FILE = Plugin/Info.plist; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; - IPHONEOS_DEPLOYMENT_TARGET = 12.0; + IPHONEOS_DEPLOYMENT_TARGET = 13.0; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks $(FRAMEWORK_SEARCH_PATHS)\n$(FRAMEWORK_SEARCH_PATHS)\n$(FRAMEWORK_SEARCH_PATHS)"; ONLY_ACTIVE_ARCH = YES; PRODUCT_BUNDLE_IDENTIFIER = com.getcapacitor.Plugin; PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)"; SKIP_INSTALL = YES; + SUPPORTS_MACCATALYST = NO; + SUPPORTS_MAC_DESIGNED_FOR_IPHONE_IPAD = NO; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; SWIFT_VERSION = 5.0; TARGETED_DEVICE_FAMILY = "1,2"; @@ -496,12 +494,14 @@ DYLIB_INSTALL_NAME_BASE = "@rpath"; INFOPLIST_FILE = Plugin/Info.plist; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; - IPHONEOS_DEPLOYMENT_TARGET = 12.0; + IPHONEOS_DEPLOYMENT_TARGET = 13.0; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks $(FRAMEWORK_SEARCH_PATHS)"; ONLY_ACTIVE_ARCH = NO; PRODUCT_BUNDLE_IDENTIFIER = com.getcapacitor.Plugin; PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)"; SKIP_INSTALL = YES; + SUPPORTS_MACCATALYST = NO; + SUPPORTS_MAC_DESIGNED_FOR_IPHONE_IPAD = NO; SWIFT_VERSION = 5.0; TARGETED_DEVICE_FAMILY = "1,2"; }; @@ -513,9 +513,12 @@ buildSettings = { CODE_SIGN_STYLE = Automatic; INFOPLIST_FILE = PluginTests/Info.plist; + IPHONEOS_DEPLOYMENT_TARGET = 13.0; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = com.getcapacitor.PluginTests; PRODUCT_NAME = "$(TARGET_NAME)"; + SUPPORTS_MACCATALYST = NO; + SUPPORTS_MAC_DESIGNED_FOR_IPHONE_IPAD = NO; SWIFT_VERSION = 5.0; TARGETED_DEVICE_FAMILY = "1,2"; }; @@ -527,9 +530,12 @@ buildSettings = { CODE_SIGN_STYLE = Automatic; INFOPLIST_FILE = PluginTests/Info.plist; + IPHONEOS_DEPLOYMENT_TARGET = 13.0; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = com.getcapacitor.PluginTests; PRODUCT_NAME = "$(TARGET_NAME)"; + SUPPORTS_MACCATALYST = NO; + SUPPORTS_MAC_DESIGNED_FOR_IPHONE_IPAD = NO; SWIFT_VERSION = 5.0; TARGETED_DEVICE_FAMILY = "1,2"; }; diff --git a/ios/Plugin/GetFeedbackCapacitorPlugin.swift b/ios/Plugin/GetFeedbackCapacitorPlugin.swift index 48838fc..ce0bb08 100644 --- a/ios/Plugin/GetFeedbackCapacitorPlugin.swift +++ b/ios/Plugin/GetFeedbackCapacitorPlugin.swift @@ -24,51 +24,51 @@ public class GetFeedbackCapacitorPlugin: CAPPlugin { let appID = call.getString("appID") ?? "" getfeedback.initialize(appID: appID) } - + @objc func standardEvents(_ call: CAPPluginCall) { self.bridge?.saveCall(call) call.keepAlive = true standardEventsCallID = call.callbackId } - + @objc func loadFeedbackForm(_ call: CAPPluginCall) { let formID = call.getString("formID") ?? "" self.bridge?.saveCall(call) passiveCallID = call.callbackId getfeedback.loadFeedbackForm(formID) } - + @objc func loadFeedbackFormWithCurrentViewScreenshot(_ call: CAPPluginCall) { let formID = call.getString("formID") ?? "" self.bridge?.saveCall(call) passiveCallID = call.callbackId DispatchQueue.main.sync { if let rootVC = UIApplication.shared.windows.first?.rootViewController { - let screenshot = self.takeScreenshot(view: rootVC.view) + let screenshot = self.takeScreenshot(view: rootVC.view) getfeedback.loadFeedbackForm(formID, screenshot: screenshot) - } + } } } - + @objc func preloadFeedbackForms(_ call: CAPPluginCall) { guard let formIDs = call.options["formIDs"] as? [String] else { - call.reject("Must provide formIDs") - return + call.reject("Must provide formIDs") + return } getfeedback.preloadFeedbackForms(withFormIDs: formIDs) } - + @objc func removeCachedForms(_ call: CAPPluginCall) { getfeedback.removeCachedForms() } - + @objc func sendEvent(_ call: CAPPluginCall) { let eventName = call.getString("eventName") ?? "" self.bridge?.saveCall(call) campaignCallID = call.callbackId getfeedback.sendEvent(event: eventName) } - + @objc func setCustomVariables(_ call: CAPPluginCall) { guard let variables = call.options["customVariables"] as? [String: String] else { call.reject("Must provide variables") @@ -77,7 +77,7 @@ public class GetFeedbackCapacitorPlugin: CAPPlugin { } getfeedback.customVariables = variables } - + @objc func setDebugEnabled(_ call: CAPPluginCall) { guard let debugEnabled = call.options["debugEnabled"] as? Bool else { call.reject("Must provide debugEnabled") @@ -85,30 +85,30 @@ public class GetFeedbackCapacitorPlugin: CAPPlugin { } getfeedback.debugEnabled = debugEnabled } - + @objc func loadLocalizedStringFile(_ call: CAPPluginCall) { let localizedStringFile = call.getString("localizedStringFile") ?? "" getfeedback.localizedStringFile = localizedStringFile } - + func takeScreenshot(view: UIView) -> UIImage { return getfeedback.takeScreenshot(view)! } - + @objc func resetCampaignData(_ call: CAPPluginCall) { getfeedback.resetCampaignData { } } @objc func dismiss(_ call: CAPPluginCall) { - let _ = getfeedback.dismiss() + _ = getfeedback.dismiss() } - + @objc func getDefaultDataMasks(_ call: CAPPluginCall) { let str = getfeedback.defaultDataMasks call.resolve(["DEFAULT_DATA_MASKS": str]) } - + @objc func setDataMasking(_ call: CAPPluginCall) { let masks = call.options["masks"] as? [String] ?? getfeedback.defaultDataMasks let maskChar = call.getString("character")?.first ?? "X" @@ -123,39 +123,39 @@ extension GetFeedbackCapacitorPlugin: UsabillaDelegate { rootVC.present(formNavigationController!, animated: true, completion: nil) } } - + public func formDidFailLoading(error: UBError) { formNavigationController = nil - if let callID = passiveCallID, let call = bridge?.savedCall(withID: callID) { + if let callID = passiveCallID, let call = bridge?.savedCall(withID: callID) { call.reject("The form could not be loaded") bridge?.releaseCall(call) } } - + public func formDidClose(formID: String, withFeedbackResults results: [FeedbackResult], isRedirectToAppStoreEnabled: Bool) { - var rnResults: [[String : Any]] = [] - for result in results { - let dictionary: Dictionary = ["rating": result.rating ?? 0, "abandonedPageIndex": result.abandonedPageIndex ?? 0, "sent": result.sent] as [String : Any] - rnResults.append(dictionary) - } - formNavigationController = nil - + var rnResults: [[String: Any]] = [] + for result in results { + let dictionary: Dictionary = ["rating": result.rating ?? 0, "abandonedPageIndex": result.abandonedPageIndex ?? 0, "sent": result.sent] as [String: Any] + rnResults.append(dictionary) + } + formNavigationController = nil + if let callID = passiveCallID, let call = bridge?.savedCall(withID: callID) { call.resolve(["formId": formID, "results": rnResults, "isRedirectToAppStoreEnabled": isRedirectToAppStoreEnabled]) bridge?.releaseCall(call) } } - + public func campaignDidClose(withFeedbackResult result: FeedbackResult, isRedirectToAppStoreEnabled: Bool) { - let rnResult: [String : Any] = ["rating": result.rating ?? 0, "abandonedPageIndex": result.abandonedPageIndex ?? 0, "sent": result.sent] as [String : Any] - formNavigationController = nil - + let rnResult: [String: Any] = ["rating": result.rating ?? 0, "abandonedPageIndex": result.abandonedPageIndex ?? 0, "sent": result.sent] as [String: Any] + formNavigationController = nil + if let callID = campaignCallID, let call = bridge?.savedCall(withID: callID) { call.resolve(["result": rnResult, "isRedirectToAppStoreEnabled": isRedirectToAppStoreEnabled]) bridge?.releaseCall(call) return } - + if let callEventID = standardEventsCallID, let callStandardEvent = bridge?.savedCall(withID: callEventID) { callStandardEvent.resolve(["result": rnResult, "isRedirectToAppStoreEnabled": isRedirectToAppStoreEnabled]) } diff --git a/ios/Podfile b/ios/Podfile index 9121ea2..0af8780 100644 --- a/ios/Podfile +++ b/ios/Podfile @@ -1,4 +1,4 @@ -platform :ios, '12.0' +platform :ios, '13.0' def capacitor_pods # Comment the next line if you're not using Swift and don't want to use dynamic frameworks @@ -15,3 +15,11 @@ end target 'PluginTests' do capacitor_pods end + +post_install do |installer| + installer.pods_project.targets.each do |target| + target.build_configurations.each do |config| + config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '13.0' + end + end +end diff --git a/package-lock.json b/package-lock.json index 0d315ba..ee329b9 100644 --- a/package-lock.json +++ b/package-lock.json @@ -9,10 +9,10 @@ "version": "1.1.0", "license": "MIT", "devDependencies": { - "@capacitor/android": "^3.0.0", - "@capacitor/core": "^3.0.0", + "@capacitor/android": "^4.0.0", + "@capacitor/core": "^4.0.0", "@capacitor/docgen": "^0.0.18", - "@capacitor/ios": "^3.0.0", + "@capacitor/ios": "^4.0.0", "@ionic/eslint-config": "^0.3.0", "@ionic/prettier-config": "^1.0.1", "@ionic/swiftlint-config": "^1.1.2", @@ -133,18 +133,18 @@ } }, "node_modules/@capacitor/android": { - "version": "3.6.0", - "resolved": "https://registry.npmjs.org/@capacitor/android/-/android-3.6.0.tgz", - "integrity": "sha512-X6n0OLy7BE3c6qfVuL7UYyq/aIwEsqIAqtyDOwMdj5k+P1rLQVsGaWERXUtC0BGeoKBD5YgbWiyKwAwg5Spjdg==", + "version": "4.6.2", + "resolved": "https://registry.npmjs.org/@capacitor/android/-/android-4.6.2.tgz", + "integrity": "sha512-PQpOJnMi0i/d4UrT8bPdfkwlKAlQLgsyo2YKj+iUYjEIu8sKQvqDirLYnpeKhj4cflIG2u9mh/eFncooA+u2gw==", "dev": true, "peerDependencies": { - "@capacitor/core": "^3.6.0" + "@capacitor/core": "^4.6.0" } }, "node_modules/@capacitor/core": { - "version": "3.6.0", - "resolved": "https://registry.npmjs.org/@capacitor/core/-/core-3.6.0.tgz", - "integrity": "sha512-F94ozABHXxq1xMcNGMnOVP73WZDWYR1PrJEfVfl9Ja0BXGEJURIxmHBc842OX3rrt3+g0ELHyhX9LTH16eeonw==", + "version": "4.6.2", + "resolved": "https://registry.npmjs.org/@capacitor/core/-/core-4.6.2.tgz", + "integrity": "sha512-M/KpAg+peft/HTb7svLiKHxjbll67ybs1vEqhZuvjXlwro53NxNXR4YJS7+wNXZSiA4Kxjtf+a754xGgZcMarA==", "dev": true, "dependencies": { "tslib": "^2.1.0" @@ -183,12 +183,12 @@ } }, "node_modules/@capacitor/ios": { - "version": "3.6.0", - "resolved": "https://registry.npmjs.org/@capacitor/ios/-/ios-3.6.0.tgz", - "integrity": "sha512-clauOkPj24COpAi1eIHSgi4OENIwuI8P6WKkfn3HVRX2lUPWyxczHTtg64inwECABy3zJdxnnwBHeok3bpoSCg==", + "version": "4.6.2", + "resolved": "https://registry.npmjs.org/@capacitor/ios/-/ios-4.6.2.tgz", + "integrity": "sha512-3hQzbAOk+drCLyFjnytvkc20Mr077/9tQrv6iTghDXESDGR6EgcaYUXzKdVwuJscb0R459+5UQ2mYtkx6ES4TQ==", "dev": true, "peerDependencies": { - "@capacitor/core": "^3.6.0" + "@capacitor/core": "^4.6.0" } }, "node_modules/@colors/colors": { @@ -7978,16 +7978,16 @@ } }, "@capacitor/android": { - "version": "3.6.0", - "resolved": "https://registry.npmjs.org/@capacitor/android/-/android-3.6.0.tgz", - "integrity": "sha512-X6n0OLy7BE3c6qfVuL7UYyq/aIwEsqIAqtyDOwMdj5k+P1rLQVsGaWERXUtC0BGeoKBD5YgbWiyKwAwg5Spjdg==", + "version": "4.6.2", + "resolved": "https://registry.npmjs.org/@capacitor/android/-/android-4.6.2.tgz", + "integrity": "sha512-PQpOJnMi0i/d4UrT8bPdfkwlKAlQLgsyo2YKj+iUYjEIu8sKQvqDirLYnpeKhj4cflIG2u9mh/eFncooA+u2gw==", "dev": true, "requires": {} }, "@capacitor/core": { - "version": "3.6.0", - "resolved": "https://registry.npmjs.org/@capacitor/core/-/core-3.6.0.tgz", - "integrity": "sha512-F94ozABHXxq1xMcNGMnOVP73WZDWYR1PrJEfVfl9Ja0BXGEJURIxmHBc842OX3rrt3+g0ELHyhX9LTH16eeonw==", + "version": "4.6.2", + "resolved": "https://registry.npmjs.org/@capacitor/core/-/core-4.6.2.tgz", + "integrity": "sha512-M/KpAg+peft/HTb7svLiKHxjbll67ybs1vEqhZuvjXlwro53NxNXR4YJS7+wNXZSiA4Kxjtf+a754xGgZcMarA==", "dev": true, "requires": { "tslib": "^2.1.0" @@ -8015,9 +8015,9 @@ } }, "@capacitor/ios": { - "version": "3.6.0", - "resolved": "https://registry.npmjs.org/@capacitor/ios/-/ios-3.6.0.tgz", - "integrity": "sha512-clauOkPj24COpAi1eIHSgi4OENIwuI8P6WKkfn3HVRX2lUPWyxczHTtg64inwECABy3zJdxnnwBHeok3bpoSCg==", + "version": "4.6.2", + "resolved": "https://registry.npmjs.org/@capacitor/ios/-/ios-4.6.2.tgz", + "integrity": "sha512-3hQzbAOk+drCLyFjnytvkc20Mr077/9tQrv6iTghDXESDGR6EgcaYUXzKdVwuJscb0R459+5UQ2mYtkx6ES4TQ==", "dev": true, "requires": {} }, diff --git a/package.json b/package.json index e767621..44aaeef 100644 --- a/package.json +++ b/package.json @@ -48,10 +48,10 @@ "semantic-release": "semantic-release" }, "devDependencies": { - "@capacitor/android": "^3.0.0", - "@capacitor/core": "^3.0.0", + "@capacitor/android": "^4.0.0", + "@capacitor/core": "^4.0.0", "@capacitor/docgen": "^0.0.18", - "@capacitor/ios": "^3.0.0", + "@capacitor/ios": "^4.0.0", "@ionic/eslint-config": "^0.3.0", "@ionic/prettier-config": "^1.0.1", "@ionic/swiftlint-config": "^1.1.2", diff --git a/src/definitions.ts b/src/definitions.ts index d12c10b..8c3282e 100644 --- a/src/definitions.ts +++ b/src/definitions.ts @@ -8,13 +8,15 @@ export interface GetFeedbackCapacitorPlugin { setDebugEnabled(options: { debugEnabled: boolean }): void; setCustomVariables(options: { customVariables: any }): void; loadFeedbackForm(options: { formID: string }): Promise; - loadFeedbackFormWithCurrentViewScreenshot(options: { formID: string }): Promise; + loadFeedbackFormWithCurrentViewScreenshot(options: { + formID: string; + }): Promise; sendEvent(options: { eventName: string }): Promise; resetCampaignData(): void; dismiss(): void; loadLocalizedStringFile(options: { localizedStringFile: string }): void; preloadFeedbackForms(options: { formIDs: string[] }): void; removeCachedForms(): void; - setDataMasking(options?: { masks?: string[], character?: string }): void; + setDataMasking(options?: { masks?: string[]; character?: string }): void; getDefaultDataMasks(): Promise; } diff --git a/src/web.ts b/src/web.ts index ed4a9ad..6b0f585 100644 --- a/src/web.ts +++ b/src/web.ts @@ -1,25 +1,28 @@ import { WebPlugin } from '@capacitor/core'; -import type { GetFeedbackCapacitorPlugin, standardEventsCallback, CallbackID } from './definitions'; +import type { + GetFeedbackCapacitorPlugin, + standardEventsCallback, + CallbackID, +} from './definitions'; export class GetFeedbackCapacitorWeb extends WebPlugin implements GetFeedbackCapacitorPlugin { - initialize(options: { appID: string; }): void { + initialize(options: { appID: string }): void { console.log('initialize', options); throw new Error('Method not implemented.'); } - - async standardEvents(callback: standardEventsCallback, - ): Promise { - console.log("standardEvents", callback); + + async standardEvents(callback: standardEventsCallback): Promise { + console.log('standardEvents', callback); throw new Error('Method not implemented.'); } - loadFeedbackForm(options: { formID: string; }): Promise { + loadFeedbackForm(options: { formID: string }): Promise { console.log('loadFeedbackForm', options); throw new Error('Method not implemented.'); } - sendEvent(options: { eventName: string; }): Promise { + sendEvent(options: { eventName: string }): Promise { console.log('sendEvent', options); throw new Error('Method not implemented.'); } @@ -29,30 +32,32 @@ export class GetFeedbackCapacitorWeb removeCachedForms(): void { throw new Error('Method not implemented.'); } - setDebugEnabled(options: { debugEnabled: boolean; }): void { + setDebugEnabled(options: { debugEnabled: boolean }): void { console.log('setDebugEnabled', options); throw new Error('Method not implemented.'); } - loadLocalizedStringFile(options: { localizedStringFile: string; }): void { + loadLocalizedStringFile(options: { localizedStringFile: string }): void { console.log('loadLocalizedStringFile', options); throw new Error('Method not implemented.'); } - loadFeedbackFormWithCurrentViewScreenshot(options: { formID: string; }): Promise { + loadFeedbackFormWithCurrentViewScreenshot(options: { + formID: string; + }): Promise { console.log('loadFeedbackFormWithCurrentViewScreenshot', options); throw new Error('Method not implemented.'); } - preloadFeedbackForms(options: { formIDs: string[]; }): void { + preloadFeedbackForms(options: { formIDs: string[] }): void { console.log('preloadFeedbackForms', options); throw new Error('Method not implemented.'); } - setCustomVariables(options: { customVariables: any; }): void { + setCustomVariables(options: { customVariables: any }): void { console.log('setCustomVariables', options); throw new Error('Method not implemented.'); } dismiss(): void { throw new Error('Method not implemented.'); } - setDataMasking(options: { masks: string[]; character: string; }): void { + setDataMasking(options: { masks: string[]; character: string }): void { console.log('setDataMasking', options); throw new Error('Method not implemented.'); }