@pinwheel/react-native-pinwheel 3.0.4 → 3.1.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/CHANGELOG.md CHANGED
@@ -4,9 +4,19 @@ All notable changes to this project will be documented in this file.
4
4
 
5
5
  # 3.0.x Releases
6
6
 
7
- - `3.0.x` Releases - [3.0.0](#300) | [3.0.1](#301) | [3.0.2](#302) | [3.0.3](#303) | [3.0.4](#304)
7
+ - `3.0.x` Releases - [3.0.0](#300) | [3.0.1](#301) | [3.0.2](#302) | [3.0.3](#303) | [3.0.4](#304) | [3.0.5](#305) | [3.1.0](#310)
8
8
 
9
9
  ---
10
+
11
+ ### [3.1.0](https://www.npmjs.com/package/@pinwheel/react-native-pinwheel/v/3.1.0)
12
+
13
+ Expand internal functionality to support a broader range of platforms and increase conversion rate. Fix the casing of the `screenName` field in the exported `ScreenTransitionEventPayload` event payload type.
14
+
15
+
16
+ ### [3.0.5](https://www.npmjs.com/package/@pinwheel/react-native-pinwheel/v/3.0.5)
17
+
18
+ Expand internal functionality to support a broader range of platforms and increase conversion rate. Export `OtherEventPayload` event payload type for the `other_event` event.
19
+
10
20
  ### [3.0.4](https://www.npmjs.com/package/@pinwheel/react-native-pinwheel/v/3.0.4)
11
21
 
12
22
  ####
@@ -18,7 +28,7 @@ Changed Minimum Android SDK requirements to 22
18
28
 
19
29
  ### [3.0.2](https://www.npmjs.com/package/@pinwheel/react-native-pinwheel/v/3.0.2)
20
30
 
21
- Changed Minimum Android SDK requirements to 22
31
+ Changed example app Minimum Android SDK requirements to 22
22
32
 
23
33
  ### [3.0.1](https://www.npmjs.com/package/@pinwheel/react-native-pinwheel/v/3.0.1)
24
34
 
@@ -44,16 +54,24 @@ This new major version bump introduces an updated API to support partner-based s
44
54
 
45
55
  ## 2.5.x Releases
46
56
 
47
- [2.5.0](#250) | [2.5.1](#251) | [2.5.2](#252) | [2.5.3](#253)
57
+ [2.5.0](#250) | [2.5.1](#251) | [2.5.2](#252) | [2.5.3](#253) | [2.5.4](#254)
48
58
 
49
59
  ---
60
+ ### [2.5.4](https://www.npmjs.com/package/@pinwheel/react-native-pinwheel/v/2.5.4)
61
+
62
+ #### Bugfix
63
+ Normalize event names to lower case. Event names began firing as uppercase in versions 3.0.0 and 2.5.0.
64
+
50
65
  ### [2.5.3](https://www.npmjs.com/package/@pinwheel/react-native-pinwheel/v/2.5.3)
51
66
 
52
- ####
53
- Bugfix: Normalize event names to lower case. Event names began firing as uppercase in versions 3.0.0 and 2.5.0.
67
+ #### Notes
68
+
69
+ Changed Minimum Android SDK requirements to 22
54
70
 
55
71
  ### [2.5.2](https://www.npmjs.com/package/@pinwheel/react-native-pinwheel/v/2.5.2)
56
72
 
73
+ #### Notes
74
+
57
75
  Expand internal functionality to support a broader range of platforms and increase conversion rate.
58
76
 
59
77
  ### 2.5.1
@@ -1,6 +1,6 @@
1
1
  Pod::Spec.new do |s|
2
2
  s.name = "RNPinwheelSDK"
3
- s.version = "3.0.4"
3
+ s.version = "3.1.0"
4
4
  s.summary = "React Native plugin for Pinwheel's SDK"
5
5
  s.description = <<-DESC
6
6
  An open source React Native plugin for calling Pinwheel's native SDKs to manage payroll data.
@@ -14,5 +14,5 @@ Pod::Spec.new do |s|
14
14
  s.public_header_files = 'ios/**/*.h'
15
15
  s.requires_arc = true
16
16
  s.dependency "React"
17
- s.dependency 'PinwheelSDK', '3.0.2'
17
+ s.dependency 'PinwheelSDK', '3.1.0'
18
18
  end
@@ -41,10 +41,10 @@ rootProject.allprojects {
41
41
  }
42
42
  }
43
43
 
44
- def PW_SDK_VERSION = '3.0.1'
44
+ def PW_ANDROID_SDK_VERSION = '3.1.0'
45
45
 
46
46
  dependencies {
47
- def pwVersion = rootProject.hasProperty('pwVersion') ? rootProject.pwVersion : PW_SDK_VERSION
47
+ def pwVersion = rootProject.hasProperty('pwVersion') ? rootProject.pwVersion : PW_ANDROID_SDK_VERSION
48
48
  implementation 'com.facebook.react:react-native:+'
49
49
  implementation "com.getpinwheel:pinwheel-android:$pwVersion"
50
50
  }
@@ -158,7 +158,7 @@ class PinwheelViewManager(
158
158
 
159
159
 
160
160
  this.token?.let {
161
- val pinwheelFragment = PinwheelFragment.newInstance(it, "react native", "3.0.0")
161
+ val pinwheelFragment = PinwheelFragment.newInstance(it, "react native", "3.1.0")
162
162
  pinwheelFragment.pinwheelEventListener = this
163
163
  val activity = reactContext.currentActivity as FragmentActivity
164
164
  activity.supportFragmentManager
@@ -206,4 +206,4 @@ class PinwheelViewManager(
206
206
  private const val REACT_CLASS = "RNTPinwheel"
207
207
  private const val COMMAND_CREATE = 1
208
208
  }
209
- }
209
+ }
@@ -57,7 +57,7 @@ export type DdFormCreateEventPayload = {
57
57
  };
58
58
  export type DdFormDownloadEventPayload = {};
59
59
  export type ScreenTransitionEventPayload = {
60
- screen_name: string;
60
+ screenName: string;
61
61
  selectedEmployerId?: string;
62
62
  selectedEmployerName?: string;
63
63
  selectedPlatformId?: string;
@@ -85,6 +85,14 @@ export type ErrorEventPayload = {
85
85
  message: string;
86
86
  pendingRetry: boolean;
87
87
  };
88
+ export type OtherEventPayload = {
89
+ name: string;
90
+ payload: {
91
+ key: string;
92
+ value: string;
93
+ type: 'string' | 'boolean' | 'number';
94
+ }[];
95
+ };
88
96
  /**
89
97
  * @deprecated - Use `ErrorEventPayload` instead.
90
98
  */
@@ -106,6 +114,7 @@ type EventPayloadAdditions = {
106
114
  dd_form_download: DdFormDownloadEventPayload;
107
115
  screen_transition: ScreenTransitionEventPayload;
108
116
  exit: ErrorEventPayload | ExitEventPayload;
117
+ other_event: OtherEventPayload;
109
118
  success: SuccessEventPayload;
110
119
  error: ErrorEventPayload;
111
120
  };
@@ -1,4 +1,4 @@
1
1
  /**
2
2
  * Importing package.json here causes a problem with the folder structure when we npm pack and publish.
3
3
  */
4
- export declare const VERSION = "3.0.4";
4
+ export declare const VERSION = "3.1.0";
package/dist/constants.js CHANGED
@@ -1,4 +1,4 @@
1
1
  /**
2
2
  * Importing package.json here causes a problem with the folder structure when we npm pack and publish.
3
3
  */
4
- export const VERSION = '3.0.4';
4
+ export const VERSION = '3.1.0';
@@ -9,6 +9,7 @@ const createFragment = (viewId) => {
9
9
  };
10
10
  const RNTPinwheelView = (props) => {
11
11
  const ref = useRef(null);
12
+ const eventListenerRef = useRef(null);
12
13
  useEffect(() => {
13
14
  setTimeout(() => {
14
15
  const viewId = findNodeHandle(ref.current);
@@ -18,11 +19,15 @@ const RNTPinwheelView = (props) => {
18
19
  // events
19
20
  const { RNTPinwheelEvents } = NativeModules;
20
21
  const eventEmitter = new NativeEventEmitter(RNTPinwheelEvents);
21
- const eventListener = eventEmitter.addListener('PINWHEEL_EVENT', (event) => {
22
+ eventListenerRef.current = eventEmitter.addListener('PINWHEEL_EVENT', (event) => {
22
23
  props.onEvent(event);
23
24
  });
24
25
  }, 10);
26
+ return () => {
27
+ var _a;
28
+ (_a = eventListenerRef.current) === null || _a === void 0 ? void 0 : _a.remove();
29
+ };
25
30
  }, []);
26
- return <RNTPinwheel {...props} onEvent={(event) => { console.log `rawbee: ${JSON.stringify(event)}`; }} ref={ref}/>;
31
+ return <RNTPinwheel {...props} ref={ref}/>;
27
32
  };
28
33
  export default RNTPinwheelView;
@@ -18,7 +18,7 @@
18
18
 
19
19
  - (void)initPinwheelWrapperVC {
20
20
  if (self.token != nil && self.pinwheelWrapperVC == nil) {
21
- self.pinwheelWrapperVC = [[PinwheelWrapperVC alloc] initWithToken:self.token delegate:self sdk:@"react native" version: @"3.0.0"];
21
+ self.pinwheelWrapperVC = [[PinwheelWrapperVC alloc] initWithToken:self.token delegate:self sdk:@"react native" version: @"3.1.0"];
22
22
  [self addSubview:self.pinwheelWrapperVC.view];
23
23
  }
24
24
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pinwheel/react-native-pinwheel",
3
- "version": "3.0.4",
3
+ "version": "3.1.0",
4
4
  "type": "module",
5
5
  "description": "Pinwheel React Native SDK",
6
6
  "main": "dist/index.js",