surveysparrow-ionic-plugin 0.0.6 → 0.0.7

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.
@@ -4,7 +4,6 @@ import android.util.Log;
4
4
 
5
5
  import androidx.appcompat.app.AppCompatActivity;
6
6
 
7
- import com.getcapacitor.PluginCall;
8
7
  import com.surveysparrow.ss_android_sdk.OnSsResponseEventListener;
9
8
  import com.surveysparrow.ss_android_sdk.OnSsValidateSurveyEventListener;
10
9
  import com.surveysparrow.ss_android_sdk.SsSurvey;
@@ -18,11 +17,11 @@ public class SurveySparrowIonicPlugin implements OnSsValidateSurveyEventListener
18
17
  private static final int SURVEY_REQUEST_CODE = 1;
19
18
  private static final int SURVEY_SCHEDULE_REQUEST_CODE = 2;
20
19
 
21
- public void loadFullScreenSurvey(String domain, String token, CustomParam[] params, HashMap properties, AppCompatActivity activity) {
20
+ public void loadFullScreenSurvey(String domain, String token, HashMap properties, AppCompatActivity activity) {
22
21
  if(activity == null) {
23
22
  throw new RuntimeException("Activity is null. Error fetching activity.");
24
23
  }
25
-
24
+ CustomParam[] params = new CustomParam[0];
26
25
  SsSurvey survey = new SsSurvey(domain, token, params, properties);
27
26
  SurveySparrow surveySparrow = new SurveySparrow(activity, survey)
28
27
  .enableBackButton(true)
@@ -22,10 +22,9 @@ public class SurveySparrowIonicPluginPlugin extends Plugin {
22
22
  public void loadFullScreenSurvey(PluginCall call) {
23
23
  String domain = call.getString("domain");
24
24
  String token = call.getString("token");
25
- CustomParam[] params = parseParams(call.getObject("params"));
26
25
  HashMap<String, String> properties = parseProperties(call.getObject("properties"));
27
26
 
28
- implementation.loadFullScreenSurvey(domain, token, params, properties, this.getActivity());
27
+ implementation.loadFullScreenSurvey(domain, token, properties, this.getActivity());
29
28
  call.resolve();
30
29
  }
31
30
 
package/dist/docs.json CHANGED
@@ -7,12 +7,12 @@
7
7
  "methods": [
8
8
  {
9
9
  "name": "loadFullScreenSurvey",
10
- "signature": "(options: { domain: String; token: String; params: Object; properties: Object; }) => Promise<void>",
10
+ "signature": "(options: { domain: String; token: String; properties: Object; }) => Promise<void>",
11
11
  "parameters": [
12
12
  {
13
13
  "name": "options",
14
14
  "docs": "",
15
- "type": "{ domain: String; token: String; params: Object; properties: Object; }"
15
+ "type": "{ domain: String; token: String; properties: Object; }"
16
16
  }
17
17
  ],
18
18
  "returns": "Promise<void>",
@@ -2,7 +2,6 @@ export interface SurveySparrowIonicPluginPlugin {
2
2
  loadFullScreenSurvey(options: {
3
3
  domain: String;
4
4
  token: String;
5
- params: Object;
6
5
  properties: Object;
7
6
  }): Promise<void>;
8
7
  loadFullScreenSurveyWithValidation(options: {
@@ -1 +1 @@
1
- {"version":3,"file":"definitions.js","sourceRoot":"","sources":["../../src/definitions.ts"],"names":[],"mappings":"","sourcesContent":["export interface SurveySparrowIonicPluginPlugin {\n \n loadFullScreenSurvey(options: {\n domain: String;\n token: String;\n params: Object;\n properties: Object;\n }): Promise<void>;\n \n loadFullScreenSurveyWithValidation(options: {\n domain: String;\n token: String;\n params: Object;\n properties: Object;\n }): Promise<void>;\n \n}\n"]}
1
+ {"version":3,"file":"definitions.js","sourceRoot":"","sources":["../../src/definitions.ts"],"names":[],"mappings":"","sourcesContent":["export interface SurveySparrowIonicPluginPlugin {\n \n loadFullScreenSurvey(options: {\n domain: String;\n token: String;\n properties: Object;\n }): Promise<void>;\n \n loadFullScreenSurveyWithValidation(options: {\n domain: String;\n token: String;\n params: Object;\n properties: Object;\n }): Promise<void>;\n \n}\n"]}
@@ -4,12 +4,11 @@ import SwiftUI
4
4
 
5
5
  @objc public class SurveySparrowIonicPlugin: NSObject {
6
6
 
7
- @objc public func loadFullScreenSurvey(domain: String, token: String, params: [String: String], properties: [String: Any]) {
7
+ @objc public func loadFullScreenSurvey(domain: String, token: String, properties: [String: Any]) {
8
8
  DispatchQueue.main.async {
9
9
  let ssSurveyViewController = SsSurveyViewController()
10
10
  ssSurveyViewController.domain = domain
11
11
  ssSurveyViewController.token = token
12
- ssSurveyViewController.params = params
13
12
  ssSurveyViewController.properties = properties
14
13
  ssSurveyViewController.getSurveyLoadedResponse = true
15
14
  ssSurveyViewController.surveyDelegate = SsDelegate()
@@ -17,16 +17,15 @@ public class SurveySparrowIonicPluginPlugin: CAPPlugin, CAPBridgedPlugin {
17
17
 
18
18
  let domain = call.getString("domain")
19
19
  let token = call.getString("token")
20
- let params = call.getObject("params") as? [String : String]
21
20
  let properties = call.getObject("properties")
22
21
 
23
- guard let domain = domain, let token = token, let params = params, let properties = properties else {
22
+ guard let domain = domain, let token = token, let properties = properties else {
24
23
  call.reject("Invalid or missing parameters")
25
24
  return
26
25
  }
27
26
 
28
27
  DispatchQueue.main.async {
29
- self.implementation.loadFullScreenSurvey(domain: domain, token: token, params: params, properties: properties)
28
+ self.implementation.loadFullScreenSurvey(domain: domain, token: token, properties: properties)
30
29
  }
31
30
 
32
31
  }
@@ -31,7 +31,6 @@ class SurveySparrowIonicPluginPluginTests: XCTestCase {
31
31
  mockCall = CAPPluginCall(callbackId: "testCallbackId", options: [
32
32
  "domain": domain,
33
33
  "token": token,
34
- "params": params,
35
34
  "properties": properties
36
35
  ], success: { result, _ in
37
36
  XCTAssertNotNil(result)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "surveysparrow-ionic-plugin",
3
- "version": "0.0.6",
3
+ "version": "0.0.7",
4
4
  "description": "SurveySparrow SDK enables you to collect feedback from your mobile app. Embed the Classic, Chat & NPS surveys in your ionic application seamlessly with few lines of code.",
5
5
  "main": "dist/plugin.cjs.js",
6
6
  "module": "dist/esm/index.js",