@pinwheel/react-native-pinwheel 3.0.3 → 3.0.5
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 +32 -12
- package/RNPinwheelSDK.podspec +2 -2
- package/android/build.gradle +2 -2
- package/android/src/main/java/com/underdog_tech/react/PinwheelViewManager.kt +2 -2
- package/dist/client-events/registry/v2.3.d.ts +9 -0
- package/dist/constants.d.ts +1 -1
- package/dist/constants.js +1 -1
- package/dist/index.js +6 -2
- package/dist/pinwheel-wrapper.android.js +7 -2
- package/ios/RNTPinwheelView.m +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -4,23 +4,32 @@ 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)
|
|
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)
|
|
8
8
|
|
|
9
9
|
---
|
|
10
10
|
|
|
11
|
-
### [3.0.
|
|
11
|
+
### [3.0.5](https://www.npmjs.com/package/@pinwheel/react-native-pinwheel/v/3.0.5)
|
|
12
12
|
|
|
13
|
-
|
|
13
|
+
Expand internal functionality to support a broader range of platforms and increase conversion rate. Export `OtherEventPayload` event payload type for the `other_event` event.
|
|
14
|
+
|
|
15
|
+
### [3.0.4](https://www.npmjs.com/package/@pinwheel/react-native-pinwheel/v/3.0.4)
|
|
14
16
|
|
|
15
|
-
|
|
17
|
+
####
|
|
18
|
+
Bugfix: Normalize event names to lower case. Event names began firing as uppercase in versions 3.0.0 and 2.5.0.
|
|
19
|
+
|
|
20
|
+
### [3.0.3](https://www.npmjs.com/package/@pinwheel/react-native-pinwheel/v/3.0.3)
|
|
16
21
|
|
|
17
22
|
Changed Minimum Android SDK requirements to 22
|
|
18
23
|
|
|
19
|
-
### [3.0.
|
|
24
|
+
### [3.0.2](https://www.npmjs.com/package/@pinwheel/react-native-pinwheel/v/3.0.2)
|
|
25
|
+
|
|
26
|
+
Changed example app Minimum Android SDK requirements to 22
|
|
27
|
+
|
|
28
|
+
### [3.0.1](https://www.npmjs.com/package/@pinwheel/react-native-pinwheel/v/3.0.1)
|
|
20
29
|
|
|
21
30
|
Expand internal functionality to support a broader range of platforms and increase conversion rate.
|
|
22
31
|
|
|
23
|
-
### [3.0.0](https://
|
|
32
|
+
### [3.0.0](https://www.npmjs.com/package/@pinwheel/react-native-pinwheel/v/3.0.0)
|
|
24
33
|
|
|
25
34
|
This new major version bump introduces an updated API to support partner-based switches.
|
|
26
35
|
|
|
@@ -40,12 +49,23 @@ This new major version bump introduces an updated API to support partner-based s
|
|
|
40
49
|
|
|
41
50
|
## 2.5.x Releases
|
|
42
51
|
|
|
43
|
-
[2.5.0](#250) | [2.5.1](#251) | [2.5.2](#252)
|
|
52
|
+
[2.5.0](#250) | [2.5.1](#251) | [2.5.2](#252) | [2.5.3](#253) | [2.5.4](#254)
|
|
44
53
|
|
|
45
54
|
---
|
|
46
|
-
### [2.5.
|
|
55
|
+
### [2.5.4](https://www.npmjs.com/package/@pinwheel/react-native-pinwheel/v/2.5.4)
|
|
47
56
|
|
|
48
|
-
|
|
57
|
+
#### Bugfix
|
|
58
|
+
Normalize event names to lower case. Event names began firing as uppercase in versions 3.0.0 and 2.5.0.
|
|
59
|
+
|
|
60
|
+
### [2.5.3](https://www.npmjs.com/package/@pinwheel/react-native-pinwheel/v/2.5.3)
|
|
61
|
+
|
|
62
|
+
#### Notes
|
|
63
|
+
|
|
64
|
+
Changed Minimum Android SDK requirements to 22
|
|
65
|
+
|
|
66
|
+
### [2.5.2](https://www.npmjs.com/package/@pinwheel/react-native-pinwheel/v/2.5.2)
|
|
67
|
+
|
|
68
|
+
#### Notes
|
|
49
69
|
|
|
50
70
|
Expand internal functionality to support a broader range of platforms and increase conversion rate.
|
|
51
71
|
|
|
@@ -107,15 +127,15 @@ Add CircleCI scripting and local scripts.
|
|
|
107
127
|
|
|
108
128
|
Use node 16.7.0 instead of 12.16.1 to install dependencies.
|
|
109
129
|
|
|
110
|
-
### [2.3.6](https://
|
|
130
|
+
### [2.3.6](https://www.npmjs.com/package/@pinwheel/react-native-pinwheel/v/2.3.6)
|
|
111
131
|
|
|
112
132
|
N/A
|
|
113
133
|
|
|
114
|
-
### [2.3.5](https://
|
|
134
|
+
### [2.3.5](https://www.npmjs.com/package/@pinwheel/react-native-pinwheel/v/2.3.5)
|
|
115
135
|
|
|
116
136
|
N/A
|
|
117
137
|
|
|
118
|
-
### [2.3.4](https://
|
|
138
|
+
### [2.3.4](https://www.npmjs.com/package/@pinwheel/react-native-pinwheel/v/2.3.4)
|
|
119
139
|
|
|
120
140
|
#### Added
|
|
121
141
|
|
package/RNPinwheelSDK.podspec
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Pod::Spec.new do |s|
|
|
2
2
|
s.name = "RNPinwheelSDK"
|
|
3
|
-
s.version = "3.0.
|
|
3
|
+
s.version = "3.0.5"
|
|
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.
|
|
17
|
+
s.dependency 'PinwheelSDK', '3.0.5'
|
|
18
18
|
end
|
package/android/build.gradle
CHANGED
|
@@ -41,10 +41,10 @@ rootProject.allprojects {
|
|
|
41
41
|
}
|
|
42
42
|
}
|
|
43
43
|
|
|
44
|
-
def
|
|
44
|
+
def PW_ANDROID_SDK_VERSION = '3.0.4'
|
|
45
45
|
|
|
46
46
|
dependencies {
|
|
47
|
-
def pwVersion = rootProject.hasProperty('pwVersion') ? rootProject.pwVersion :
|
|
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.
|
|
161
|
+
val pinwheelFragment = PinwheelFragment.newInstance(it, "react native", "3.0.5")
|
|
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
|
+
}
|
|
@@ -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
|
};
|
package/dist/constants.d.ts
CHANGED
package/dist/constants.js
CHANGED
package/dist/index.js
CHANGED
|
@@ -14,8 +14,12 @@ export default ({ linkToken, onLogin, onLoginAttempt, onSuccess, onError, onExit
|
|
|
14
14
|
return;
|
|
15
15
|
}
|
|
16
16
|
const { name, payload } = event;
|
|
17
|
-
|
|
18
|
-
|
|
17
|
+
// Our Android SDK, since the beginning, has been firing events with upper case.
|
|
18
|
+
// Since we are now wrapping the Android SDK to create the RN SDK, we need to reconcile
|
|
19
|
+
// the event names here.
|
|
20
|
+
const normalizedName = name.toLowerCase();
|
|
21
|
+
onEvent && onEvent(normalizedName, payload);
|
|
22
|
+
switch (normalizedName) {
|
|
19
23
|
case 'exit':
|
|
20
24
|
// console.log(`case: exit, onExit: ${onExit}`);
|
|
21
25
|
onExit && onExit(payload);
|
|
@@ -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
|
-
|
|
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}
|
|
31
|
+
return <RNTPinwheel {...props} ref={ref}/>;
|
|
27
32
|
};
|
|
28
33
|
export default RNTPinwheelView;
|
package/ios/RNTPinwheelView.m
CHANGED
|
@@ -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.
|
|
21
|
+
self.pinwheelWrapperVC = [[PinwheelWrapperVC alloc] initWithToken:self.token delegate:self sdk:@"react native" version: @"3.0.5"];
|
|
22
22
|
[self addSubview:self.pinwheelWrapperVC.view];
|
|
23
23
|
}
|
|
24
24
|
}
|