plotline-engage 3.1.8 → 3.2.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.
@@ -135,4 +135,9 @@ public class RNPlotline extends ReactContextBaseJavaModule {
135
135
  public void notifyScroll() {
136
136
  Plotline.notifyScroll();
137
137
  }
138
+
139
+ @ReactMethod
140
+ public void logout() {
141
+ Plotline.logout();
142
+ }
138
143
  }
package/index.d.ts CHANGED
@@ -1,5 +1,6 @@
1
1
  import { ScrollViewProps } from 'react-native';
2
2
  import { FlatListProps } from 'react-native';
3
+ import React from 'react';
3
4
 
4
5
  declare class plotline {
5
6
  track(eventName: string, properties: {[key: string]: string}): void;
@@ -11,12 +12,13 @@ declare class plotline {
11
12
  trackPage(pageId: string): void;
12
13
  debug(): void;
13
14
  notifyScroll(): void;
15
+ logout(): void;
14
16
  }
15
- declare class PScrollView extends React.Component<ScrollViewProps> {
17
+ declare class ScrollView extends React.Component<ScrollViewProps> {
16
18
  }
17
19
 
18
- declare class PFlatList<T> extends React.Component<FlatListProps<T>> {
20
+ declare class FlatList<T> extends React.Component<FlatListProps<T>> {
19
21
  }
20
22
  declare const Plotline: plotline;
21
- export { PScrollView, PFlatList };
23
+ export { ScrollView, FlatList };
22
24
  export default Plotline;
package/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
 
2
- import { NativeModules, Platform } from 'react-native';
3
- import { ScrollView, FlatList } from 'react-native';
2
+ import { NativeModules } from 'react-native';
3
+ import { ScrollView as RNScrollView, FlatList as RNFlatList} from 'react-native';
4
4
  import React from 'react';
5
5
  const { RNPlotline } = NativeModules;
6
6
 
@@ -64,11 +64,15 @@ class plotline {
64
64
  notifyScroll() {
65
65
  this.throttledNotifyScroll();
66
66
  }
67
+
68
+ logout() {
69
+ RNPlotline.logout();
70
+ }
67
71
  }
68
72
 
69
73
  const Plotline = new plotline();
70
74
 
71
- const PScrollView = (props) => {
75
+ const ScrollView = (props) => {
72
76
  const handleScroll = (event) => {
73
77
  Plotline.notifyScroll();
74
78
  if (props.onScroll) {
@@ -77,13 +81,13 @@ const PScrollView = (props) => {
77
81
  };
78
82
 
79
83
  return (
80
- <ScrollView {...props} onScroll={handleScroll} scrollEventThrottle={16}>
84
+ <RNScrollView {...props} onScroll={handleScroll} scrollEventThrottle={16}>
81
85
  {props.children}
82
- </ScrollView>
86
+ </RNScrollView>
83
87
  );
84
88
  };
85
89
 
86
- const PFlatList = (props) => {
90
+ const FlatList = (props) => {
87
91
  const handleScroll = (event) => {
88
92
  Plotline.notifyScroll();
89
93
  if (props.onScroll) {
@@ -92,11 +96,11 @@ const PFlatList = (props) => {
92
96
  };
93
97
 
94
98
  return (
95
- <FlatList {...props} onScroll={handleScroll} scrollEventThrottle={16}>
99
+ <RNFlatList {...props} onScroll={handleScroll} scrollEventThrottle={16}>
96
100
  {props.children}
97
- </FlatList>
101
+ </RNFlatList>
98
102
  );
99
103
  };
100
104
 
101
105
  export default Plotline;
102
- export {PScrollView, PFlatList};
106
+ export {ScrollView, FlatList};
package/ios/RNPlotline.m CHANGED
@@ -58,6 +58,11 @@ RCT_EXPORT_METHOD(trackPage:(NSString *)pageName)
58
58
  [Plotline trackPageWithPageName:pageName];
59
59
  }
60
60
 
61
+ RCT_EXPORT_METHOD(logout)
62
+ {
63
+ [Plotline logout];
64
+ }
65
+
61
66
  RCT_EXPORT_MODULE();
62
67
 
63
68
  @end
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "plotline-engage",
3
- "version": "3.1.8",
3
+ "version": "3.2.0",
4
4
  "description": "React Native plugin for Plotline",
5
5
  "scripts": {
6
6
  "test": "echo \"Error: no test specified\" && exit 1"