@rownd/react-native 0.1.1

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.
Files changed (175) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +213 -0
  3. package/android/build.gradle +59 -0
  4. package/android/src/main/AndroidManifest.xml +4 -0
  5. package/android/src/main/java/com/reactnative/ReactNativePackage.java +22 -0
  6. package/android/src/main/java/com/reactnative/ReactNativeViewManager.java +31 -0
  7. package/ios/ReactNative.xcodeproj/project.pbxproj +282 -0
  8. package/ios/ReactNative.xcodeproj/project.xcworkspace/contents.xcworkspacedata +4 -0
  9. package/ios/ReactNativeViewManager.m +34 -0
  10. package/lib/commonjs/assets/images/checkmark--filled.svg +12 -0
  11. package/lib/commonjs/assets/images/email-verify-waiting.svg +36 -0
  12. package/lib/commonjs/assets/images/phone-verify-waiting.svg +26 -0
  13. package/lib/commonjs/components/AuthenticatedComponent.js +35 -0
  14. package/lib/commonjs/components/AuthenticatedComponent.js.map +1 -0
  15. package/lib/commonjs/components/AutoSigninDialog.js +119 -0
  16. package/lib/commonjs/components/AutoSigninDialog.js.map +1 -0
  17. package/lib/commonjs/components/DefaultContext.js +269 -0
  18. package/lib/commonjs/components/DefaultContext.js.map +1 -0
  19. package/lib/commonjs/components/GlobalContext.js +340 -0
  20. package/lib/commonjs/components/GlobalContext.js.map +1 -0
  21. package/lib/commonjs/components/RowndComponents.js +29 -0
  22. package/lib/commonjs/components/RowndComponents.js.map +1 -0
  23. package/lib/commonjs/components/RowndProvider.js +55 -0
  24. package/lib/commonjs/components/RowndProvider.js.map +1 -0
  25. package/lib/commonjs/components/SignIn.js +622 -0
  26. package/lib/commonjs/components/SignIn.js.map +1 -0
  27. package/lib/commonjs/data/actions.js +26 -0
  28. package/lib/commonjs/data/actions.js.map +1 -0
  29. package/lib/commonjs/hooks/api.js +157 -0
  30. package/lib/commonjs/hooks/api.js.map +1 -0
  31. package/lib/commonjs/hooks/debounce.js +38 -0
  32. package/lib/commonjs/hooks/debounce.js.map +1 -0
  33. package/lib/commonjs/hooks/fingerprint.js +176 -0
  34. package/lib/commonjs/hooks/fingerprint.js.map +1 -0
  35. package/lib/commonjs/hooks/index.js +48 -0
  36. package/lib/commonjs/hooks/index.js.map +1 -0
  37. package/lib/commonjs/hooks/interval.js +31 -0
  38. package/lib/commonjs/hooks/interval.js.map +1 -0
  39. package/lib/commonjs/hooks/nav.js +39 -0
  40. package/lib/commonjs/hooks/nav.js.map +1 -0
  41. package/lib/commonjs/hooks/rownd.js +163 -0
  42. package/lib/commonjs/hooks/rownd.js.map +1 -0
  43. package/lib/commonjs/index.js +32 -0
  44. package/lib/commonjs/index.js.map +1 -0
  45. package/lib/commonjs/index.tsx.bak +26 -0
  46. package/lib/commonjs/types.js +2 -0
  47. package/lib/commonjs/types.js.map +1 -0
  48. package/lib/commonjs/utils/config.js +28 -0
  49. package/lib/commonjs/utils/config.js.map +1 -0
  50. package/lib/commonjs/utils/events.js +57 -0
  51. package/lib/commonjs/utils/events.js.map +1 -0
  52. package/lib/commonjs/utils/form.js +46 -0
  53. package/lib/commonjs/utils/form.js.map +1 -0
  54. package/lib/commonjs/utils/queue.js +117 -0
  55. package/lib/commonjs/utils/queue.js.map +1 -0
  56. package/lib/commonjs/utils/storage.js +15 -0
  57. package/lib/commonjs/utils/storage.js.map +1 -0
  58. package/lib/commonjs/utils/tailwind.js +17 -0
  59. package/lib/commonjs/utils/tailwind.js.map +1 -0
  60. package/lib/commonjs/utils/tokens.js +35 -0
  61. package/lib/commonjs/utils/tokens.js.map +1 -0
  62. package/lib/commonjs/utils/user-data.js +21 -0
  63. package/lib/commonjs/utils/user-data.js.map +1 -0
  64. package/lib/module/assets/images/checkmark--filled.svg +12 -0
  65. package/lib/module/assets/images/email-verify-waiting.svg +36 -0
  66. package/lib/module/assets/images/phone-verify-waiting.svg +26 -0
  67. package/lib/module/components/AuthenticatedComponent.js +24 -0
  68. package/lib/module/components/AuthenticatedComponent.js.map +1 -0
  69. package/lib/module/components/AutoSigninDialog.js +100 -0
  70. package/lib/module/components/AutoSigninDialog.js.map +1 -0
  71. package/lib/module/components/DefaultContext.js +244 -0
  72. package/lib/module/components/DefaultContext.js.map +1 -0
  73. package/lib/module/components/GlobalContext.js +318 -0
  74. package/lib/module/components/GlobalContext.js.map +1 -0
  75. package/lib/module/components/RowndComponents.js +14 -0
  76. package/lib/module/components/RowndComponents.js.map +1 -0
  77. package/lib/module/components/RowndProvider.js +39 -0
  78. package/lib/module/components/RowndProvider.js.map +1 -0
  79. package/lib/module/components/SignIn.js +593 -0
  80. package/lib/module/components/SignIn.js.map +1 -0
  81. package/lib/module/data/actions.js +19 -0
  82. package/lib/module/data/actions.js.map +1 -0
  83. package/lib/module/hooks/api.js +138 -0
  84. package/lib/module/hooks/api.js.map +1 -0
  85. package/lib/module/hooks/debounce.js +29 -0
  86. package/lib/module/hooks/debounce.js.map +1 -0
  87. package/lib/module/hooks/fingerprint.js +157 -0
  88. package/lib/module/hooks/fingerprint.js.map +1 -0
  89. package/lib/module/hooks/index.js +7 -0
  90. package/lib/module/hooks/index.js.map +1 -0
  91. package/lib/module/hooks/interval.js +23 -0
  92. package/lib/module/hooks/interval.js.map +1 -0
  93. package/lib/module/hooks/nav.js +30 -0
  94. package/lib/module/hooks/nav.js.map +1 -0
  95. package/lib/module/hooks/rownd.js +148 -0
  96. package/lib/module/hooks/rownd.js.map +1 -0
  97. package/lib/module/index.js +6 -0
  98. package/lib/module/index.js.map +1 -0
  99. package/lib/module/index.tsx.bak +26 -0
  100. package/lib/module/types.js +2 -0
  101. package/lib/module/types.js.map +1 -0
  102. package/lib/module/utils/config.js +17 -0
  103. package/lib/module/utils/config.js.map +1 -0
  104. package/lib/module/utils/events.js +45 -0
  105. package/lib/module/utils/events.js.map +1 -0
  106. package/lib/module/utils/form.js +34 -0
  107. package/lib/module/utils/form.js.map +1 -0
  108. package/lib/module/utils/queue.js +109 -0
  109. package/lib/module/utils/queue.js.map +1 -0
  110. package/lib/module/utils/storage.js +6 -0
  111. package/lib/module/utils/storage.js.map +1 -0
  112. package/lib/module/utils/tailwind.js +5 -0
  113. package/lib/module/utils/tailwind.js.map +1 -0
  114. package/lib/module/utils/tokens.js +24 -0
  115. package/lib/module/utils/tokens.js.map +1 -0
  116. package/lib/module/utils/user-data.js +14 -0
  117. package/lib/module/utils/user-data.js.map +1 -0
  118. package/lib/typescript/example2/App.d.ts +11 -0
  119. package/lib/typescript/src/components/AuthenticatedComponent.d.ts +7 -0
  120. package/lib/typescript/src/components/AutoSigninDialog.d.ts +1 -0
  121. package/lib/typescript/src/components/DefaultContext.d.ts +12 -0
  122. package/lib/typescript/src/components/GlobalContext.d.ts +111 -0
  123. package/lib/typescript/src/components/RowndComponents.d.ts +1 -0
  124. package/lib/typescript/src/components/RowndProvider.d.ts +8 -0
  125. package/lib/typescript/src/components/SignIn.d.ts +1 -0
  126. package/lib/typescript/src/data/actions.d.ts +20 -0
  127. package/lib/typescript/src/hooks/api.d.ts +12 -0
  128. package/lib/typescript/src/hooks/debounce.d.ts +5 -0
  129. package/lib/typescript/src/hooks/fingerprint.d.ts +12 -0
  130. package/lib/typescript/src/hooks/index.d.ts +6 -0
  131. package/lib/typescript/src/hooks/interval.d.ts +2 -0
  132. package/lib/typescript/src/hooks/nav.d.ts +6 -0
  133. package/lib/typescript/src/hooks/rownd.d.ts +37 -0
  134. package/lib/typescript/src/index.d.ts +4 -0
  135. package/lib/typescript/src/types.d.ts +26 -0
  136. package/lib/typescript/src/utils/config.d.ts +18 -0
  137. package/lib/typescript/src/utils/events.d.ts +22 -0
  138. package/lib/typescript/src/utils/form.d.ts +17 -0
  139. package/lib/typescript/src/utils/queue.d.ts +21 -0
  140. package/lib/typescript/src/utils/storage.d.ts +3 -0
  141. package/lib/typescript/src/utils/tailwind.d.ts +2 -0
  142. package/lib/typescript/src/utils/tokens.d.ts +4 -0
  143. package/lib/typescript/src/utils/user-data.d.ts +3 -0
  144. package/lib/typescript/tailwind.config.d.ts +10 -0
  145. package/package.json +177 -0
  146. package/react-native.podspec +19 -0
  147. package/src/assets/images/checkmark--filled.svg +12 -0
  148. package/src/assets/images/email-verify-waiting.svg +36 -0
  149. package/src/assets/images/phone-verify-waiting.svg +26 -0
  150. package/src/components/AuthenticatedComponent.tsx +30 -0
  151. package/src/components/AutoSigninDialog.tsx +125 -0
  152. package/src/components/DefaultContext.tsx +278 -0
  153. package/src/components/GlobalContext.tsx +485 -0
  154. package/src/components/RowndComponents.tsx +21 -0
  155. package/src/components/RowndProvider.tsx +56 -0
  156. package/src/components/SignIn.tsx +770 -0
  157. package/src/data/actions.ts +21 -0
  158. package/src/hooks/api.ts +163 -0
  159. package/src/hooks/debounce.ts +36 -0
  160. package/src/hooks/fingerprint.ts +217 -0
  161. package/src/hooks/index.ts +7 -0
  162. package/src/hooks/interval.ts +25 -0
  163. package/src/hooks/nav.tsx +29 -0
  164. package/src/hooks/rownd.ts +184 -0
  165. package/src/index.tsx +6 -0
  166. package/src/index.tsx.bak +26 -0
  167. package/src/types.ts +27 -0
  168. package/src/utils/config.ts +36 -0
  169. package/src/utils/events.ts +54 -0
  170. package/src/utils/form.tsx +64 -0
  171. package/src/utils/queue.ts +75 -0
  172. package/src/utils/storage.ts +7 -0
  173. package/src/utils/tailwind.ts +6 -0
  174. package/src/utils/tokens.ts +26 -0
  175. package/src/utils/user-data.ts +15 -0
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2021 Matt Hamann
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,213 @@
1
+ # @rownd/react-native
2
+
3
+ Rownd bindings for React Native
4
+
5
+ ## Prerequisites
6
+ You must be using React Native v0.64 or higher.
7
+
8
+ ## Installation
9
+
10
+ ```sh
11
+ npm install @rownd/react-native
12
+ ```
13
+
14
+ ## Setup
15
+ Rownd's React Native library uses several Expo modules to improve the overall experience. Some of these modules
16
+ have native bindings, so you won't be able to use a fully-managed Expo-based app. If you're running a bare project
17
+ or have used `expo prebuild`, then you should be fine.
18
+
19
+ ### Install Expo
20
+ Run `npx install-expo-modules@latest` to ensure that dependent Expo modules are configured correctly.
21
+
22
+ ### Install Gesture Handler
23
+ If you don't already use it, run `npx expo install react-native-gesture-handler`.
24
+
25
+ Include it within your app's root, wrapping your component tree like this:
26
+
27
+ ```tsx
28
+ import { GestureHandlerRootView } from 'react-native-gesture-handler';
29
+
30
+ // ...
31
+
32
+ export default function Root() {
33
+ return (
34
+ <GestureHandlerRootView>
35
+ <App />
36
+ </GestureHandlerRootView>
37
+ );
38
+ }
39
+ ```
40
+
41
+ ## Usage
42
+ The Rownd SDK includes a context provider that will enable any component of your app to access authentication state and user data.
43
+
44
+ Before you can use the SDK, you'll need to obtain an App Key from the [Rownd Dashboard](https://app.rownd.io).
45
+
46
+ ```tsx
47
+ import { RowndProvider } from "@rownd/react-native";
48
+
49
+ // ...
50
+
51
+ export default function Root() {
52
+ return (
53
+ <GestureHandlerRootView>
54
+ <RowndProvider appKey="<your app key>">
55
+ <App />
56
+ </RowndProvider>
57
+ </GestureHandlerRootView>
58
+ );
59
+ }
60
+ ```
61
+
62
+ Later on within your app's components, you can use the Rownd hook to access the Rownd browser API:
63
+
64
+ ```tsx
65
+ import { View, Text } from 'react-native';
66
+ import { useRownd } from '@rownd/react';
67
+
68
+ export default function MyProtectedComponent(props) {
69
+ const { is_authenticated, user, requestSignIn, getAccessToken } = useRownd();
70
+
71
+ // You can also request a sign in without a user pressing a button
72
+ // by calling requestSignIn() from a useEffect callback.
73
+ // useEffect(() => {
74
+ // if (!is_authenticated) {
75
+ // requestSignIn();
76
+ // }
77
+ // }, [is_authenticated]);
78
+
79
+ return (
80
+ <View>
81
+ {is_authenticated ? (
82
+ <>
83
+ <h1>Welcome {user.data.first_name}</h1>
84
+ <button onClick={() => getAccessToken()}>Get access token</button>
85
+ </>
86
+ ) : (
87
+ <>
88
+ <Text>Please sign in to continue</Text>
89
+ <Pressable onPress={() => requestSignIn()}>
90
+ <Text>Sign in</Text>
91
+ </Pressable>
92
+ </>
93
+ )}
94
+ </View>
95
+ );
96
+ }
97
+ ```
98
+
99
+ ## API reference
100
+
101
+ Most API methods are made available via the Rownd Provider and its associated `useRownd` React hook. Unless otherwise noted, we're assuming that you're using hooks.
102
+
103
+ #### requestSignIn()
104
+
105
+ Trigger the Rownd sign in dialog
106
+
107
+ ```javascript
108
+ const { requestSignIn } = useRownd();
109
+
110
+ requestSignIn({
111
+ auto_sign_in: false, // optional
112
+ identifier: 'me@company.com' || '+19105551212' // optional
113
+ });
114
+ ```
115
+
116
+ * `auto_sign_in: boolean` - when `true`, automatically trigger a sign-in attempt _if_ `identifier` is included or an email address or phone number has already been set in the user data.
117
+ * `identifier: string` - an email address or phone number (in E164 format) to which a verification message may be sent. If the Rownd app is configured to allow unverified users, then sign-in will complete without verification if the user has not signed in previously.
118
+
119
+ #### signOut()
120
+
121
+ Sign out the user and clear their profile, returning them to a completely unauthenticated state.
122
+
123
+ ```javascript
124
+ const { signOut } = useRownd();
125
+ signOut();
126
+ ```
127
+
128
+ #### **getAccessToken()**
129
+
130
+ Retrieves the active, valid access token for the current user.&#x20;
131
+
132
+ ```javascript
133
+ const { getAccessToken } = useRownd();
134
+
135
+ let accessToken = await getAccessToken({
136
+ waitForToken: false
137
+ });
138
+ ```
139
+
140
+ * `waitForToken: boolean` - when `true`, if no access token is present or if it's expired, the promise will not resolve until a valid token is available. While unlikely, this could result in waiting forever.
141
+
142
+ #### is\_authenticated
143
+
144
+ Indicates whether the current user is signed in or not.
145
+
146
+ ```javascript
147
+ const { is_authenticated } = useRownd();
148
+
149
+ return (
150
+ <>
151
+ {is_authenticated && <ProtectedRoute />}
152
+ {!is_authenticated && <PublicRoute />}
153
+ </>
154
+ );
155
+ ```
156
+
157
+ #### access\_token
158
+
159
+ Represents the current access token for the user.
160
+
161
+ ```javascript
162
+ const { access_token } = useRownd();
163
+
164
+ useEffect(() => {
165
+ axios({
166
+ method: 'post',
167
+ url: '/api/sessions'
168
+ headers: {
169
+ authorization: `Bearer ${access_token}`
170
+ }
171
+ }).then(console.log);
172
+ }, [access_token]);
173
+ ```
174
+
175
+ #### user
176
+
177
+ Represents information about the current user, specifically their profile information. In the example below, we use the existing data to display the current value of `first_name` in a form field, update a local copy of that data as the user changes it, and then save the changes to Rownd once the user submits the form.
178
+
179
+ ```javascript
180
+ const { user } = useRownd();
181
+
182
+ return (
183
+ <form onSubmit={() => user.set(profile)}>
184
+ <Text>First name</Text>
185
+ <TextInput
186
+ value={user?.data?.first_name}
187
+ onChangeText={}
188
+ />
189
+ <Pressable onPress={}>Save</button>
190
+ </form>
191
+ );
192
+ ```
193
+
194
+ **Merge data into the user profile**
195
+
196
+ ```javascript
197
+ const { user } = useRownd();
198
+ user.set({
199
+ first_name: 'Alice',
200
+ last_name: 'Ranier'
201
+ });
202
+ ```
203
+
204
+ Set a specific field in the user profile
205
+
206
+ ```javascript
207
+ const { user } = useRownd();
208
+ user.setValue('first_name', 'Alice');
209
+ ```
210
+
211
+ ## License
212
+
213
+ Apache 2.0
@@ -0,0 +1,59 @@
1
+ buildscript {
2
+ if (project == rootProject) {
3
+ repositories {
4
+ google()
5
+ mavenCentral()
6
+ jcenter()
7
+ }
8
+
9
+ dependencies {
10
+ classpath 'com.android.tools.build:gradle:3.5.3'
11
+ }
12
+ }
13
+ }
14
+
15
+ apply plugin: 'com.android.library'
16
+
17
+ def safeExtGet(prop, fallback) {
18
+ rootProject.ext.has(prop) ? rootProject.ext.get(prop) : fallback
19
+ }
20
+
21
+ android {
22
+ compileSdkVersion safeExtGet('ReactNative_compileSdkVersion', 29)
23
+ defaultConfig {
24
+ minSdkVersion safeExtGet('ReactNative_minSdkVersion', 16)
25
+ targetSdkVersion safeExtGet('ReactNative_targetSdkVersion', 29)
26
+ versionCode 1
27
+ versionName "1.0"
28
+
29
+ }
30
+
31
+ buildTypes {
32
+ release {
33
+ minifyEnabled false
34
+ }
35
+ }
36
+ lintOptions {
37
+ disable 'GradleCompatible'
38
+ }
39
+ compileOptions {
40
+ sourceCompatibility JavaVersion.VERSION_1_8
41
+ targetCompatibility JavaVersion.VERSION_1_8
42
+ }
43
+ }
44
+
45
+ repositories {
46
+ mavenLocal()
47
+ maven {
48
+ // All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
49
+ url("$rootDir/../node_modules/react-native/android")
50
+ }
51
+ google()
52
+ mavenCentral()
53
+ jcenter()
54
+ }
55
+
56
+ dependencies {
57
+ //noinspection GradleDynamicVersion
58
+ implementation "com.facebook.react:react-native:+" // From node_modules
59
+ }
@@ -0,0 +1,4 @@
1
+ <manifest xmlns:android="http://schemas.android.com/apk/res/android"
2
+ package="com.reactnative">
3
+
4
+ </manifest>
@@ -0,0 +1,22 @@
1
+ package com.reactnative;
2
+
3
+ import com.facebook.react.ReactPackage;
4
+ import com.facebook.react.bridge.NativeModule;
5
+ import com.facebook.react.bridge.ReactApplicationContext;
6
+ import com.facebook.react.uimanager.ViewManager;
7
+
8
+ import java.util.Arrays;
9
+ import java.util.Collections;
10
+ import java.util.List;
11
+
12
+ public class ReactNativePackage implements ReactPackage {
13
+ @Override
14
+ public List<NativeModule> createNativeModules(ReactApplicationContext reactContext) {
15
+ return Collections.emptyList();
16
+ }
17
+
18
+ @Override
19
+ public List<ViewManager> createViewManagers(ReactApplicationContext reactContext) {
20
+ return Arrays.<ViewManager>asList(new ReactNativeViewManager());
21
+ }
22
+ }
@@ -0,0 +1,31 @@
1
+ package com.reactnative;
2
+
3
+ import android.graphics.Color;
4
+ import android.view.View;
5
+
6
+ import androidx.annotation.NonNull;
7
+
8
+ import com.facebook.react.uimanager.SimpleViewManager;
9
+ import com.facebook.react.uimanager.ThemedReactContext;
10
+ import com.facebook.react.uimanager.annotations.ReactProp;
11
+
12
+ public class ReactNativeViewManager extends SimpleViewManager<View> {
13
+ public static final String REACT_CLASS = "ReactNativeView";
14
+
15
+ @Override
16
+ @NonNull
17
+ public String getName() {
18
+ return REACT_CLASS;
19
+ }
20
+
21
+ @Override
22
+ @NonNull
23
+ public View createViewInstance(ThemedReactContext reactContext) {
24
+ return new View(reactContext);
25
+ }
26
+
27
+ @ReactProp(name = "color")
28
+ public void setColor(View view, String color) {
29
+ view.setBackgroundColor(Color.parseColor(color));
30
+ }
31
+ }
@@ -0,0 +1,282 @@
1
+ // !$*UTF8*$!
2
+ {
3
+ archiveVersion = 1;
4
+ classes = {
5
+ };
6
+ objectVersion = 46;
7
+ objects = {
8
+
9
+ /* Begin PBXBuildFile section */
10
+
11
+ 5E555C0D2413F4C50049A1A2 /* ReactNative.m in Sources */ = {isa = PBXBuildFile; fileRef = B3E7B5891CC2AC0600A0062D /* ReactNative.m */; };
12
+
13
+ /* End PBXBuildFile section */
14
+
15
+ /* Begin PBXCopyFilesBuildPhase section */
16
+ 58B511D91A9E6C8500147676 /* CopyFiles */ = {
17
+ isa = PBXCopyFilesBuildPhase;
18
+ buildActionMask = 2147483647;
19
+ dstPath = "include/$(PRODUCT_NAME)";
20
+ dstSubfolderSpec = 16;
21
+ files = (
22
+ );
23
+ runOnlyForDeploymentPostprocessing = 0;
24
+ };
25
+ /* End PBXCopyFilesBuildPhase section */
26
+
27
+ /* Begin PBXFileReference section */
28
+ 134814201AA4EA6300B7C361 /* libReactNative.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libReactNative.a; sourceTree = BUILT_PRODUCTS_DIR; };
29
+
30
+ B3E7B5881CC2AC0600A0062D /* ReactNative.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ReactNative.h; sourceTree = "<group>"; };
31
+ B3E7B5891CC2AC0600A0062D /* ReactNative.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ReactNative.m; sourceTree = "<group>"; };
32
+
33
+ /* End PBXFileReference section */
34
+
35
+ /* Begin PBXFrameworksBuildPhase section */
36
+ 58B511D81A9E6C8500147676 /* Frameworks */ = {
37
+ isa = PBXFrameworksBuildPhase;
38
+ buildActionMask = 2147483647;
39
+ files = (
40
+ );
41
+ runOnlyForDeploymentPostprocessing = 0;
42
+ };
43
+ /* End PBXFrameworksBuildPhase section */
44
+
45
+ /* Begin PBXGroup section */
46
+ 134814211AA4EA7D00B7C361 /* Products */ = {
47
+ isa = PBXGroup;
48
+ children = (
49
+ 134814201AA4EA6300B7C361 /* libReactNative.a */,
50
+ );
51
+ name = Products;
52
+ sourceTree = "<group>";
53
+ };
54
+ 58B511D21A9E6C8500147676 = {
55
+ isa = PBXGroup;
56
+ children = (
57
+
58
+ B3E7B5881CC2AC0600A0062D /* ReactNative.h */,
59
+ B3E7B5891CC2AC0600A0062D /* ReactNative.m */,
60
+
61
+ 134814211AA4EA7D00B7C361 /* Products */,
62
+ );
63
+ sourceTree = "<group>";
64
+ };
65
+ /* End PBXGroup section */
66
+
67
+ /* Begin PBXNativeTarget section */
68
+ 58B511DA1A9E6C8500147676 /* ReactNative */ = {
69
+ isa = PBXNativeTarget;
70
+ buildConfigurationList = 58B511EF1A9E6C8500147676 /* Build configuration list for PBXNativeTarget "ReactNative" */;
71
+ buildPhases = (
72
+ 58B511D71A9E6C8500147676 /* Sources */,
73
+ 58B511D81A9E6C8500147676 /* Frameworks */,
74
+ 58B511D91A9E6C8500147676 /* CopyFiles */,
75
+ );
76
+ buildRules = (
77
+ );
78
+ dependencies = (
79
+ );
80
+ name = ReactNative;
81
+ productName = RCTDataManager;
82
+ productReference = 134814201AA4EA6300B7C361 /* libReactNative.a */;
83
+ productType = "com.apple.product-type.library.static";
84
+ };
85
+ /* End PBXNativeTarget section */
86
+
87
+ /* Begin PBXProject section */
88
+ 58B511D31A9E6C8500147676 /* Project object */ = {
89
+ isa = PBXProject;
90
+ attributes = {
91
+ LastUpgradeCheck = 0920;
92
+ ORGANIZATIONNAME = Facebook;
93
+ TargetAttributes = {
94
+ 58B511DA1A9E6C8500147676 = {
95
+ CreatedOnToolsVersion = 6.1.1;
96
+ };
97
+ };
98
+ };
99
+ buildConfigurationList = 58B511D61A9E6C8500147676 /* Build configuration list for PBXProject "ReactNative" */;
100
+ compatibilityVersion = "Xcode 3.2";
101
+ developmentRegion = English;
102
+ hasScannedForEncodings = 0;
103
+ knownRegions = (
104
+ English,
105
+ en,
106
+ );
107
+ mainGroup = 58B511D21A9E6C8500147676;
108
+ productRefGroup = 58B511D21A9E6C8500147676;
109
+ projectDirPath = "";
110
+ projectRoot = "";
111
+ targets = (
112
+ 58B511DA1A9E6C8500147676 /* ReactNative */,
113
+ );
114
+ };
115
+ /* End PBXProject section */
116
+
117
+ /* Begin PBXSourcesBuildPhase section */
118
+ 58B511D71A9E6C8500147676 /* Sources */ = {
119
+ isa = PBXSourcesBuildPhase;
120
+ buildActionMask = 2147483647;
121
+ files = (
122
+
123
+ B3E7B58A1CC2AC0600A0062D /* ReactNative.m in Sources */,
124
+
125
+ );
126
+ runOnlyForDeploymentPostprocessing = 0;
127
+ };
128
+ /* End PBXSourcesBuildPhase section */
129
+
130
+ /* Begin XCBuildConfiguration section */
131
+ 58B511ED1A9E6C8500147676 /* Debug */ = {
132
+ isa = XCBuildConfiguration;
133
+ buildSettings = {
134
+ ALWAYS_SEARCH_USER_PATHS = NO;
135
+ CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
136
+ CLANG_CXX_LIBRARY = "libc++";
137
+ CLANG_ENABLE_MODULES = YES;
138
+ CLANG_ENABLE_OBJC_ARC = YES;
139
+ CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
140
+ CLANG_WARN_BOOL_CONVERSION = YES;
141
+ CLANG_WARN_COMMA = YES;
142
+ CLANG_WARN_CONSTANT_CONVERSION = YES;
143
+ CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
144
+ CLANG_WARN_EMPTY_BODY = YES;
145
+ CLANG_WARN_ENUM_CONVERSION = YES;
146
+ CLANG_WARN_INFINITE_RECURSION = YES;
147
+ CLANG_WARN_INT_CONVERSION = YES;
148
+ CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
149
+ CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
150
+ CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
151
+ CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
152
+ CLANG_WARN_STRICT_PROTOTYPES = YES;
153
+ CLANG_WARN_SUSPICIOUS_MOVE = YES;
154
+ CLANG_WARN_UNREACHABLE_CODE = YES;
155
+ CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
156
+ COPY_PHASE_STRIP = NO;
157
+ ENABLE_STRICT_OBJC_MSGSEND = YES;
158
+ ENABLE_TESTABILITY = YES;
159
+ GCC_C_LANGUAGE_STANDARD = gnu99;
160
+ GCC_DYNAMIC_NO_PIC = NO;
161
+ GCC_NO_COMMON_BLOCKS = YES;
162
+ GCC_OPTIMIZATION_LEVEL = 0;
163
+ GCC_PREPROCESSOR_DEFINITIONS = (
164
+ "DEBUG=1",
165
+ "$(inherited)",
166
+ );
167
+ GCC_SYMBOLS_PRIVATE_EXTERN = NO;
168
+ GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
169
+ GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
170
+ GCC_WARN_UNDECLARED_SELECTOR = YES;
171
+ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
172
+ GCC_WARN_UNUSED_FUNCTION = YES;
173
+ GCC_WARN_UNUSED_VARIABLE = YES;
174
+ IPHONEOS_DEPLOYMENT_TARGET = 8.0;
175
+ MTL_ENABLE_DEBUG_INFO = YES;
176
+ ONLY_ACTIVE_ARCH = YES;
177
+ SDKROOT = iphoneos;
178
+ };
179
+ name = Debug;
180
+ };
181
+ 58B511EE1A9E6C8500147676 /* Release */ = {
182
+ isa = XCBuildConfiguration;
183
+ buildSettings = {
184
+ ALWAYS_SEARCH_USER_PATHS = NO;
185
+ CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
186
+ CLANG_CXX_LIBRARY = "libc++";
187
+ CLANG_ENABLE_MODULES = YES;
188
+ CLANG_ENABLE_OBJC_ARC = YES;
189
+ CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
190
+ CLANG_WARN_BOOL_CONVERSION = YES;
191
+ CLANG_WARN_COMMA = YES;
192
+ CLANG_WARN_CONSTANT_CONVERSION = YES;
193
+ CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
194
+ CLANG_WARN_EMPTY_BODY = YES;
195
+ CLANG_WARN_ENUM_CONVERSION = YES;
196
+ CLANG_WARN_INFINITE_RECURSION = YES;
197
+ CLANG_WARN_INT_CONVERSION = YES;
198
+ CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
199
+ CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
200
+ CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
201
+ CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
202
+ CLANG_WARN_STRICT_PROTOTYPES = YES;
203
+ CLANG_WARN_SUSPICIOUS_MOVE = YES;
204
+ CLANG_WARN_UNREACHABLE_CODE = YES;
205
+ CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
206
+ COPY_PHASE_STRIP = YES;
207
+ ENABLE_NS_ASSERTIONS = NO;
208
+ ENABLE_STRICT_OBJC_MSGSEND = YES;
209
+ GCC_C_LANGUAGE_STANDARD = gnu99;
210
+ GCC_NO_COMMON_BLOCKS = YES;
211
+ GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
212
+ GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
213
+ GCC_WARN_UNDECLARED_SELECTOR = YES;
214
+ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
215
+ GCC_WARN_UNUSED_FUNCTION = YES;
216
+ GCC_WARN_UNUSED_VARIABLE = YES;
217
+ IPHONEOS_DEPLOYMENT_TARGET = 8.0;
218
+ MTL_ENABLE_DEBUG_INFO = NO;
219
+ SDKROOT = iphoneos;
220
+ VALIDATE_PRODUCT = YES;
221
+ };
222
+ name = Release;
223
+ };
224
+ 58B511F01A9E6C8500147676 /* Debug */ = {
225
+ isa = XCBuildConfiguration;
226
+ buildSettings = {
227
+ HEADER_SEARCH_PATHS = (
228
+ "$(inherited)",
229
+ /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include,
230
+ "$(SRCROOT)/../../../React/**",
231
+ "$(SRCROOT)/../../react-native/React/**",
232
+ );
233
+ LIBRARY_SEARCH_PATHS = "$(inherited)";
234
+ OTHER_LDFLAGS = "-ObjC";
235
+ PRODUCT_NAME = ReactNative;
236
+ SKIP_INSTALL = YES;
237
+
238
+ };
239
+ name = Debug;
240
+ };
241
+ 58B511F11A9E6C8500147676 /* Release */ = {
242
+ isa = XCBuildConfiguration;
243
+ buildSettings = {
244
+ HEADER_SEARCH_PATHS = (
245
+ "$(inherited)",
246
+ /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include,
247
+ "$(SRCROOT)/../../../React/**",
248
+ "$(SRCROOT)/../../react-native/React/**",
249
+ );
250
+ LIBRARY_SEARCH_PATHS = "$(inherited)";
251
+ OTHER_LDFLAGS = "-ObjC";
252
+ PRODUCT_NAME = ReactNative;
253
+ SKIP_INSTALL = YES;
254
+
255
+ };
256
+ name = Release;
257
+ };
258
+ /* End XCBuildConfiguration section */
259
+
260
+ /* Begin XCConfigurationList section */
261
+ 58B511D61A9E6C8500147676 /* Build configuration list for PBXProject "ReactNative" */ = {
262
+ isa = XCConfigurationList;
263
+ buildConfigurations = (
264
+ 58B511ED1A9E6C8500147676 /* Debug */,
265
+ 58B511EE1A9E6C8500147676 /* Release */,
266
+ );
267
+ defaultConfigurationIsVisible = 0;
268
+ defaultConfigurationName = Release;
269
+ };
270
+ 58B511EF1A9E6C8500147676 /* Build configuration list for PBXNativeTarget "ReactNative" */ = {
271
+ isa = XCConfigurationList;
272
+ buildConfigurations = (
273
+ 58B511F01A9E6C8500147676 /* Debug */,
274
+ 58B511F11A9E6C8500147676 /* Release */,
275
+ );
276
+ defaultConfigurationIsVisible = 0;
277
+ defaultConfigurationName = Release;
278
+ };
279
+ /* End XCConfigurationList section */
280
+ };
281
+ rootObject = 58B511D31A9E6C8500147676 /* Project object */;
282
+ }
@@ -0,0 +1,4 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <Workspace
3
+ version = "1.0">
4
+ </Workspace>
@@ -0,0 +1,34 @@
1
+ #import <React/RCTViewManager.h>
2
+
3
+ @interface ReactNativeViewManager : RCTViewManager
4
+ @end
5
+
6
+ @implementation ReactNativeViewManager
7
+
8
+ RCT_EXPORT_MODULE(ReactNativeView)
9
+
10
+ - (UIView *)view
11
+ {
12
+ return [[UIView alloc] init];
13
+ }
14
+
15
+ RCT_CUSTOM_VIEW_PROPERTY(color, NSString, UIView)
16
+ {
17
+ [view setBackgroundColor:[self hexStringToColor:json]];
18
+ }
19
+
20
+ - hexStringToColor:(NSString *)stringToConvert
21
+ {
22
+ NSString *noHashString = [stringToConvert stringByReplacingOccurrencesOfString:@"#" withString:@""];
23
+ NSScanner *stringScanner = [NSScanner scannerWithString:noHashString];
24
+
25
+ unsigned hex;
26
+ if (![stringScanner scanHexInt:&hex]) return nil;
27
+ int r = (hex >> 16) & 0xFF;
28
+ int g = (hex >> 8) & 0xFF;
29
+ int b = (hex) & 0xFF;
30
+
31
+ return [UIColor colorWithRed:r / 255.0f green:g / 255.0f blue:b / 255.0f alpha:1.0f];
32
+ }
33
+
34
+ @end
@@ -0,0 +1,12 @@
1
+ <svg id="icon" xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32">
2
+ <defs>
3
+ <style>
4
+ .cls-1 {
5
+ fill: none;
6
+ }
7
+ </style>
8
+ </defs>
9
+ <path d="M16,2A14,14,0,1,0,30,16,14,14,0,0,0,16,2ZM14,21.5908l-5-5L10.5906,15,14,18.4092,21.41,11l1.5957,1.5859Z"/>
10
+ <polygon id="inner-path" class="cls-1" points="14 21.591 9 16.591 10.591 15 14 18.409 21.41 11 23.005 12.585 14 21.591"/>
11
+ <rect id="_Transparent_Rectangle_" data-name="&lt;Transparent Rectangle&gt;" class="cls-1" width="32" height="32"/>
12
+ </svg>