@screeb/react-native 0.8.16 → 0.8.17

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.
@@ -8,7 +8,7 @@ buildscript {
8
8
  }
9
9
 
10
10
  dependencies {
11
- classpath 'com.android.tools.build:gradle:7.3.1'
11
+ classpath 'com.android.tools.build:gradle:7.4.2'
12
12
  // noinspection DifferentKotlinGradleVersion
13
13
  classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
14
14
  }
@@ -123,6 +123,6 @@ def kotlin_version = getExtOrDefault('kotlinVersion')
123
123
  dependencies {
124
124
  // noinspection GradleDynamicVersion
125
125
  api 'com.facebook.react:react-native:+'
126
- implementation "app.screeb.sdk:survey:1.13.1"
126
+ implementation "app.screeb.sdk:survey:1.13.2"
127
127
  implementation "org.jetbrains.kotlin:kotlin-stdlib:1.7.0"
128
128
  }
@@ -1,5 +1,5 @@
1
1
  distributionBase=GRADLE_USER_HOME
2
2
  distributionPath=wrapper/dists
3
- distributionUrl=https\://services.gradle.org/distributions/gradle-7.2-bin.zip
3
+ distributionUrl=https\://services.gradle.org/distributions/gradle-7.6-bin.zip
4
4
  zipStoreBase=GRADLE_USER_HOME
5
5
  zipStorePath=wrapper/dists
@@ -1,48 +1,68 @@
1
1
  "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.closeSdk = exports.resetIdentity = exports.debugTargeting = exports.debug = exports.startSurvey = exports.trackScreen = exports.trackEvent = exports.unassignGroup = exports.assignGroup = exports.setProperties = exports.setIdentity = exports.initSdk = void 0;
4
+ const react_native_1 = require("react-native");
5
+ const LINKING_ERROR = `The package '@screeb/react-native' doesn't seem to be linked. Make sure: \n\n` +
6
+ react_native_1.Platform.select({ ios: "- You have run 'pod install'\n", default: '' }) +
7
+ '- You rebuilt the app after installing the package\n' +
8
+ '- You are not using Expo managed workflow\n';
9
+ const ScreebModule = react_native_1.NativeModules.ScreebModule
10
+ ? react_native_1.NativeModules.ScreebModule
11
+ : new Proxy({}, {
12
+ get() {
13
+ throw new Error(LINKING_ERROR);
14
+ },
15
+ });
16
+ function initSdk(androidChannelId, iosChannelId, userId, properties) {
17
+ if (react_native_1.Platform.OS === 'ios') {
18
+ return ScreebModule.initSdk(iosChannelId, userId, properties);
19
+ }
20
+ else {
21
+ return ScreebModule.initSdk(androidChannelId, userId, properties);
22
+ }
23
+ }
6
24
  exports.initSdk = initSdk;
25
+ function setIdentity(userId, properties) {
26
+ return ScreebModule.setIdentity(userId, properties);
27
+ }
7
28
  exports.setIdentity = setIdentity;
29
+ function setProperties(properties) {
30
+ return ScreebModule.setProperties(properties);
31
+ }
8
32
  exports.setProperties = setProperties;
