@forstaglobal/react-native-mobilesdk 3.12.0 → 3.13.0

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.
Files changed (92) hide show
  1. package/README.md +3 -3
  2. package/android/build.gradle +1 -1
  3. package/android/src/main/java/com/mobilesdk/MobileSdkModule.kt +25 -4
  4. package/android/src/main/java/com/mobilesdk/MobileSdkPackage.kt +1 -1
  5. package/android/src/main/java/com/mobilesdk/MobileSdkSurveyModule.kt +296 -0
  6. package/android/src/main/java/com/mobilesdk/module/TriggerCallback.kt +31 -1
  7. package/android/src/main/java/com/mobilesdk/survey/MobileSdkSurveyManager.kt +23 -0
  8. package/android/src/main/java/com/mobilesdk/survey/MobileSdkSurveyWrapper.kt +104 -0
  9. package/ios/MobileSdk.mm +8 -1
  10. package/ios/MobileSdk.swift +15 -2
  11. package/ios/MobileSdkSurvey-Bridging-Header.h +2 -0
  12. package/ios/MobileSdkSurvey.mm +111 -0
  13. package/ios/MobileSdkSurvey.swift +274 -0
  14. package/ios/Mobilesdk.xcodeproj/project.pbxproj +0 -2
  15. package/ios/Module/MobileTriggerCallback.swift +31 -1
  16. package/ios/Module/SdkEmitter.swift +1 -1
  17. package/ios/Podfile +1 -1
  18. package/ios/Podfile.lock +1 -1
  19. package/ios/Survey/MobileSdkSurveyManager.swift +21 -0
  20. package/ios/Survey/MobileSdkSurveyWrapper.swift +79 -0
  21. package/lib/commonjs/confirmitSdk.js +29 -0
  22. package/lib/commonjs/confirmitSdk.js.map +1 -0
  23. package/lib/commonjs/index.js +48 -140
  24. package/lib/commonjs/index.js.map +1 -1
  25. package/lib/commonjs/models/models.js +24 -0
  26. package/lib/commonjs/models/models.js.map +1 -1
  27. package/lib/commonjs/program/triggerCallback.js +9 -21
  28. package/lib/commonjs/program/triggerCallback.js.map +1 -1
  29. package/lib/commonjs/serverSdk.js +83 -0
  30. package/lib/commonjs/serverSdk.js.map +1 -0
  31. package/lib/commonjs/survey/pageControl.js +72 -0
  32. package/lib/commonjs/survey/pageControl.js.map +1 -0
  33. package/lib/commonjs/survey/surveyFrameCallback.js +28 -0
  34. package/lib/commonjs/survey/surveyFrameCallback.js.map +1 -0
  35. package/lib/commonjs/surveySdk.js +23 -0
  36. package/lib/commonjs/surveySdk.js.map +1 -0
  37. package/lib/commonjs/triggerSdk.js +50 -0
  38. package/lib/commonjs/triggerSdk.js.map +1 -0
  39. package/lib/commonjs/views/surveyWebView.js +42 -42
  40. package/lib/commonjs/views/surveyWebView.js.map +1 -1
  41. package/lib/module/confirmitSdk.js +23 -0
  42. package/lib/module/confirmitSdk.js.map +1 -0
  43. package/lib/module/index.js +7 -113
  44. package/lib/module/index.js.map +1 -1
  45. package/lib/module/models/models.js +19 -1
  46. package/lib/module/models/models.js.map +1 -1
  47. package/lib/module/program/triggerCallback.js +9 -21
  48. package/lib/module/program/triggerCallback.js.map +1 -1
  49. package/lib/module/serverSdk.js +77 -0
  50. package/lib/module/serverSdk.js.map +1 -0
  51. package/lib/module/survey/pageControl.js +65 -0
  52. package/lib/module/survey/pageControl.js.map +1 -0
  53. package/lib/module/survey/surveyFrameCallback.js +22 -0
  54. package/lib/module/survey/surveyFrameCallback.js.map +1 -0
  55. package/lib/module/surveySdk.js +17 -0
  56. package/lib/module/surveySdk.js.map +1 -0
  57. package/lib/module/triggerSdk.js +44 -0
  58. package/lib/module/triggerSdk.js.map +1 -0
  59. package/lib/module/views/surveyWebView.js +43 -42
  60. package/lib/module/views/surveyWebView.js.map +1 -1
  61. package/lib/typescript/confirmitSdk.d.ts +8 -0
  62. package/lib/typescript/confirmitSdk.d.ts.map +1 -0
  63. package/lib/typescript/index.d.ts +8 -36
  64. package/lib/typescript/index.d.ts.map +1 -1
  65. package/lib/typescript/models/models.d.ts +91 -0
  66. package/lib/typescript/models/models.d.ts.map +1 -1
  67. package/lib/typescript/program/triggerCallback.d.ts +5 -13
  68. package/lib/typescript/program/triggerCallback.d.ts.map +1 -1
  69. package/lib/typescript/serverSdk.d.ts +24 -0
  70. package/lib/typescript/serverSdk.d.ts.map +1 -0
  71. package/lib/typescript/survey/pageControl.d.ts +27 -0
  72. package/lib/typescript/survey/pageControl.d.ts.map +1 -0
  73. package/lib/typescript/survey/surveyFrameCallback.d.ts +15 -0
  74. package/lib/typescript/survey/surveyFrameCallback.d.ts.map +1 -0
  75. package/lib/typescript/surveySdk.d.ts +10 -0
  76. package/lib/typescript/surveySdk.d.ts.map +1 -0
  77. package/lib/typescript/triggerSdk.d.ts +23 -0
  78. package/lib/typescript/triggerSdk.d.ts.map +1 -0
  79. package/lib/typescript/views/surveyWebView.d.ts +4 -13
  80. package/lib/typescript/views/surveyWebView.d.ts.map +1 -1
  81. package/package.json +4 -3
  82. package/react-native-mobilesdk.podspec +1 -1
  83. package/src/confirmitSdk.ts +34 -0
  84. package/src/index.tsx +45 -152
  85. package/src/models/models.ts +96 -0
  86. package/src/program/triggerCallback.ts +10 -27
  87. package/src/serverSdk.ts +105 -0
  88. package/src/survey/pageControl.ts +97 -0
  89. package/src/survey/surveyFrameCallback.ts +28 -0
  90. package/src/surveySdk.ts +32 -0
  91. package/src/triggerSdk.ts +62 -0
  92. package/src/views/surveyWebView.tsx +46 -44
