surveysparrow-ionic-plugin 0.0.7 → 0.0.9

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.
@@ -56,7 +56,7 @@ dependencies {
56
56
  testImplementation "junit:junit:$junitVersion"
57
57
 
58
58
 
59
- implementation "com.github.surveysparrow:surveysparrow-android-sdk:0.6.3"
59
+ implementation "com.github.surveysparrow:surveysparrow-android-sdk: 0.6.4-beta.1"
60
60
 
61
61
  androidTestImplementation "androidx.test.ext:junit:$androidxJunitVersion"
62
62
  androidTestImplementation "androidx.test.espresso:espresso-core:$androidxEspressoCoreVersion"
@@ -17,11 +17,11 @@ public class SurveySparrowIonicPlugin implements OnSsValidateSurveyEventListener
17
17
  private static final int SURVEY_REQUEST_CODE = 1;
18
18
  private static final int SURVEY_SCHEDULE_REQUEST_CODE = 2;
19
19
 
20
- public void loadFullScreenSurvey(String domain, String token, HashMap properties, AppCompatActivity activity) {
20
+ public void loadFullScreenSurvey(String domain, String token, CustomParam[] params, HashMap properties, AppCompatActivity activity) {
21
21
  if(activity == null) {
22
22
  throw new RuntimeException("Activity is null. Error fetching activity.");
23
23
  }
24
- CustomParam[] params = new CustomParam[0];
24
+
25
25
  SsSurvey survey = new SsSurvey(domain, token, params, properties);
26
26
  SurveySparrow surveySparrow = new SurveySparrow(activity, survey)
27
27
  .enableBackButton(true)
@@ -22,9 +22,10 @@ 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"));
25
26
  HashMap<String, String> properties = parseProperties(call.getObject("properties"));
26
27
 
27
- implementation.loadFullScreenSurvey(domain, token, properties, this.getActivity());
28
+ implementation.loadFullScreenSurvey(domain, token, params, properties, this.getActivity());
28
29
  call.resolve();
29
30
  }
30
31
 
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; properties: Object; }) => Promise<void>",
10
+ "signature": "(options: { domain: String; token: String; params: Object; properties: Object; }) => Promise<void>",
11
11
  "parameters": [
12
12
  {
13
13
  "name": "options",
14
14
  "docs": "",
15
- "type": "{ domain: String; token: String; properties: Object; }"
15
+ "type": "{ domain: String; token: String; params: Object; properties: Object; }"
16
16
  }
17
17
  ],
18
18
  "returns": "Promise<void>",
@@ -2,6 +2,7 @@ export interface SurveySparrowIonicPluginPlugin {
2
2
  loadFullScreenSurvey(options: {
3
3
  domain: String;
4
4
  token: String;
5
+ params: Object;
5
6
  properties: Object;
6
7
  }): Promise<void>;
7
8
  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 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 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"]}
@@ -4,11 +4,12 @@ import SwiftUI
4
4
 
5
5
  @objc public class SurveySparrowIonicPlugin: NSObject {
6
6
 
7
- @objc public func loadFullScreenSurvey(domain: String, token: String, properties: [String: Any]) {
7
+ @objc public func loadFullScreenSurvey(domain: String, token: String, params: [String: 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
12
13
  ssSurveyViewController.properties = properties
13
14
  ssSurveyViewController.getSurveyLoadedResponse = true
14
15
  ssSurveyViewController.surveyDelegate = SsDelegate()
@@ -17,15 +17,16 @@ 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]
20
21
  let properties = call.getObject("properties")
21
22
 
22
- guard let domain = domain, let token = token, let properties = properties else {
23
+ guard let domain = domain, let token = token, let params = params, let properties = properties else {
23
24
  call.reject("Invalid or missing parameters")
24
25
  return
25
26
  }
26
27
 
27
28
  DispatchQueue.main.async {
28
- self.implementation.loadFullScreenSurvey(domain: domain, token: token, properties: properties)
29
+ self.implementation.loadFullScreenSurvey(domain: domain, token: token, params: params, properties: properties)
29
30
  }
30
31
 
31
32
  }
@@ -31,6 +31,7 @@ class SurveySparrowIonicPluginPluginTests: XCTestCase {
31
31
  mockCall = CAPPluginCall(callbackId: "testCallbackId", options: [
32
32
  "domain": domain,
33
33
  "token": token,
34
+ "params": params,
34
35
  "properties": properties
35
36
  ], success: { result, _ in
36
37
  XCTAssertNotNil(result)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "surveysparrow-ionic-plugin",
3
- "version": "0.0.7",
3
+ "version": "0.0.9",
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",