9
- exports.trackEvent = trackEvent;
10
- exports.trackScreen = trackScreen;
11
-
12
- var _reactNative = require("react-native");
13
-
14
- const LINKING_ERROR = `The package '@screeb/react-native' doesn't seem to be linked. Make sure: \n\n` + _reactNative.Platform.select({
15
- ios: "- You have run 'pod install'\n",
16
- default: ''
17
- }) + '- You rebuilt the app after installing the package\n' + '- You are not using Expo managed workflow\n';
18
- const ScreebModule = _reactNative.NativeModules.ScreebModule ? _reactNative.NativeModules.ScreebModule : new Proxy({}, {
19
- get() {
20
- throw new Error(LINKING_ERROR);
21
- }
22
-
23
- });
24
-
25
- function initSdk(androidChannelId, iosChannelId, userId, properties) {
26
- if (_reactNative.Platform.OS === 'ios') {
27
- return ScreebModule.initSdk(iosChannelId, userId, properties);
28
- } else {
29
- return ScreebModule.initSdk(androidChannelId, userId, properties);
30
- }
33
+ function assignGroup(type, name, properties) {
34
+ return ScreebModule.assignGroup(type, name, properties);
31
35
  }
32
-
33
- function setIdentity(userId, properties) {
34
- return ScreebModule.setIdentity(userId, properties);
36
+ exports.assignGroup = assignGroup;
37
+ function unassignGroup(type, name, properties) {
38
+ return ScreebModule.unassignGroup(type, name, properties);
35
39
  }
36
-
40
+ exports.unassignGroup = unassignGroup;
37
41
  function trackEvent(name, properties) {
38
- return ScreebModule.trackEvent(name, properties);
42
+ return ScreebModule.trackEvent(name, properties);
39
43
  }
40
-
44
+ exports.trackEvent = trackEvent;
41
45
  function trackScreen(name, properties) {
42
- return ScreebModule.trackScreen(name, properties);
46
+ return ScreebModule.trackScreen(name, properties);
43
47
  }
44
-
45
- function setProperties(properties) {
46
- return ScreebModule.setProperties(properties);
48
+ exports.trackScreen = trackScreen;
49
+ function startSurvey(surveyId, allowMultipleResponses, hiddenFields, ignoreSurveyStatus) {
50
+ return ScreebModule.startSurvey(surveyId, allowMultipleResponses ?? true, hiddenFields, ignoreSurveyStatus ?? true);
51
+ }
52
+ exports.startSurvey = startSurvey;
53
+ function debug() {
54
+ return ScreebModule.debug();
55
+ }
56
+ exports.debug = debug;
57
+ function debugTargeting() {
58
+ return ScreebModule.debugTargeting();
59
+ }
60
+ exports.debugTargeting = debugTargeting;
61
+ function resetIdentity() {
62
+ return ScreebModule.resetIdentity();
63
+ }
64
+ exports.resetIdentity = resetIdentity;
65
+ function closeSdk() {
66
+ return ScreebModule.closeSdk();
47
67
  }
48
- //# sourceMappingURL=index.js.map
68
+ exports.closeSdk = closeSdk;
@@ -1,31 +1,53 @@
1
1
  import { NativeModules, Platform } from 'react-native';
2
- const LINKING_ERROR = `The package '@screeb/react-native' doesn't seem to be linked. Make sure: \n\n` + Platform.select({
3
- ios: "- You have run 'pod install'\n",
4
- default: ''
5
- }) + '- You rebuilt the app after installing the package\n' + '- You are not using Expo managed workflow\n';
6
- const ScreebModule = NativeModules.ScreebModule ? NativeModules.ScreebModule : new Proxy({}, {
7
- get() {
8
- throw new Error(LINKING_ERROR);
9
- }
10
-
11
- });
2
+ const LINKING_ERROR = `The package '@screeb/react-native' doesn't seem to be linked. Make sure: \n\n` +
3
+ Platform.select({ ios: "- You have run 'pod install'\n", default: '' }) +
4
+ '- You rebuilt the app after installing the package\n' +
5
+ '- You are not using Expo managed workflow\n';
6
+ const ScreebModule = NativeModules.ScreebModule
7
+ ? NativeModules.ScreebModule
8
+ : new Proxy({}, {
9
+ get() {
10
+ throw new Error(LINKING_ERROR);
11
+ },
12
+ });
12
13
  export function initSdk(androidChannelId, iosChannelId, userId, properties) {
13
- if (Platform.OS === 'ios') {
14
- return ScreebModule.initSdk(iosChannelId, userId, properties);
15
- } else {
16
- return ScreebModule.initSdk(androidChannelId, userId, properties);
17
- }
14
+ if (Platform.OS === 'ios') {
15
+ return ScreebModule.initSdk(iosChannelId, userId, properties);
16
+ }
17
+ else {
18
+ return ScreebModule.initSdk(androidChannelId, userId, properties);
19
+ }
18
20
  }
19
21
  export function setIdentity(userId, properties) {
20
- return ScreebModule.setIdentity(userId, properties);
22
+ return ScreebModule.setIdentity(userId, properties);
23
+ }
24
+ export function setProperties(properties) {
25
+ return ScreebModule.setProperties(properties);
26
+ }
27
+ export function assignGroup(type, name, properties) {
28
+ return ScreebModule.assignGroup(type, name, properties);
29
+ }
30
+ export function unassignGroup(type, name, properties) {
31
+ return ScreebModule.unassignGroup(type, name, properties);
21
32
  }
22
33
  export function trackEvent(name, properties) {
23
- return ScreebModule.trackEvent(name, properties);
34
+ return ScreebModule.trackEvent(name, properties);
24
35
  }
25
36
  export function trackScreen(name, properties) {
26
- return ScreebModule.trackScreen(name, properties);
37
+ return ScreebModule.trackScreen(name, properties);
27
38
  }
28
- export function setProperties(properties) {
29
- return ScreebModule.setProperties(properties);
39
+ export function startSurvey(surveyId, allowMultipleResponses, hiddenFields, ignoreSurveyStatus) {
40
+ return ScreebModule.startSurvey(surveyId, allowMultipleResponses ?? true, hiddenFields, ignoreSurveyStatus ?? true);
41
+ }
42
+ export function debug() {
43
+ return ScreebModule.debug();
44
+ }
45
+ export function debugTargeting() {
46
+ return ScreebModule.debugTargeting();
47
+ }
48
+ export function resetIdentity() {
49
+ return ScreebModule.resetIdentity();
50
+ }
51
+ export function closeSdk() {
52
+ return ScreebModule.closeSdk();
30
53
  }
31
- //# sourceMappingURL=index.js.map
@@ -1,5 +1,12 @@
1
1
  export declare function initSdk(androidChannelId: string, iosChannelId: string, userId?: string, properties?: Map<string, any>): any;
2
2
  export declare function setIdentity(userId: string, properties?: Map<string, any>): any;
3
+ export declare function setProperties(properties?: Map<string, any>): any;
4
+ export declare function assignGroup(type: string | null, name: string, properties?: Map<string, any>): any;
5
+ export declare function unassignGroup(type: string | null, name: string, properties?: Map<string, any>): any;
3
6
  export declare function trackEvent(name: string, properties?: Map<string, any>): any;
4
7
  export declare function trackScreen(name: string, properties?: Map<string, any>): any;
5
- export declare function setProperties(properties?: Map<string, any>): any;
8
+ export declare function startSurvey(surveyId: string, allowMultipleResponses?: boolean, hiddenFields?: Map<string, any>, ignoreSurveyStatus?: boolean): any;
9
+ export declare function debug(): any;
10
+ export declare function debugTargeting(): any;
11
+ export declare function resetIdentity(): any;
12
+ export declare function closeSdk(): any;
package/package.json CHANGED
@@ -1,13 +1,17 @@
1
1
  {
2
2
  "name": "@screeb/react-native",
3
- "version": "0.8.16",
3
+ "version": "0.8.17",
4
4
  "description": "A react-native module to integrate Screeb mobile sdk for Android and/or iOS.",
5
5
  "scripts": {
6
- "lint": "eslint \"**/*.{js,ts,tsx}\"",
7
- "example": "yarn --cwd example",
8
- "pods": "cd example && pod-install --quiet"
6
+ "clean": "rm -rf lib/",
7
+ "lint": "eslint \"**/*.{js,ts,tsx}\"",
8
+ "example": "yarn --cwd example",
9
+ "pods": "cd example && pod-install --quiet",
10
+ "build": "npm run clean ; tsc -p tsconfig.build.json && tsc -p tsconfig.build.cjs.json"
9
11
  },
10
12
  "react-native": "src/index",
13
+ "main": "lib/commonjs/index.js",
14
+ "module": "lib/module/index.js",
11
15
  "source": "src/index",
12
16
  "keywords": [
13
17
  "react-native",
@@ -50,5 +54,6 @@
50
54
  "peerDependencies": {
51
55
  "react": "*",
52
56
  "react-native": "*"
53
- }
57
+ },
58
+ "types": "./lib/typescript/index.d.ts"
54
59
  }
@@ -1 +0,0 @@
1
- {"version":3,"sources":["index.tsx"],"names":["LINKING_ERROR","Platform","select","ios","default","ScreebModule","NativeModules","Proxy","get","Error","initSdk","androidChannelId","iosChannelId","userId","properties","OS","setIdentity","trackEvent","name","trackScreen","setProperties"],"mappings":";;;;;;;;;;;AAAA;;AAEA,MAAMA,aAAa,GAChB,+EAAD,GACAC,sBAASC,MAAT,CAAgB;AAAEC,EAAAA,GAAG,EAAE,gCAAP;AAAyCC,EAAAA,OAAO,EAAE;AAAlD,CAAhB,CADA,GAEA,sDAFA,GAGA,6CAJF;AAMA,MAAMC,YAAY,GAAGC,2BAAcD,YAAd,GACjBC,2BAAcD,YADG,GAEjB,IAAIE,KAAJ,CACE,EADF,EAEE;AACEC,EAAAA,GAAG,GAAG;AACJ,UAAM,IAAIC,KAAJ,CAAUT,aAAV,CAAN;AACD;;AAHH,CAFF,CAFJ;;AAWO,SAASU,OAAT,CACHC,gBADG,EAEHC,YAFG,EAGHC,MAHG,EAIHC,UAJG,EAI4B;AACjC,MAAIb,sBAASc,EAAT,KAAgB,KAApB,EAA2B;AACzB,WAAOV,YAAY,CAACK,OAAb,CAAqBE,YAArB,EAAmCC,MAAnC,EAA2CC,UAA3C,CAAP;AACD,GAFD,MAEO;AACL,WAAOT,YAAY,CAACK,OAAb,CAAqBC,gBAArB,EAAuCE,MAAvC,EAA+CC,UAA/C,CAAP;AACD;AACF;;AACM,SAASE,WAAT,CAAqBH,MAArB,EAAqCC,UAArC,EAAoE;AACzE,SAAOT,YAAY,CAACW,WAAb,CAAyBH,MAAzB,EAAiCC,UAAjC,CAAP;AACD;;AACM,SAASG,UAAT,CAAoBC,IAApB,EAAkCJ,UAAlC,EAAiE;AACtE,SAAOT,YAAY,CAACY,UAAb,CAAwBC,IAAxB,EAA8BJ,UAA9B,CAAP;AACD;;AACM,SAASK,WAAT,CAAqBD,IAArB,EAAmCJ,UAAnC,EAAkE;AACvE,SAAOT,YAAY,CAACc,WAAb,CAAyBD,IAAzB,EAA+BJ,UAA/B,CAAP;AACD;;AACM,SAASM,aAAT,CAAuBN,UAAvB,EAAsD;AAC3D,SAAOT,YAAY,CAACe,aAAb,CAA2BN,UAA3B,CAAP;AACD","sourcesContent":["import { NativeModules, Platform } from 'react-native';\n\nconst LINKING_ERROR =\n `The package '@screeb/react-native' doesn't seem to be linked. Make sure: \\n\\n` +\n Platform.select({ ios: \"- You have run 'pod install'\\n\", default: '' }) +\n '- You rebuilt the app after installing the package\\n' +\n '- You are not using Expo managed workflow\\n';\n\nconst ScreebModule = NativeModules.ScreebModule\n ? NativeModules.ScreebModule\n : new Proxy(\n {},\n {\n get() {\n throw new Error(LINKING_ERROR);\n },\n }\n );\n\nexport function initSdk(\n androidChannelId: string,\n iosChannelId: string,\n userId?: string,\n properties?: Map<string, any>) {\n if (Platform.OS === 'ios') {\n return ScreebModule.initSdk(iosChannelId, userId, properties);\n } else {\n return ScreebModule.initSdk(androidChannelId, userId, properties);\n }\n}\nexport function setIdentity(userId: string, properties?: Map<string, any>) {\n return ScreebModule.setIdentity(userId, properties);\n}\nexport function trackEvent(name: string, properties?: Map<string, any>) {\n return ScreebModule.trackEvent(name, properties);\n}\nexport function trackScreen(name: string, properties?: Map<string, any>) {\n return ScreebModule.trackScreen(name, properties);\n}\nexport function setProperties(properties?: Map<string, any>) {\n return ScreebModule.setProperties(properties);\n}\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"sources":["index.tsx"],"names":["NativeModules","Platform","LINKING_ERROR","select","ios","default","ScreebModule","Proxy","get","Error","initSdk","androidChannelId","iosChannelId","userId","properties","OS","setIdentity","trackEvent","name","trackScreen","setProperties"],"mappings":"AAAA,SAASA,aAAT,EAAwBC,QAAxB,QAAwC,cAAxC;AAEA,MAAMC,aAAa,GAChB,+EAAD,GACAD,QAAQ,CAACE,MAAT,CAAgB;AAAEC,EAAAA,GAAG,EAAE,gCAAP;AAAyCC,EAAAA,OAAO,EAAE;AAAlD,CAAhB,CADA,GAEA,sDAFA,GAGA,6CAJF;AAMA,MAAMC,YAAY,GAAGN,aAAa,CAACM,YAAd,GACjBN,aAAa,CAACM,YADG,GAEjB,IAAIC,KAAJ,CACE,EADF,EAEE;AACEC,EAAAA,GAAG,GAAG;AACJ,UAAM,IAAIC,KAAJ,CAAUP,aAAV,CAAN;AACD;;AAHH,CAFF,CAFJ;AAWA,OAAO,SAASQ,OAAT,CACHC,gBADG,EAEHC,YAFG,EAGHC,MAHG,EAIHC,UAJG,EAI4B;AACjC,MAAIb,QAAQ,CAACc,EAAT,KAAgB,KAApB,EAA2B;AACzB,WAAOT,YAAY,CAACI,OAAb,CAAqBE,YAArB,EAAmCC,MAAnC,EAA2CC,UAA3C,CAAP;AACD,GAFD,MAEO;AACL,WAAOR,YAAY,CAACI,OAAb,CAAqBC,gBAArB,EAAuCE,MAAvC,EAA+CC,UAA/C,CAAP;AACD;AACF;AACD,OAAO,SAASE,WAAT,CAAqBH,MAArB,EAAqCC,UAArC,EAAoE;AACzE,SAAOR,YAAY,CAACU,WAAb,CAAyBH,MAAzB,EAAiCC,UAAjC,CAAP;AACD;AACD,OAAO,SAASG,UAAT,CAAoBC,IAApB,EAAkCJ,UAAlC,EAAiE;AACtE,SAAOR,YAAY,CAACW,UAAb,CAAwBC,IAAxB,EAA8BJ,UAA9B,CAAP;AACD;AACD,OAAO,SAASK,WAAT,CAAqBD,IAArB,EAAmCJ,UAAnC,EAAkE;AACvE,SAAOR,YAAY,CAACa,WAAb,CAAyBD,IAAzB,EAA+BJ,UAA/B,CAAP;AACD;AACD,OAAO,SAASM,aAAT,CAAuBN,UAAvB,EAAsD;AAC3D,SAAOR,YAAY,CAACc,aAAb,CAA2BN,UAA3B,CAAP;AACD","sourcesContent":["import { NativeModules, Platform } from 'react-native';\n\nconst LINKING_ERROR =\n `The package '@screeb/react-native' doesn't seem to be linked. Make sure: \\n\\n` +\n Platform.select({ ios: \"- You have run 'pod install'\\n\", default: '' }) +\n '- You rebuilt the app after installing the package\\n' +\n '- You are not using Expo managed workflow\\n';\n\nconst ScreebModule = NativeModules.ScreebModule\n ? NativeModules.ScreebModule\n : new Proxy(\n {},\n {\n get() {\n throw new Error(LINKING_ERROR);\n },\n }\n );\n\nexport function initSdk(\n androidChannelId: string,\n iosChannelId: string,\n userId?: string,\n properties?: Map<string, any>) {\n if (Platform.OS === 'ios') {\n return ScreebModule.initSdk(iosChannelId, userId, properties);\n } else {\n return ScreebModule.initSdk(androidChannelId, userId, properties);\n }\n}\nexport function setIdentity(userId: string, properties?: Map<string, any>) {\n return ScreebModule.setIdentity(userId, properties);\n}\nexport function trackEvent(name: string, properties?: Map<string, any>) {\n return ScreebModule.trackEvent(name, properties);\n}\nexport function trackScreen(name: string, properties?: Map<string, any>) {\n return ScreebModule.trackScreen(name, properties);\n}\nexport function setProperties(properties?: Map<string, any>) {\n return ScreebModule.setProperties(properties);\n}\n"]}