@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.
- package/README.md +3 -3
- package/android/build.gradle +1 -1
- package/android/src/main/java/com/mobilesdk/MobileSdkModule.kt +25 -4
- package/android/src/main/java/com/mobilesdk/MobileSdkPackage.kt +1 -1
- package/android/src/main/java/com/mobilesdk/MobileSdkSurveyModule.kt +296 -0
- package/android/src/main/java/com/mobilesdk/module/TriggerCallback.kt +31 -1
- package/android/src/main/java/com/mobilesdk/survey/MobileSdkSurveyManager.kt +23 -0
- package/android/src/main/java/com/mobilesdk/survey/MobileSdkSurveyWrapper.kt +104 -0
- package/ios/MobileSdk.mm +8 -1
- package/ios/MobileSdk.swift +15 -2
- package/ios/MobileSdkSurvey-Bridging-Header.h +2 -0
- package/ios/MobileSdkSurvey.mm +111 -0
- package/ios/MobileSdkSurvey.swift +274 -0
- package/ios/Mobilesdk.xcodeproj/project.pbxproj +0 -2
- package/ios/Module/MobileTriggerCallback.swift +31 -1
- package/ios/Module/SdkEmitter.swift +1 -1
- package/ios/Podfile +1 -1
- package/ios/Podfile.lock +1 -1
- package/ios/Survey/MobileSdkSurveyManager.swift +21 -0
- package/ios/Survey/MobileSdkSurveyWrapper.swift +79 -0
- package/lib/commonjs/confirmitSdk.js +29 -0
- package/lib/commonjs/confirmitSdk.js.map +1 -0
- package/lib/commonjs/index.js +48 -140
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/models/models.js +24 -0
- package/lib/commonjs/models/models.js.map +1 -1
- package/lib/commonjs/program/triggerCallback.js +9 -21
- package/lib/commonjs/program/triggerCallback.js.map +1 -1
- package/lib/commonjs/serverSdk.js +83 -0
- package/lib/commonjs/serverSdk.js.map +1 -0
- package/lib/commonjs/survey/pageControl.js +72 -0
- package/lib/commonjs/survey/pageControl.js.map +1 -0
- package/lib/commonjs/survey/surveyFrameCallback.js +28 -0
- package/lib/commonjs/survey/surveyFrameCallback.js.map +1 -0
- package/lib/commonjs/surveySdk.js +23 -0
- package/lib/commonjs/surveySdk.js.map +1 -0
- package/lib/commonjs/triggerSdk.js +50 -0
- package/lib/commonjs/triggerSdk.js.map +1 -0
- package/lib/commonjs/views/surveyWebView.js +42 -42
- package/lib/commonjs/views/surveyWebView.js.map +1 -1
- package/lib/module/confirmitSdk.js +23 -0
- package/lib/module/confirmitSdk.js.map +1 -0
- package/lib/module/index.js +7 -113
- package/lib/module/index.js.map +1 -1
- package/lib/module/models/models.js +19 -1
- package/lib/module/models/models.js.map +1 -1
- package/lib/module/program/triggerCallback.js +9 -21
- package/lib/module/program/triggerCallback.js.map +1 -1
- package/lib/module/serverSdk.js +77 -0
- package/lib/module/serverSdk.js.map +1 -0
- package/lib/module/survey/pageControl.js +65 -0
- package/lib/module/survey/pageControl.js.map +1 -0
- package/lib/module/survey/surveyFrameCallback.js +22 -0
- package/lib/module/survey/surveyFrameCallback.js.map +1 -0
- package/lib/module/surveySdk.js +17 -0
- package/lib/module/surveySdk.js.map +1 -0
- package/lib/module/triggerSdk.js +44 -0
- package/lib/module/triggerSdk.js.map +1 -0
- package/lib/module/views/surveyWebView.js +43 -42
- package/lib/module/views/surveyWebView.js.map +1 -1
- package/lib/typescript/confirmitSdk.d.ts +8 -0
- package/lib/typescript/confirmitSdk.d.ts.map +1 -0
- package/lib/typescript/index.d.ts +8 -36
- package/lib/typescript/index.d.ts.map +1 -1
- package/lib/typescript/models/models.d.ts +91 -0
- package/lib/typescript/models/models.d.ts.map +1 -1
- package/lib/typescript/program/triggerCallback.d.ts +5 -13
- package/lib/typescript/program/triggerCallback.d.ts.map +1 -1
- package/lib/typescript/serverSdk.d.ts +24 -0
- package/lib/typescript/serverSdk.d.ts.map +1 -0
- package/lib/typescript/survey/pageControl.d.ts +27 -0
- package/lib/typescript/survey/pageControl.d.ts.map +1 -0
- package/lib/typescript/survey/surveyFrameCallback.d.ts +15 -0
- package/lib/typescript/survey/surveyFrameCallback.d.ts.map +1 -0
- package/lib/typescript/surveySdk.d.ts +10 -0
- package/lib/typescript/surveySdk.d.ts.map +1 -0
- package/lib/typescript/triggerSdk.d.ts +23 -0
- package/lib/typescript/triggerSdk.d.ts.map +1 -0
- package/lib/typescript/views/surveyWebView.d.ts +4 -13
- package/lib/typescript/views/surveyWebView.d.ts.map +1 -1
- package/package.json +4 -3
- package/react-native-mobilesdk.podspec +1 -1
- package/src/confirmitSdk.ts +34 -0
- package/src/index.tsx +45 -152
- package/src/models/models.ts +96 -0
- package/src/program/triggerCallback.ts +10 -27
- package/src/serverSdk.ts +105 -0
- package/src/survey/pageControl.ts +97 -0
- package/src/survey/surveyFrameCallback.ts +28 -0
- package/src/surveySdk.ts +32 -0
- package/src/triggerSdk.ts +62 -0
- 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,aAAa,CAACM,SAAS,GACnCN,aAAa,CAACM,SAAS,GACvB,IAAIC,KAAK,CACL,CAAC,CAAC,EACF;EACIC,GAAGA,CAAA,EAAG;IACF,MAAM,IAAIC,KAAK,CAACP,aAAa,CAAC;EAClC;AACJ,CACJ,CAAC;AAEP,MAAMQ,OAAO,CAAC;EACHC,WAAWA,CAACC,KAAa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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, {
|
|
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 {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
loaded = false;
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
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
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
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
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
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
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
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","
|
|
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,OAAO;AACxC,SAA8BC,kBAAkB,EAAEC,aAAa,EAAEC,QAAQ,QAAQ,cAAc;AAE/F,SAASC,OAAO,QAAQ,sBAAsB;AAC9C,SAASC,YAAY,QAAQ,iBAAiB;AAM9C,MAAMC,UAAU,GAAGJ,aAAa,CAACK,UAAU;AAC3C,MAAMC,qBAAqB,GAAG,IAAIP,kBAAkB,CAACK,UAAU,CAAC;AAEhE,MAAMG,aAAa,GAAIC,KAA0B,IAAK;EAClD,IAAIC,MAAM,GAAG,KAAK;EAElBX,SAAS,CAAC,MAAM;IACZ,MAAMY,SAA8B,GAAGJ,qBAAqB,CAACK,WAAW,CAAC,wBAAwB,EAAEC,cAAc,CAAC;IAElH,OAAO,MAAM;MACTF,SAAS,CAACG,MAAM,CAAC,CAAC;IACtB,CAAC;EACL,CAAC,CAAC;EAEF,MAAMD,cAAc,GAAGA,CAAA,KAAM;IAAA,IAAAE,qBAAA;IACzB,CAAAA,qBAAA,GAAAN,KAAK,CAACI,cAAc,cAAAE,qBAAA,eAApBA,qBAAA,CAAAC,IAAA,CAAAP,KAAuB,CAAC;EAC5B,CAAC;EAED,MAAMQ,SAAS,GAAIC,KAA0B,IAAK;IAAA,IAAAC,gBAAA;IAC9CN,cAAc,CAAC,CAAC;IAChB,CAAAM,gBAAA,GAAAV,KAAK,CAACQ,SAAS,cAAAE,gBAAA,eAAfA,gBAAA,CAAAH,IAAA,CAAAP,KAAK,EAAaS,KAAK,CAAC;EAC5B,CAAC;EAED,MAAME,IAAI,GAAGA,CAAA,KAAM;IACf,IAAI,CAACV,MAAM,EAAE;MACTN,YAAY,CAACiB,aAAa,CAAC,CAAC;MAC5BX,MAAM,GAAG,IAAI;IACjB;EACJ,CAAC;EAED,IAAI;IAAEY;EAAsC,CAAC,GAAGb,KAAK;EAErD,IAAIP,QAAQ,CAACqB,EAAE,KAAK,KAAK,EAAE;IACvBD,qCAAqC,IAAI,0GAA0G;EACvJ;EAEA,oBACIxB,KAAA,CAAA0B,aAAA,CAACrB,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 @@
|
|
|
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
|
|
2
|
-
import
|
|
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,
|
|
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":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EACH,gBAAgB,EAChB,aAAa,EACb,cAAc,EACd,gBAAgB,EAChB,YAAY,EACZ,SAAS,EACT,iBAAiB,EACjB,YAAY,EACZ,eAAe,EACf,YAAY,EACZ,cAAc,EACd,eAAe,EACf,wBAAwB,EACxB,YAAY,EACZ,aAAa,EACb,eAAe,EACf,QAAQ,EACR,cAAc,EACjB,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAC3D,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,kBAAkB,EAAE,MAAM,8BAA8B,CAAC;AAClE,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,aAAa,MAAM,uBAAuB,CAAC;AAElD,YAAY,EACR,iBAAiB,EACjB,YAAY,EACZ,eAAe,EACf,YAAY,EACZ,SAAS,EACT,YAAY,EACZ,cAAc,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;IACd,G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-
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
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
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,
|
|
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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AM,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;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,YAAY,EAAE,MAAM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} 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
|
|
1
|
+
import React from 'react';
|
|
2
2
|
import type { WebViewProps } from 'react-native-webview';
|
|
3
|
-
interface
|
|
3
|
+
interface ISurveyWebViewProps extends WebViewProps {
|
|
4
4
|
onSurveyClosed?: () => void;
|
|
5
5
|
}
|
|
6
|
-
|
|
7
|
-
|
|
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,
|
|
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.
|
|
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.
|
|
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",
|
|
@@ -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();
|