@pinwheel/react-native-pinwheel 3.2.0-rc.5 → 3.2.0-rc.6

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
@@ -2,37 +2,6 @@
2
2
 
3
3
  Pinwheel SDK for React Native
4
4
 
5
- ## Running The Example App Locally
6
-
7
- You may want to run the example app locally to get started.
8
-
9
- #### Dependencies
10
-
11
- - Node 16.7.0 (check with `node -v` and upgrade versions using `nvm` if needed)
12
- - iPhone 14 simulator (open your Simulator app and check the available versions)
13
- - iOS 16 running on the simulator (open your Simulator app and check the available versions)
14
- - `pod` version 1.11.3 (check with `pod --version`)
15
- - Add your pinwheel secret to `example/env.js` (create this file) with `export default "<YOUR PINWHEEL SECRET>"`.
16
-
17
- #### Directions
18
-
19
- - `npm run dev`
20
-
21
- #### Troubleshooting
22
-
23
- ###### An error was encountered processing the command (domain=com.apple.CoreSimulator.SimError, code=405)
24
- - Click Apple > About This Mac > Storage > Manage > Developer
25
- - Delete Xcode cache
26
- - Delete Project Build and indexes
27
-
28
- ###### Failed to build iOS project. We ran "xcodebuild" command but it exited with error code 65
29
- - Try downloading Xcode 14.2 from https://developer.apple.com/download/all/?q=xcode
30
-
31
- ###### Failed to locate 'git', requesting installation of command line developer tools
32
- For this or other errors related to command line developer tools:
33
- - Make sure you have Command Line Tools for Xcode 14.2 installed
34
- - Open Xcode > Click Xcode in the app menu > Settings > Locations > Command Line Tools dropdown and set the correct location
35
-
36
5
  ## Installation
37
6
 
38
7
  1. Install Pinwheel React Native SDK
@@ -41,6 +10,20 @@ For this or other errors related to command line developer tools:
41
10
  $ npm install --save @pinwheel/react-native-pinwheel
42
11
  ```
43
12
 
13
+ ## Configuration
14
+ Some platform integrations may require camera access for verification purposes. Ensure the necessary permissions are configured in your project:
15
+
16
+ **Android:** Add the following permission to your `AndroidManifest.xml`:
17
+ ```
18
+ <uses-permission android:name="android.permission.CAMERA" />
19
+ ```
20
+
21
+ **iOS:** Add the following key and description to your `Info.plist`:
22
+ ```
23
+ <key>NSCameraUsageDescription</key>
24
+ <string>We need access to your camera for verification purposes.</string>
25
+ ```
26
+
44
27
  ## Usage
45
28
 
46
29
  ### Link Token
@@ -117,3 +100,34 @@ Callback for all significant events that happen during the modal flow. See all p
117
100
  | Type | Required |
118
101
  | -------- | -------- |
119
102
  | function | No |
103
+
104
+ ## Running The Example App Locally
105
+
106
+ You may want to run the example app locally to get started.
107
+
108
+ #### Dependencies
109
+
110
+ - Node 16.7.0 (check with `node -v` and upgrade versions using `nvm` if needed)
111
+ - iPhone 14 simulator (open your Simulator app and check the available versions)
112
+ - iOS 16 running on the simulator (open your Simulator app and check the available versions)
113
+ - `pod` version 1.11.3 (check with `pod --version`)
114
+ - Add your pinwheel secret to `example/env.js` (create this file) with `export default "<YOUR PINWHEEL SECRET>"`.
115
+
116
+ #### Directions
117
+
118
+ - `npm run dev`
119
+
120
+ #### Troubleshooting
121
+
122
+ ###### An error was encountered processing the command (domain=com.apple.CoreSimulator.SimError, code=405)
123
+ - Click Apple > About This Mac > Storage > Manage > Developer
124
+ - Delete Xcode cache
125
+ - Delete Project Build and indexes
126
+
127
+ ###### Failed to build iOS project. We ran "xcodebuild" command but it exited with error code 65
128
+ - Try downloading Xcode 14.2 from https://developer.apple.com/download/all/?q=xcode
129
+
130
+ ###### Failed to locate 'git', requesting installation of command line developer tools
131
+ For this or other errors related to command line developer tools:
132
+ - Make sure you have Command Line Tools for Xcode 14.2 installed
133
+ - Open Xcode > Click Xcode in the app menu > Settings > Locations > Command Line Tools dropdown and set the correct location
@@ -48,7 +48,7 @@ class Pinwheel : FrameLayout {
48
48
  private fun createFragment() {
49
49
  Handler(Looper.getMainLooper()).post {
50
50
  this.token?.let {
51
- val pinwheelFragment = PinwheelFragment.newInstance(it, "react native", "3.2.0-rc.5")
51
+ val pinwheelFragment = PinwheelFragment.newInstance(it, "react native", "3.2.0")
52
52
  pinwheelEventListener?.let { listener ->
53
53
  pinwheelFragment.pinwheelEventListener = listener
54
54
  }
@@ -77,13 +77,15 @@ class Pinwheel : FrameLayout {
77
77
  }
78
78
 
79
79
  fun setupLayoutSizing() {
80
+ val left = this.left
81
+ val top = this.top
80
82
  val width = this.width
81
83
  val height = this.height
82
84
  this.measure(
83
85
  View.MeasureSpec.makeMeasureSpec(width, View.MeasureSpec.EXACTLY),
84
86
  View.MeasureSpec.makeMeasureSpec(height, View.MeasureSpec.EXACTLY))
85
87
 
86
- this.layout(0, 0, width, height)
88
+ this.layout(left, top, left + width, top + height)
87
89
  }
88
90
 
89
91
  override fun onLayout(changed: Boolean, left: Int, top: Int, right: Int, bottom: Int) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pinwheel/react-native-pinwheel",
3
- "version": "3.2.0-rc.5",
3
+ "version": "3.2.0-rc.6",
4
4
  "type": "module",
5
5
  "main": "src/index.ts",
6
6
  "types": "src/index.ts",
package/src/Pinwheel.tsx CHANGED
@@ -1,9 +1,14 @@
1
1
  import React, { useEffect, useCallback } from 'react';
2
- import { SafeAreaView } from 'react-native';
2
+ import { SafeAreaView, StyleSheet } from 'react-native';
3
3
  const RTNPinwheel = require('./RTNPinwheelNativeComponent').default;
4
4
  import { PinwheelEvents } from './PinwheelEvents';
5
5
  import { LinkOptions } from './client-events/client';
6
6
 
7
+ const styles = StyleSheet.create({
8
+ container: {
9
+ flex: 1,
10
+ },
11
+ });
7
12
  const Pinwheel = ({
8
13
  linkToken,
9
14
  onLogin,
@@ -66,13 +71,8 @@ const Pinwheel = ({
66
71
  }, [eventsListener]);
67
72
 
68
73
  return (
69
- <SafeAreaView style={{ width: '100%', height: '100%' }}>
70
- {linkToken && (
71
- <RTNPinwheel
72
- style={{ width: '100%', height: '100%' }}
73
- token={linkToken}
74
- />
75
- )}
74
+ <SafeAreaView style={styles.container}>
75
+ {linkToken && <RTNPinwheel style={{ flex: 1 }} token={linkToken} />}
76
76
  </SafeAreaView>
77
77
  );
78
78
  };