@@ -0,0 +1 @@
1
+ {"version":3,"names":["NativeModules","Platform","LINKING_ERROR","select","ios","default","MobileSdk","Proxy","get","Error","Manager","notifyEvent","event","notifyAppForeground","data","deleteProgram","serverId","programKey","deleteCustomData","deleteAll","setCallback","removeCallback","triggerDownload","notifyEventWithData","addJourneyLog","addJourneyLogWithServer","TriggerSdk"],"sourceRoot":"../../src","sources":["triggerSdk.ts"],"mappings":"AAAA,SAASA,aAAa,EAAEC,QAAQ,QAAQ,cAAc;AAEtD,MAAMC,aAAa,GACd,kFAAiFD,QAAQ,CAACE,MAAM,CAAC;EAC9FC,GAAG,EAAE,gCAAgC;EACrCC,OAAO,EAAE;AACb,CAAC,CAAE,sDAAqD,GAAG,+BAA+B;AAE9F,MAAMC,SAAS,GAAGN,aAA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H,IAAgC,EAAE;IACnGR,SAAS,CAACmB,uBAAuB,CAACT,QAAQ,EAAEC,UAAU,EAAEH,IAAI,CAAC;EACjE;AACJ;AAEA,OAAO,MAAMY,UAAU,GAAG,IAAIhB,OAAO,CAAC,CAAC","ignoreList":[]}
@@ -1,50 +1,51 @@
1
1
  function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
2
- import React, { Component } from 'react';
2
+ import React, { useEffect } from 'react';
3
3
  import { NativeEventEmitter, NativeModules, Platform } from 'react-native';
4
4
  import { WebView } from 'react-native-webview';
