@screeb/react-native 0.8.2 → 0.8.3

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 CHANGED
@@ -141,6 +141,21 @@ setProperties(
141
141
  );
142
142
  ```
143
143
 
144
+ ## Run example
145
+
146
+ ```sh
147
+ npm install
148
+
149
+ cd example/
150
+ npm install
151
+
152
+ cd ios/
153
+ pod install
154
+
155
+ npm run android
156
+ npm run ios
157
+ ```
158
+
144
159
  ## License
145
160
 
146
161
  MIT
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@screeb/react-native",
3
- "version": "0.8.2",
3
+ "version": "0.8.3",
4
4
  "description": "A react-native module to integrate Screeb mobile sdk for Android and/or iOS.",
5
5
  "scripts": {
6
6
  "lint": "eslint \"**/*.{js,ts,tsx}\"",
@@ -10,7 +10,7 @@ Pod::Spec.new do |s|
10
10
  s.license = package["license"]
11
11
  s.authors = package["author"]
12
12
 
13
- s.platforms = { :ios => "10.0" }
13
+ s.platforms = { :ios => "12.0" }
14
14
  s.source = { :git => "https://github.com/ScreebApp/sdk-reactnative.git", :tag => "#{s.version}" }
15
15
 
16
16
  s.source_files = "ios/**/*.{h,m,mm,swift}"
@@ -1,48 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.initSdk = initSdk;
7
- exports.setIdentity = setIdentity;
8
- 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
- }
31
- }
32
-
33
- function setIdentity(userId, properties) {
34
- return ScreebModule.setIdentity(userId, properties);
35
- }
36
-
37
- function trackEvent(name, properties) {
38
- return ScreebModule.trackEvent(name, properties);
39
- }
40
-
41
- function trackScreen(name, properties) {
42
- return ScreebModule.trackScreen(name, properties);
43
- }
44
-
45
- function setProperties(properties) {
46
- return ScreebModule.setProperties(properties);
47
- }
48
- //# sourceMappingURL=index.js.map
@@ -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,31 +0,0 @@
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
- });
12
- 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
- }
18
- }
19
- export function setIdentity(userId, properties) {
20
- return ScreebModule.setIdentity(userId, properties);
21
- }
22
- export function trackEvent(name, properties) {
23
- return ScreebModule.trackEvent(name, properties);
24
- }
25
- export function trackScreen(name, properties) {
26
- return ScreebModule.trackScreen(name, properties);
27
- }
28
- export function setProperties(properties) {
29
- return ScreebModule.setProperties(properties);
30
- }
31
- //# sourceMappingURL=index.js.map
@@ -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"]}
@@ -1,5 +0,0 @@
1
- export declare function initSdk(androidChannelId: string, iosChannelId: string, userId?: string, properties?: Map<string, any>): any;
2
- export declare function setIdentity(userId: string, properties?: Map<string, any>): any;
3
- export declare function trackEvent(name: string, properties?: Map<string, any>): any;
4
- export declare function trackScreen(name: string, properties?: Map<string, any>): any;
5
- export declare function setProperties(properties?: Map<string, any>): any;