surveysparrow-ionic-plugin 1.0.4 → 1.0.5-beta.1

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.4-beta.1")
59
+ implementation("com.github.surveysparrow:surveysparrow-android-sdk:0.6.4-beta.2")
60
60
 
61
61
  androidTestImplementation "androidx.test.ext:junit:$androidxJunitVersion"
62
62
  androidTestImplementation "androidx.test.espresso:espresso-core:$androidxEspressoCoreVersion"
@@ -189,18 +189,14 @@ import WebKit
189
189
  }
190
190
 
191
191
  public func userContentController(_ userContentController: WKUserContentController, didReceive message: WKScriptMessage) {
192
- if surveyDelegate != nil {
193
- let response = message.body as! [String: AnyObject]
194
- let responseType = response["type"] as! String
195
- if(responseType == surveyLoaded){
196
- if surveyDelegate != nil {
197
- surveyDelegate.handleSurveyLoaded(response: response)
198
- }
199
- }
200
- if(responseType == surveyCompleted){
201
- if surveyDelegate != nil {
202
- surveyDelegate.handleSurveyResponse(response: response)
203
- }
192
+ if let surveyDelegate = surveyDelegate,
193
+ let response = message.body as? [String: AnyObject],
194
+ let responseType = response["type"] as? String {
195
+
196
+ if responseType == surveyLoaded {
197
+ surveyDelegate.handleSurveyLoaded(response: response)
198
+ } else if responseType == surveyCompleted {
199
+ surveyDelegate.handleSurveyResponse(response: response)
204
200
  }
205
201
  }
206
202
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "surveysparrow-ionic-plugin",
3
- "version": "1.0.4",
3
+ "version": "1.0.5-beta.1",
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",