5
- import { injectWebView } from '../index';
6
- export default class SurveyWebView extends Component {
7
- sdkEmitter = NativeModules.SdkEmitter;
8
- triggerManagerEmitter = new NativeEventEmitter(this.sdkEmitter);
9
- loaded = false;
10
- constructor(props) {
11
- super(props);
12
- this.triggerManagerEmitter.addListener('__mobileOnSurveyClosed', this.__onSurveyClosed);
13
- }
14
- __onSurveyClosed = () => {
15
- var _this$props$onSurveyC, _this$props;
16
- (_this$props$onSurveyC = (_this$props = this.props).onSurveyClosed) === null || _this$props$onSurveyC === void 0 || _this$props$onSurveyC.call(_this$props);
5
+ import { ConfirmitSdk } from '../confirmitSdk';
6
+ const sdkEmitter = NativeModules.SdkEmitter;
7
+ const triggerManagerEmitter = new NativeEventEmitter(sdkEmitter);
8
+ const SurveyWebView = props => {
9
+ let loaded = false;
10
+ useEffect(() => {
11
+ const pageReady = triggerManagerEmitter.addListener('__mobileOnSurveyClosed', onSurveyClosed);
12
+ return () => {
13
+ pageReady.remove();
14
+ };
15
+ });
16
+ const onSurveyClosed = () => {
17
+ var _props$onSurveyClosed;
18
+ (_props$onSurveyClosed = props.onSurveyClosed) === null || _props$onSurveyClosed === void 0 || _props$onSurveyClosed.call(props);
17
19
  };
18
- load() {
19
- if (!this.loaded) {
20
- injectWebView();
21
- this.loaded = true;
22
- }
23
- }
24
- onMessage = event => {
25
- var _this$props$onMessage, _this$props2;
26
- this.__onSurveyClosed();
27
- (_this$props$onMessage = (_this$props2 = this.props).onMessage) === null || _this$props$onMessage === void 0 || _this$props$onMessage.call(_this$props2, event);
20
+ const onMessage = event => {
21
+ var _props$onMessage;
22
+ onSurveyClosed();
23
+ (_props$onMessage = props.onMessage) === null || _props$onMessage === void 0 || _props$onMessage.call(props, event);
28
24
  };
29
- render() {
30
- let {
31
- injectedJavaScriptBeforeContentLoaded
32
- } = this.props;
33
- if (Platform.OS === 'ios') {
34
- injectedJavaScriptBeforeContentLoaded += ` \nwindow['mobileBridge'] = { onSurveyEnd: function() { window.ReactNativeWebView?.postMessage(''); } };`;
25
+ const load = () => {
26
+ if (!loaded) {
27
+ ConfirmitSdk.injectWebView();
28
+ loaded = true;
35
29
  }
36
- return /*#__PURE__*/React.createElement(WebView, _extends({
37
- nativeID: 'surveyWebViews'
38
- }, this.props, {
39
- domStorageEnabled: true,
40
- javaScriptEnabled: true,
41
- onLoad: () => {
42
- this.load();
43
- },
44
- injectedJavaScriptForMainFrameOnly: false,
45
- injectedJavaScriptBeforeContentLoaded: injectedJavaScriptBeforeContentLoaded,
46
- onMessage: this.onMessage
47
- }));
30
+ };
31
+ let {
32
+ injectedJavaScriptBeforeContentLoaded
33
+ } = props;
34
+ if (Platform.OS === 'ios') {
35
+ injectedJavaScriptBeforeContentLoaded += " \nwindow['mobileBridge'] = { onSurveyEnd: function() { window.ReactNativeWebView?.postMessage(''); } };";
48
36
  }
49
- }
37
+ return /*#__PURE__*/React.createElement(WebView, _extends({
38
+ nativeID: 'surveyWebViews'
39
+ }, props, {
40
+ domStorageEnabled: true,
41
+ javaScriptEnabled: true,
42
+ onLoad: () => {
43
+ load();
44
+ },
45
+ injectedJavaScriptForMainFrameOnly: false,
46
+ injectedJavaScriptBeforeContentLoaded: injectedJavaScriptBeforeContentLoaded,
47
+ onMessage: onMessage
48
+ }));
49
+ };
50
+ export default SurveyWebView;
50
51
  //# sourceMappingURL=surveyWebView.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["React","Component","NativeEventEmitter","NativeModules","Platform","WebView","injectWebView","SurveyWebView","sdkEmitter","SdkEmitter","triggerManagerEmitter","loaded","constructor","props","addListener","__onSurveyClosed","_this$props$onSurveyC","_this$props","onSurveyClosed","call","load","onMessage","event","_this$props$onMessage","_this$props2","render","injectedJavaScriptBeforeContentLoaded","OS","createElement","_extends","nativeID","domStorageEnabled","javaScriptEnabled","onLoad","injectedJavaScriptForMainFrameOnly"],"sourceRoot":"../../../src","sources":["views/surveyWebView.tsx"],"mappings":";AAAA,OAAOA,KAAK,IAAIC,SAAS,QAAQ,OAAO;AACxC,SAASC,kBAAkB,EAAEC,aAAa,EAAEC,QAAQ,QAAQ,cAAc;AAE1E,SAASC,OAAO,QAAQ,sBAAsB;AAC9C,SAASC,aAAa,QAAQ,UAAU;AAMxC,eAAe,MAAMC,aAAa,SAASN,SAAS,CAAqB;EAC7DO,UAAU,GAAGL,aAAa,CAACM,UAAU;EACrCC,qBAAqB,GAAG,IAAIR,kBAAkB,CAAC,IAAI,CAACM,UAAU,CAAC;EAE/DG,MAAM,GAAG,KAAK;EAEfC,WAAWA,CAACC,KAAyB,EAAE;IAC1C,KAAK,CAACA,KAAK,CAAC;IAEZ,IAAI,CAACH,qBAAqB,CAACI,WAAW,CAAC,wBAAwB,EAAE,IAAI,CAACC,gBAAgB,CAAC;EAC3F;EAEQA,gBAAgB,GAAGA,CAAA,KAAM;IAAA,IAAAC,qBAAA,EAAAC,WAAA;IAC7B,CAAAD,qBAAA,IAAAC,WAAA,OAAI,CAACJ,KAAK,EAACK,cAAc,cAAAF,qBAAA,eAAzBA,qBAAA,CAAAG,IAAA,CAAAF,WAA4B,CAAC;EACjC,CAAC;EAEOG,IAAIA,CAAA,EAAG;IACX,IAAI,CAAC,IAAI,CAACT,MAAM,EAAE;MACdL,aAAa,CAAC,CAAC;MACf,IAAI,CAACK,MAAM,GAAG,IAAI;IACtB;EACJ;EAEQU,SAAS,GAAIC,KAA0B,IAAK;IAAA,IAAAC,qBAAA,EAAAC,YAAA;IAChD,IAAI,CAACT,gBAAgB,CAAC,CAAC;IACvB,CAAAQ,qBAAA,IAAAC,YAAA,OAAI,CAACX,KAAK,EAACQ,SAAS,cAAAE,qBAAA,eAApBA,qBAAA,CAAAJ,IAAA,CAAAK,YAAA,EAAuBF,KAAK,CAAC;EACjC,CAAC;EAEMG,MAAMA,CAAA,EAAG;IACZ,IAAI;MAAEC;IAAsC,CAAC,GAAG,IAAI,CAACb,KAAK;IAE1D,IAAIT,QAAQ,CAACuB,EAAE,KAAK,KAAK,EAAE;MACvBD,qCAAqC,IAAK,0GAAyG;IACvJ;IAEA,oBACI1B,KAAA,CAAA4B,aAAA,CAACvB,OAAO,EAAAwB,QAAA;MACJC,QAAQ,EAAE;IAAiB,GACvB,IAAI,CAACjB,KAAK;MACdkB,iBAAiB,EAAE,IAAK;MACxBC,iBAAiB,EAAE,IAAK;MACxBC,MAAM,EAAEA,CAAA,KAAM;QACV,IAAI,CAACb,IAAI,CAAC,CAAC;MACf,CAAE;MACFc,kCAAkC,EAAE,KAAM;MAC1CR,qCAAqC,EAAEA,qCAAsC;MAC7EL,SAAS,EAAE,IAAI,CAACA;IAAU,EAC7B,CAAC;EAEV;AACJ","ignoreList":[]}
1
+ {"version":3,"names":["React","useEffect","NativeEventEmitter","NativeModules","Platform","WebView","ConfirmitSdk","sdkEmitter","SdkEmitter","triggerManagerEmitter","SurveyWebView","props","loaded","pageReady","addListener","onSurveyClosed","remove","_props$onSurveyClosed","call","onMessage","event","_props$onMessage","load","injectWebView","injectedJavaScriptBeforeContentLoaded","OS","createElement","_extends","nativeID","domStorageEnabled","javaScriptEnabled","onLoad","injectedJavaScriptForMainFrameOnly"],"sourceRoot":"../../../src","sources":["views/surveyWebView.tsx"],"mappings":";AAAA,OAAOA,KAAK,IAAIC,SAAS,QAAQ,OAA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,OAAO,EAAAsB,QAAA;IACJC,QAAQ,EAAE;EAAiB,GACvBjB,KAAK;IACTkB,iBAAiB,EAAE,IAAK;IACxBC,iBAAiB,EAAE,IAAK;IACxBC,MAAM,EAAEA,CAAA,KAAM;MACVT,IAAI,CAAC,CAAC;IACV,CAAE;IACFU,kCAAkC,EAAE,KAAM;IAC1CR,qCAAqC,EAAEA,qCAAsC;IAC7EL,SAAS,EAAEA;EAAU,EACxB,CAAC;AAEV,CAAC;AAED,eAAeT,aAAa","ignoreList":[]}
@@ -0,0 +1,8 @@
1
+ declare class Manager {
2
+ injectWebView(): void;
3
+ initSdk(): Promise<void>;
4
+ enableLog(enable: boolean): void;
5
+ }
6
+ export declare const ConfirmitSdk: Manager;
7
+ export {};
8
+ //# sourceMappingURL=confirmitSdk.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"confirmitSdk.d.ts","sourceRoot":"","sources":["../../src/confirmitSdk.ts"],"names":[],"mappings":"AAmBA,cAAM,OAAO;IACF,aAAa;IAIP,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC;IAI9B,SAAS,CAAC,MAAM,EAAE,OAAO;CAGnC;AAED,eAAO,MAAM,YAAY,SAAgB,CAAC"}
@@ -1,39 +1,11 @@
1
- import type { IScenarioCallback, IServerModel, IWebSurveyModel } from './models/models';
2
- import type { ISdkListener } from './program/triggerCallback';
1
+ import { ConfirmitSdk } from './confirmitSdk';
2
+ import { IDefaultQuestion, IInfoQuestion, IMultiQuestion, INumericQuestion, IPageControl, IQuestion, IScenarioCallback, IServerModel, ISingleQuestion, ISurveyError, ISurveyErrored, ISurveyFinished, ISurveyFrameActionResult, ISurveyModel, ITextQuestion, IWebSurveyModel, NodeType, QuestionAnswer } from './models/models';
3
3
  import { TriggerManager } from './program/triggerCallback';
4
+ import { ServerSdk } from './serverSdk';
5
+ import { SurveyFrameManager } from './survey/surveyFrameCallback';
6
+ import { SurveySdk } from './surveySdk';
7
+ import { TriggerSdk } from './triggerSdk';
4
8
  import SurveyWebView from './views/surveyWebView';
5
- export type { IScenarioCallback, IServerModel, IWebSurveyModel, ISdkListener };
6
- export { SurveyWebView, TriggerManager };
7
- export declare function injectWebView(): void;
8
- export declare function initSdk(): any;
9
- export declare function enableLog(enable: boolean): void;
10
- export declare function notifyEvent(event: string): void;
11
- export declare function notifyAppForeground(data: {
12
- [Name: string]: string;
13
- }): void;
14
- export declare function deleteProgram(serverId: string, programKey: string, deleteCustomData: boolean): Promise<void>;
15
- export declare function deleteAll(deleteCustomData: boolean): Promise<void>;
16
- export declare function setCallback(serverId: string, programKey: string): void;
17
- export declare function removeCallback(serverId: string, programKey: string): void;
18
- export declare function triggerDownload(serverId: string, programKey: string): Promise<boolean>;
19
- export declare function notifyEventWithData(event: string, data: {
20
- [Name: string]: string;
21
- }): void;
22
- export declare function getUs(): Promise<IServerModel>;
23
- export declare function getUk(): Promise<IServerModel>;
24
- export declare function getAustralia(): Promise<IServerModel>;
25
- export declare function getCanada(): Promise<IServerModel>;
26
- export declare function getGermany(): Promise<IServerModel>;
27
- export declare function getHxPlatform(): Promise<IServerModel>;
28
- export declare function getHxAustralia(): Promise<IServerModel>;
29
- export declare function configureUs(clientId: string, clientSecret: string): Promise<void>;
30
- export declare function configureUk(clientId: string, clientSecret: string): Promise<void>;
31
- export declare function configureAustralia(clientId: string, clientSecret: string): Promise<void>;
32
- export declare function configureCanada(clientId: string, clientSecret: string): Promise<void>;
33
- export declare function configureGermany(clientId: string, clientSecret: string): Promise<void>;
34
- export declare function configureHxPlatform(clientId: string, clientSecret: string): Promise<void>;
35
- export declare function configureHxAustralia(clientId: string, clientSecret: string): Promise<void>;
36
- export declare function configureServer(name: string, host: string, clientId: string, clientSecret: string): Promise<IServerModel>;
37
- export declare function getServer(serverId: string): Promise<IServerModel>;
38
- export declare function getServers(): Promise<IServerModel[]>;
9
+ export type { IScenarioCallback, IServerModel, IWebSurveyModel, ISurveyModel, IQuestion, IPageControl, ISurveyErrored, ISurveyFinished, ISurveyError, ISurveyFrameActionResult, IDefaultQuestion, ITextQuestion, INumericQuestion, ISingleQuestion, IMultiQuestion, IInfoQuestion };
10
+ export { SurveyWebView, TriggerManager, SurveyFrameManager, NodeType, QuestionAnswer, ConfirmitSdk, TriggerSdk, ServerSdk, SurveySdk };
39
11
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,iBAAiB,EAAE,YAAY,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AACxF,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AAC9D,OAAO,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAC3D,OAAO,aAAa,MAAM,uBAAuB,CAAC;AAmBlD,YAAY,EAAE,iBAAiB,EAAE,YAAY,EAAE,eAAe,EAAE,YAAY,EAAE,CAAC;AAE/E,OAAO,EAAE,aAAa,EAAE,cAAc,EAAE,CAAC;AAUzC,wBAAgB,aAAa,SAE5B;AAGD,wBAAgB,OAAO,QAEtB;AAED,wBAAgB,SAAS,CAAC,MAAM,EAAE,OAAO,QAExC;AAGD,wBAAgB,WAAW,CAAC,KAAK,EAAE,MAAM,QAExC;AAED,wBAAgB,mBAAmB,CAAC,IAAI,EAAE;IAAE,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAAA;CAAE,QAEnE;AAED,wBAAgB,aAAa,CAAC,QAAQ,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,EAAE,gBAAgB,EAAE,OAAO,GAAG,OAAO,CAAC,IAAI,CAAC,CAE5G;AAED,wBAAgB,SAAS,CAAC,gBAAgB,EAAE,OAAO,GAAG,OAAO,CAAC,IAAI,CAAC,CAElE;AAED,wBAAgB,WAAW,CAAC,QAAQ,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,QAE/D;AAED,wBAAgB,cAAc,CAAC,QAAQ,EAAE,MAAM,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,EACd,eAAe,EACf,YAAY,EACZ,wBAAwB,EACxB,gBAAgB,EAChB,aAAa,EACb,gBAAgB,EAChB,eAAe,EACf,cAAc,EACd,aAAa,EAChB,CAAC;AAEF,OAAO,EAAE,aAAa,EAAE,cAAc,EAAE,kBAAkB,EAAE,QAAQ,EAAE,cAAc,EAAE,YAAY,EAAE,UAAU,EAAE,SAAS,EAAE,SAAS,EAAE,CAAC"}
@@ -7,9 +7,100 @@ export interface IWebSurveyModel {
7
7
  token: string;
8
8
  url: string;
9
9
  }
10
+ export interface ISurveyModel {
11
+ serverId: string;
12
+ programKey: string;
13
+ surveyId: string;
14
+ languageId: number | null;
15
+ customData: {
16
+ [key: string]: string;
17
+ };
18
+ respondentValue: {
19
+ [key: string]: string;
20
+ };
21
+ }
10
22
  export interface IScenarioCallback {
11
23
  serverId: string;
12
24
  programKey: string;
13
25
  error: string;
14
26
  }
27
+ export interface ISurveyFrameActionResult {
28
+ success: string;
29
+ message: string;
30
+ }
31
+ export declare enum NodeType {
32
+ Single = "SINGLE",
33
+ Multi = "MULTI",
34
+ Text = "TEXT",
35
+ Numeric = "NUMERIC",
36
+ Info = "INFO",
37
+ NotSupported = "NOT_SUPPORTED"
38
+ }
39
+ export interface IQuestion {
40
+ id: string;
41
+ nodeType: NodeType;
42
+ }
43
+ export interface IPageControl {
44
+ forwardText: string;
45
+ backwardText: string;
46
+ okText: string;
47
+ showForward: boolean;
48
+ showBackward: boolean;
49
+ serverId: string;
50
+ surveyId: string;
51
+ programKey: string;
52
+ }
53
+ export interface ISurveyErrored extends IPageControl {
54
+ error: ISurveyError;
55
+ values: {
56
+ [key: string]: string;
57
+ };
58
+ }
59
+ export interface ISurveyFinished extends IPageControl {
60
+ values: {
61
+ [key: string]: string;
62
+ };
63
+ }
64
+ export interface ISurveyError {
65
+ message: string;
66
+ stack: string;
67
+ }
68
+ export interface IDefaultQuestion {
69
+ id: string;
70
+ nodeType: NodeType;
71
+ title: string;
72
+ titleSpan: string;
73
+ text: string;
74
+ instruction: string;
75
+ errors: ISurveyError[];
76
+ }
77
+ export interface IInfoQuestion extends IDefaultQuestion {
78
+ }
79
+ export interface ITextQuestion extends IDefaultQuestion {
80
+ }
81
+ export interface INumericQuestion extends IDefaultQuestion {
82
+ }
83
+ export interface ISingleQuestion extends IDefaultQuestion {
84
+ appearance: number;
85
+ answers: QuestionAnswer[];
86
+ }
87
+ export interface IMultiQuestion extends IDefaultQuestion {
88
+ appearance: number;
89
+ answers: QuestionAnswer[];
90
+ }
91
+ export interface QuestionAnswer {
92
+ code: string;
93
+ text: string;
94
+ isHeader: boolean;
95
+ answers: QuestionAnswer[];
96
+ }
97
+ export declare enum SingleAppearance {
98
+ radioButton = 0,
99
+ answerButton = 1,
100
+ dropDown = 2,
101
+ slider = 3,
102
+ horizontalRatingScale = 4,
103
+ startRating = 5,
104
+ gridBars = 6
105
+ }
15
106
  //# sourceMappingURL=models.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"models.d.ts","sourceRoot":"","sources":["../../../src/models/models.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,YAAY;IACzB,QAAQ,EAAE,MAAM,CAAC;IACjB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,eAAe;IAC5B,KAAK,EAAE,MAAM,CAAC;IACd,GAAG,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,iBAAiB;IAC9B,QAAQ,EAAE,MAAM,CAAC;IACjB,UAAU,EAAE,MAAM,CAAC;IACnB,KAAK,EAAE,MAAM,CAAC;CACjB"}
1
+ {"version":3,"file":"models.d.ts","sourceRoot":"","sources":["../../../src/models/models.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,YAAY;IACzB,QAAQ,EAAE,MAAM,CAAC;IACjB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,eAAe;IAC5B,KAAK,EAAE,MAAM,CAAC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,eAAgB,SAAQ,YAAY;IACjD,MAAM,EAAE;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAAA;KAAE,CAAC;CACrC;AAED,MAAM,WAAW,YAAY;IACzB,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,gBAAgB;IAC7B,EAAE,EAAE,MAAM,CAAC;IACX,QAAQ,EAAE,QAAQ,CAAC;IACnB,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,EAAE,MAAM,CAAC;IAClB,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,MAAM,EAAE,YAAY,EAAE,CAAC;CAC1B;AAED,MAAM,WAAW,aAAc,SAAQ,gBAAgB;CAAG;AAE1D,MAAM,WAAW,aAAc,SAAQ,gBAAgB;CAAG;AAE1D,MAAM,WAAW,gBAAiB,SAAQ,gBAAgB;CAAG;AAE7D,MAAM,WAAW,eAAgB,SAAQ,gBAAgB;IACrD,UAAU,EAAE,MAAM,CAAC;IACnB,OAAO,EAAE,cAAc,EAAE,CAAC;CAC7B;AAED,MAAM,WAAW,cAAe,SAAQ,gBAAgB;IACpD,UAAU,EAAE,MAAM,CAAC;IACnB,OAAO,EAAE,cAAc,EAAE,CAAC;CAC7B;AAED,MAAM,WAAW,cAAc;IAC3B,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,OAAO,CAAC;IAClB,OAAO,EAAE,cAAc,EAAE,CAAC;CAC7B;AAED,oBAAY,gBAAgB;IACxB,WAAW,IAAA;IACX,YAAY,IAAA;IACZ,QAAQ,IAAA;IACR,MAAM,IAAA;IACN,qBAAqB,IAAA;IACrB,WAAW,IAAA;IACX,QAAQ,IAAA;CACX"}
@@ -1,19 +1,11 @@
1
- import type { IScenarioCallback, IWebSurveyModel } from '../models/models';
2
- export interface ISdkListener {
3
- onSurveyWebview(model: IWebSurveyModel): void;
4
- onScenarioLoad(model: IScenarioCallback): void;
5
- onScenarioError(model: IScenarioCallback): void;
6
- }
1
+ import { IScenarioCallback, ISurveyModel, IWebSurveyModel } from '../models/models';
7
2
  declare class Manager {
8
- private listener;
9
3
  private sdkEmitter;
10
4
  private triggerManagerEmitter;
11
- constructor();
12
- setSdkListener(callbackListener: ISdkListener): void;
13
- removeSdkListener(): void;
14
- private onWebSurveyStart;
15
- private onScenarioLoad;
16
- private onScenarioError;
5
+ setOnWebSurveyStart(callback: (event: IWebSurveyModel) => void): import("react-native").EmitterSubscription;
6
+ setOnSurveyStart(callback: (event: ISurveyModel) => void): import("react-native").EmitterSubscription;
7
+ setOnScenarioLoad(callback: (event: IScenarioCallback) => void): import("react-native").EmitterSubscription;
8
+ setOnScenarioError(callback: (event: IScenarioCallback) => void): import("react-native").EmitterSubscription;
17
9
  }
18
10
  export declare const TriggerManager: Manager;
19
11
  export {};
@@ -1 +1 @@
1
- {"version":3,"file":"triggerCallback.d.ts","sourceRoot":"","sources":["../../../src/program/triggerCallback.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,iBAAiB,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AAE3E,MAAM,WAAW,YAAY;IACzB,eAAe,CAAC,KAAK,EAAE,eAAe,GAAG,IAAI,CAAC;IAC9C,cAAc,CAAC,KAAK,EAAE,iBAAiB,GAAG,IAAI,CAAC;IAC/C,eAAe,CAAC,KAAK,EAAE,iBAAiB,GAAG,IAAI,CAAC;CACnD;AAED,cAAM,OAAO;IACT,OAAO,CAAC,QAAQ,CAA6B;IAC7C,OAAO,CAAC,UAAU,CAA4B;IAC9C,OAAO,CAAC,qBAAqB,CAA2C;;IAQjE,cAAc,CAAC,gBAAgB,EAAE,YAAY;IAI7C,iBAAiB;IAIxB,OAAO,CAAC,gBAAgB,CAEtB;IAEF,OAAO,CAAC,cAAc,CAEpB;IAEF,OAAO,CAAC,eAAe,CAErB;CACL;AAED,eAAO,MAAM,cAAc,SAAgB,CAAC"}
1
+ {"version":3,"file":"triggerCallback.d.ts","sourceRoot":"","sources":["../../../src/program/triggerCallback.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,iBAAiB,EAAE,YAAY,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AAEpF,cAAM,OAAO;IACT,OAAO,CAAC,UAAU,CAA4B;IAC9C,OAAO,CAAC,qBAAqB,CAA2C;IAEjE,mBAAmB,CAAC,QAAQ,EAAE,CAAC,KAAK,EAAE,eAAe,KAAK,IAAI;IAI9D,gBAAgB,CAAC,QAAQ,EAAE,CAAC,KAAK,EAAE,YAAY,KAAK,IAAI;IAIxD,iBAAiB,CAAC,QAAQ,EAAE,CAAC,KAAK,EAAE,iBAAiB,KAAK,IAAI;IAI9D,kBAAkB,CAAC,QAAQ,EAAE,CAAC,KAAK,EAAE,iBAAiB,KAAK,IAAI;CAGzE;AAED,eAAO,MAAM,cAAc,SAAgB,CAAC"}
@@ -0,0 +1,24 @@
1
+ import { IServerModel } from './models/models';
2
+ declare class Manager {
3
+ getUs(): Promise<IServerModel>;
4
+ getUk(): Promise<IServerModel>;
5
+ getAustralia(): Promise<IServerModel>;
6
+ getCanada(): Promise<IServerModel>;
7
+ getGermany(): Promise<IServerModel>;
8
+ getHxPlatform(): Promise<IServerModel>;
9
+ getHxAustralia(): Promise<IServerModel>;
10
+ configureUs(clientId: string, clientSecret: string): Promise<void>;
11
+ configureUk(clientId: string, clientSecret: string): Promise<void>;
12
+ configureAustralia(clientId: string, clientSecret: string): Promise<void>;
13
+ configureCanada(clientId: string, clientSecret: string): Promise<void>;
14
+ configureGermany(clientId: string, clientSecret: string): Promise<void>;
15
+ configureHxPlatform(clientId: string, clientSecret: string): Promise<void>;
16
+ configureHxAustralia(clientId: string, clientSecret: string): Promise<void>;
17
+ configureServer(name: string, host: string, clientId: string, clientSecret: string): Promise<IServerModel>;
18
+ getServer(serverId: string): Promise<IServerModel>;
19
+ getServers(): Promise<IServerModel[]>;
20
+ private transformServer;
21
+ }
22
+ export declare const ServerSdk: Manager;
23
+ export {};
24
+ //# sourceMappingURL=serverSdk.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"serverSdk.d.ts","sourceRoot":"","sources":["../../src/serverSdk.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAmB/C,cAAM,OAAO;IACI,KAAK,IAAI,OAAO,CAAC,YAAY,CAAC;IAI9B,KAAK,IAAI,OAAO,CAAC,YAAY,CAAC;IAI9B,YAAY,IAAI,OAAO,CAAC,YAAY,CAAC;IAIrC,SAAS,IAAI,OAAO,CAAC,YAAY,CAAC;IAIlC,UAAU,IAAI,OAAO,CAAC,YAAY,CAAC;IAInC,aAAa,IAAI,OAAO,CAAC,YAAY,CAAC;IAItC,cAAc,IAAI,OAAO,CAAC,YAAY,CAAC;IAIvC,WAAW,CAAC,QAAQ,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAIlE,WAAW,CAAC,QAAQ,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAIlE,kBAAkB,CAAC,QAAQ,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAIzE,eAAe,CAAC,QAAQ,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAItE,gBAAgB,CAAC,QAAQ,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAIvE,mBAAmB,CAAC,QAAQ,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAI1E,oBAAoB,CAAC,QAAQ,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAI3E,eAAe,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,GAAG,OAAO,CAAC,YAAY,CAAC;IAI1G,SAAS,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,YAAY,CAAC;IAIlD,UAAU,IAAI,OAAO,CAAC,YAAY,EAAE,CAAC;IAUlD,OAAO,CAAC,eAAe;CAO1B;AAED,eAAO,MAAM,SAAS,SAAgB,CAAC"}
@@ -0,0 +1,27 @@
1
+ import { IDefaultQuestion, IPageControl, ISurveyFrameActionResult, QuestionAnswer } from 'react-native-mobilesdk';
2
+ export declare class PageControl {
3
+ forwardText: string;
4
+ backwardText: string;
5
+ showForward: boolean;
6
+ showBackward: boolean;
7
+ okText: string;
8
+ serverId: string;
9
+ programKey: string;
10
+ surveyId: string;
11
+ constructor(page: IPageControl);
12
+ getQuestion(): Promise<IDefaultQuestion[]>;
13
+ getMulti(questionId: string): Promise<QuestionAnswer[]>;
14
+ setMulti(questionId: string, code: string, selected: boolean): Promise<any>;
15
+ getSingle(questionId: string): Promise<QuestionAnswer>;
16
+ setSingle(questionId: string, code: string): Promise<void>;
17
+ getText(questionId: string): Promise<string>;
18
+ setText(questionId: string, value: string): Promise<void>;
19
+ getNumeric(questionId: string): Promise<string>;
20
+ setNumeric(questionId: string, value: number, isDouble: boolean): Promise<void>;
21
+ next(): Promise<ISurveyFrameActionResult>;
22
+ back(): Promise<ISurveyFrameActionResult>;
23
+ quit(upload: boolean): Promise<ISurveyFrameActionResult>;
24
+ title(): Promise<string>;
25
+ text(): Promise<string>;
26
+ }
27
+ //# sourceMappingURL=pageControl.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pageControl.d.ts","sourceRoot":"","sources":["../../../src/survey/pageControl.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,gBAAgB,EAAE,YAAY,EAAE,wBAAwB,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAmBlH,qBAAa,WAAW;I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C"}
@@ -0,0 +1,15 @@
1
+ import { PageControl } from './pageControl';
2
+ import { ISurveyErrored, ISurveyFinished } from '../models/models';
3
+ declare class Manager {
4
+ private sdkEmitter;
5
+ private triggerManagerEmitter;
6
+ setOnSurveyPageReady(callback: (event: PageControl) => void): import("react-native").EmitterSubscription;
7
+ setOnSurveyErrored(callback: (event: ISurveyErrored) => void): import("react-native").EmitterSubscription;
8
+ setOnSurveyFinished(callback: (event: ISurveyFinished) => void): import("react-native").EmitterSubscription;
9
+ setOnSurveyQuit(callback: (values: {
10
+ [key: string]: string;
11
+ }) => void): import("react-native").EmitterSubscription;
12
+ }
13
+ export declare const SurveyFrameManager: Manager;
14
+ export {};
15
+ //# sourceMappingURL=surveyFrameCallback.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"surveyFrameCallback.d.ts","sourceRoot":"","sources":["../../../src/survey/surveyFrameCallback.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAgB,cAAc,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AAEjF,cAAM,OAAO;IACT,OAAO,CAAC,UAAU,CAA4B;IAC9C,OAAO,CAAC,qBAAqB,CAA2C;IAEjE,oBAAoB,CAAC,QAAQ,EAAE,CAAC,KAAK,EAAE,WAAW,KAAK,IAAI;IAM3D,kBAAkB,CAAC,QAAQ,EAAE,CAAC,KAAK,EAAE,cAAc,KAAK,IAAI;IAI5D,mBAAmB,CAAC,QAAQ,EAAE,CAAC,KAAK,EAAE,eAAe,KAAK,IAAI;IAI9D,eAAe,CAAC,QAAQ,EAAE,CAAC,MAAM,EAAE;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAAA;KAAE,KAAK,IAAI;CAG/E;AAED,eAAO,MAAM,kBAAkB,SAAgB,CAAC"}
@@ -0,0 +1,10 @@
1
+ declare class Manager {
2
+ startSurvey(serverId: string, programKey: string, surveyId: string, data: {
3
+ [Name: string]: string;
4
+ }, respondentValues: {
5
+ [Name: string]: string;
6
+ }): Promise<void>;
7
+ }
8
+ export declare const SurveySdk: Manager;
9
+ export {};
10
+ //# sourceMappingURL=surveySdk.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"surveySdk.d.ts","sourceRoot":"","sources":["../../src/surveySdk.ts"],"names":[],"mappings":"AAmBA,cAAM,OAAO;IACI,WAAW,CACpB,QAAQ,EAAE,MAAM,EAChB,UAAU,EAAE,MAAM,EAClB,QAAQ,EAAE,MAAM,EAChB,IAAI,EAAE;QAAE,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAAA;KAAE,EAChC,gBAAgB,EAAE;QAAE,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAAA;KAAE,GAC7C,OAAO,CAAC,IAAI,CAAC;CAGnB;AAED,eAAO,MAAM,SAAS,SAAgB,CAAC"}
@@ -0,0 +1,23 @@
1
+ declare class Manager {
2
+ notifyEvent(event: string): void;
3
+ notifyAppForeground(data: {
4
+ [Name: string]: string;
5
+ }): void;
6
+ deleteProgram(serverId: string, programKey: string, deleteCustomData: boolean): Promise<void>;
7
+ deleteAll(deleteCustomData: boolean): Promise<void>;
8
+ setCallback(serverId: string, programKey: string): void;
9
+ removeCallback(serverId: string, programKey: string): void;
10
+ triggerDownload(serverId: string, programKey: string): Promise<boolean>;
11
+ notifyEventWithData(event: string, data: {
12
+ [Name: string]: string;
13
+ }): void;
14
+ addJourneyLog(data: {
15
+ [Name: string]: string;
16
+ }): void;
17
+ addJourneyLogWithServer(serverId: string, programKey: string, data: {
18
+ [Name: string]: string;
19
+ }): void;
20
+ }
21
+ export declare const TriggerSdk: Manager;
22
+ export {};
23
+ //# sourceMappingURL=triggerSdk.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"triggerSdk.d.ts","sourceRoot":"","sources":["../../src/triggerSdk.ts"],"names":[],"mappings":"AAmBA,cAAM,OAAO;IACF,WAAW,CAAC,KAAK,EAAE,MAAM;IAIzB,mBAAmB,CAAC,IAAI,EAAE;QAAE,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAAA;KAAE;IAI9C,aAAa,CAAC,QAAQ,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,EAAE,gBAAgB,EAAE,OAAO,GAAG,OAAO,CAAC,IAAI,CAAC;IAI7F,SAAS,CAAC,gBAAgB,EAAE,OAAO,GAAG,OAAO,CAAC,IAAI,CAAC;IAIzD,WAAW,CAAC,QAAQ,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM;IAIhD,cAAc,CAAC,QAAQ,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM;IAI7C,eAAe,CAAC,QAAQ,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;IAI7E,mBAAmB,CAAC,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE;QAAE,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAAA;KAAE;IAInE,aAAa,CAAC,IAAI,EAAE;QAAE,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAAA;KAAE;IAI9C,uBAAuB,CAAC,QAAQ,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,EAAE,IAAI,EAAE;QAAE,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAAA;KAAE;CAGxG;AAED,eAAO,MAAM,UAAU,SAAgB,CAAC"}
@@ -1,17 +1,8 @@
1
- import React, { Component } from 'react';
1
+ import React from 'react';
2
2
  import type { WebViewProps } from 'react-native-webview';
3
- interface SurveyWebViewProps extends WebViewProps {
3
+ interface ISurveyWebViewProps extends WebViewProps {
4
4
  onSurveyClosed?: () => void;
5
5
  }
6
- export default class SurveyWebView extends Component<SurveyWebViewProps> {
7
- private sdkEmitter;
8
- private triggerManagerEmitter;
9
- private loaded;
10
- constructor(props: SurveyWebViewProps);
11
- private __onSurveyClosed;
12
- private load;
13
- private onMessage;
14
- render(): React.JSX.Element;
15
- }
16
- export {};
6
+ declare const SurveyWebView: (props: ISurveyWebViewProps) => React.JSX.Element;
7
+ export default SurveyWebView;
17
8
  //# sourceMappingURL=surveyWebView.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"surveyWebView.d.ts","sourceRoot":"","sources":["../../../src/views/surveyWebView.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEzC,OAAO,KAAK,EAAuB,YAAY,EAAE,MAAM,sBAAsB,CAAC;AAI9E,UAAU,kBAAmB,SAAQ,YAAY;IAC7C,cAAc,CAAC,EAAE,MAAM,IAAI,CAAC;CAC/B;AAED,MAAM,CAAC,OAAO,OAAO,aAAc,SAAQ,SAAS,CAAC,kBAAkB,CAAC;IACpE,OAAO,CAAC,UAAU,CAA4B;IAC9C,OAAO,CAAC,qBAAqB,CAA2C;IAExE,OAAO,CAAC,MAAM,CAAS;gBAEJ,KAAK,EAAE,kBAAkB;IAM5C,OAAO,CAAC,gBAAgB,CAEtB;IAEF,OAAO,CAAC,IAAI;IAOZ,OAAO,CAAC,SAAS,CAGf;IAEK,MAAM;CAsBhB"}
1
+ {"version":3,"file":"surveyWebView.d.ts","sourceRoot":"","sources":["../../../src/views/surveyWebView.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAoB,MAAM,OAAO,CAAC;AAEzC,OAAO,KAAK,EAAuB,YAAY,EAAE,MAAM,sBAAsB,CAAC;AAI9E,UAAU,mBAAoB,SAAQ,YAAY;IAC9C,cAAc,CAAC,EAAE,MAAM,IAAI,CAAC;CAC/B;AAKD,QAAA,MAAM,aAAa,UAAW,mBAAmB,sBA+ChD,CAAC;AAEF,eAAe,aAAa,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@forstaglobal/react-native-mobilesdk",
3
- "version": "3.12.0",
3
+ "version": "3.13.0",
4
4
  "description": "The Forsta Digital Feedback Mobile SDK provides seamless in-app feedback for any touch point within your mobile application.",
5
5
  "main": "lib/commonjs/index",
6
6
  "module": "lib/module/index",
@@ -53,13 +53,13 @@
53
53
  "devDependencies": {
54
54
  "@babel/core": "^7.23.6",
55
55
  "@babel/eslint-parser": "^7.23.3",
56
- "@react-native/babel-preset": "0.74.83",
57
56
  "@commitlint/config-conventional": "^17.0.2",
58
57
  "@evilmartians/lefthook": "^1.2.2",
59
58
  "@react-native-community/eslint-config": "^3.2.0",
59
+ "@react-native/babel-preset": "0.74.83",
60
60
  "@release-it/conventional-changelog": "^5.0.0",
61
61
  "@types/jest": "^28.1.2",
62
- "@types/react": "^18.2.6",
62
+ "@types/react": "^18.3.3",
63
63
  "@types/react-native": "0.70.0",
64
64
  "commitlint": "^17.0.2",
65
65
  "del-cli": "^5.0.0",
@@ -69,6 +69,7 @@
69
69
  "eslint-plugin-import": "2.27.5",
70
70
  "eslint-plugin-prettier": "4.2.1",
71
71
  "jest": "^29.6.3",
72
+ "metro-react-native-babel-preset": "^0.77.0",
72
73
  "pod-install": "^0.1.0",
73
74
  "prettier": "2.8.8",
74
75
  "react": "18.2.0",
@@ -39,5 +39,5 @@ Pod::Spec.new do |s|
39
39
  end
40
40
  end
41
41
 
42
- s.dependency "ConfirmitMobileSDK", "3.12.0"
42
+ s.dependency "ConfirmitMobileSDK", "3.13.0"
43
43
  end
@@ -0,0 +1,34 @@
1
+ import { NativeModules, Platform } from 'react-native';
2
+
3
+ const LINKING_ERROR =
4
+ `The package 'react-native-mobilesdk' doesn't seem to be linked. Make sure: \n\n${Platform.select({
5
+ ios: "- You have run 'pod install'\n",
6
+ default: ''
7
+ })}- You rebuilt the app after installing the package\n` + '- You are not using Expo Go\n';
8
+
9
+ const MobileSdk = NativeModules.MobileSdk
10
+ ? NativeModules.MobileSdk
11
+ : new Proxy(
12
+ {},
13
+ {
14
+ get() {
15
+ throw new Error(LINKING_ERROR);
16
+ }
17
+ }
18
+ );
19
+
20
+ class Manager {
21
+ public injectWebView() {
22
+ MobileSdk.injectWebView();
23
+ }
24
+
25
+ public async initSdk(): Promise<void> {
26
+ return MobileSdk.initSdk();
27
+ }
28
+
29
+ public enableLog(enable: boolean) {
30
+ MobileSdk.enableLog(enable);
31
+ }
32
+ }
33
+
34
+ export const ConfirmitSdk = new Manager();