Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions android/build.gradle
Original file line number Diff line number Diff line change
@@ -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 {
Expand All @@ -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"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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);
}
}
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -167,7 +166,7 @@ public void setCustomVariables(@NotNull PluginCall call) {
JSObject customVars = call.getObject("customVariables");
final HashMap<String, Object> customVariables = new HashMap<>();
if (customVars != null) {
for (Iterator<String> it = customVars.keys(); it.hasNext(); ) {
for (Iterator<String> it = customVars.keys(); it.hasNext();) {
final String key = it.next();
Object value;
try {
Expand Down Expand Up @@ -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");
Expand All @@ -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<String> listMasks = null;
try {
listMasks = masks.toList();
Expand Down Expand Up @@ -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;
}
}
Expand All @@ -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
}
}
}
20 changes: 13 additions & 7 deletions ios/Plugin.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -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, ); }; };
Expand All @@ -29,7 +28,6 @@
/* End PBXContainerItemProxy section */

/* Begin PBXFileReference section */
2F98D68124C9AAE400613A4C /* GetFeedbackCapacitor.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = GetFeedbackCapacitor.swift; sourceTree = "<group>"; };
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 = "<group>"; };
Expand Down Expand Up @@ -93,7 +91,6 @@
isa = PBXGroup;
children = (
50E1A94720377CB70090CE1A /* GetFeedbackCapacitorPlugin.swift */,
2F98D68124C9AAE400613A4C /* GetFeedbackCapacitor.swift */,
50ADFF8B201F53D600D50D53 /* GetFeedbackCapacitorPlugin.h */,
50ADFFA72020EE4F00D50D53 /* GetFeedbackCapacitorPlugin.m */,
50ADFF8C201F53D600D50D53 /* Info.plist */,
Expand Down Expand Up @@ -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 = (
Expand Down Expand Up @@ -309,7 +306,6 @@
buildActionMask = 2147483647;
files = (
50E1A94820377CB70090CE1A /* GetFeedbackCapacitorPlugin.swift in Sources */,
2F98D68224C9AAE500613A4C /* GetFeedbackCapacitor.swift in Sources */,
50ADFFA82020EE4F00D50D53 /* GetFeedbackCapacitorPlugin.m in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
Expand Down Expand Up @@ -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";
Expand All @@ -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";
};
Expand All @@ -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";
};
Expand All @@ -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";
};
Expand Down
Loading