pushwoosh-react-native-plugin 6.1.40 → 6.1.42

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 (88) hide show
  1. package/docs/README.md +20 -0
  2. package/index.d.ts +4 -0
  3. package/index.js +33 -0
  4. package/package.json +1 -1
  5. package/pushwoosh-react-native-plugin.podspec +2 -2
  6. package/src/android/.gradle/5.6.4/fileChanges/last-build.bin +0 -0
  7. package/src/android/.gradle/5.6.4/fileHashes/fileHashes.lock +0 -0
  8. package/src/android/.gradle/5.6.4/gc.properties +0 -0
  9. package/src/android/.gradle/vcs-1/gc.properties +0 -0
  10. package/src/android/build.gradle +1 -1
  11. package/src/android/src/main/java/com/pushwoosh/reactnativeplugin/PushwooshPlugin.java +10 -0
  12. package/src/ios/PushwooshPlugin/Pushwoosh.m +8 -0
  13. package/.github/ISSUE_TEMPLATE/bug_report.yml +0 -151
  14. package/.github/ISSUE_TEMPLATE/feature_request.yml +0 -31
  15. package/.github/ISSUE_TEMPLATE/question.yml +0 -28
  16. package/example/LICENSE +0 -21
  17. package/example/README.md +0 -58
  18. package/example/Screenshots/Android_1.png +0 -0
  19. package/example/Screenshots/Android_2.png +0 -0
  20. package/example/Screenshots/iOS_1.png +0 -0
  21. package/example/Screenshots/iOS_2.png +0 -0
  22. package/example/demoapp/.bundle/config +0 -2
  23. package/example/demoapp/.eslintrc.js +0 -4
  24. package/example/demoapp/.prettierrc.js +0 -7
  25. package/example/demoapp/.watchmanconfig +0 -1
  26. package/example/demoapp/Actions.js +0 -302
  27. package/example/demoapp/App.tsx +0 -118
  28. package/example/demoapp/Gemfile +0 -9
  29. package/example/demoapp/Gemfile.lock +0 -105
  30. package/example/demoapp/README.md +0 -79
  31. package/example/demoapp/Settings.js +0 -126
  32. package/example/demoapp/__tests__/App.test.tsx +0 -17
  33. package/example/demoapp/android/app/build.gradle +0 -118
  34. package/example/demoapp/android/app/debug.keystore +0 -0
  35. package/example/demoapp/android/app/proguard-rules.pro +0 -10
  36. package/example/demoapp/android/app/src/debug/AndroidManifest.xml +0 -9
  37. package/example/demoapp/android/app/src/main/AndroidManifest.xml +0 -25
  38. package/example/demoapp/android/app/src/main/java/com/demoapp/MainActivity.kt +0 -22
  39. package/example/demoapp/android/app/src/main/java/com/demoapp/MainApplication.kt +0 -43
  40. package/example/demoapp/android/app/src/main/res/drawable/rn_edit_text_material.xml +0 -37
  41. package/example/demoapp/android/app/src/main/res/mipmap-hdpi/ic_launcher.png +0 -0
  42. package/example/demoapp/android/app/src/main/res/mipmap-hdpi/ic_launcher_round.png +0 -0
  43. package/example/demoapp/android/app/src/main/res/mipmap-mdpi/ic_launcher.png +0 -0
  44. package/example/demoapp/android/app/src/main/res/mipmap-mdpi/ic_launcher_round.png +0 -0
  45. package/example/demoapp/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png +0 -0
  46. package/example/demoapp/android/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png +0 -0
  47. package/example/demoapp/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png +0 -0
  48. package/example/demoapp/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png +0 -0
  49. package/example/demoapp/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png +0 -0
  50. package/example/demoapp/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png +0 -0
  51. package/example/demoapp/android/app/src/main/res/values/strings.xml +0 -3
  52. package/example/demoapp/android/app/src/main/res/values/styles.xml +0 -9
  53. package/example/demoapp/android/build.gradle +0 -21
  54. package/example/demoapp/android/gradle/wrapper/gradle-wrapper.jar +0 -0
  55. package/example/demoapp/android/gradle/wrapper/gradle-wrapper.properties +0 -7
  56. package/example/demoapp/android/gradle.properties +0 -41
  57. package/example/demoapp/android/gradlew +0 -249
  58. package/example/demoapp/android/gradlew.bat +0 -92
  59. package/example/demoapp/android/settings.gradle +0 -4
  60. package/example/demoapp/app.json +0 -4
  61. package/example/demoapp/babel.config.js +0 -3
  62. package/example/demoapp/index.js +0 -46
  63. package/example/demoapp/ios/.xcode.env +0 -11
  64. package/example/demoapp/ios/NotificationService/Info.plist +0 -15
  65. package/example/demoapp/ios/NotificationService/NotificationService.entitlements +0 -8
  66. package/example/demoapp/ios/NotificationService/NotificationService.swift +0 -38
  67. package/example/demoapp/ios/Podfile +0 -40
  68. package/example/demoapp/ios/demoapp/AppDelegate.h +0 -6
  69. package/example/demoapp/ios/demoapp/AppDelegate.mm +0 -31
  70. package/example/demoapp/ios/demoapp/Images.xcassets/AppIcon.appiconset/Contents.json +0 -53
  71. package/example/demoapp/ios/demoapp/Images.xcassets/Contents.json +0 -6
  72. package/example/demoapp/ios/demoapp/Info.plist +0 -57
  73. package/example/demoapp/ios/demoapp/LaunchScreen.storyboard +0 -47
  74. package/example/demoapp/ios/demoapp/PrivacyInfo.xcprivacy +0 -37
  75. package/example/demoapp/ios/demoapp/demoapp.entitlements +0 -10
  76. package/example/demoapp/ios/demoapp/main.m +0 -10
  77. package/example/demoapp/ios/demoapp.xcodeproj/project.pbxproj +0 -937
  78. package/example/demoapp/ios/demoapp.xcodeproj/xcshareddata/xcschemes/demoapp.xcscheme +0 -88
  79. package/example/demoapp/ios/demoapp.xcworkspace/contents.xcworkspacedata +0 -10
  80. package/example/demoapp/ios/demoapp.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +0 -8
  81. package/example/demoapp/ios/demoappTests/Info.plist +0 -24
  82. package/example/demoapp/ios/demoappTests/demoappTests.m +0 -66
  83. package/example/demoapp/jest.config.js +0 -3
  84. package/example/demoapp/logos.png +0 -0
  85. package/example/demoapp/metro.config.js +0 -20
  86. package/example/demoapp/package.json +0 -42
  87. package/example/demoapp/tsconfig.json +0 -3
  88. package/example/demoapp/yarn.lock +0 -7153
@@ -1,302 +0,0 @@
1
- import React, { useState } from 'react';
2
- import { View, StyleSheet, TextInput, ScrollView, TouchableOpacity, Text, Image, Alert } from 'react-native';
3
- import Pushwoosh from 'pushwoosh-react-native-plugin';
4
-
5
- const ButtonWithTextInput = ({ buttonText, onPress, placeholder1, placeholder2 }) => {
6
- const [inputValue1, setInputValue1] = useState('');
7
- const [inputValue2, setInputValue2] = useState('');
8
-
9
- const handlePress = () => {
10
- onPress(inputValue1, inputValue2);
11
- };
12
-
13
- return (
14
- <View style={styles.header}>
15
- <TouchableOpacity
16
- style={[styles.button, { flex: 1 }]}
17
- onPress={handlePress}
18
- >
19
- <Text style={styles.buttonText}>{buttonText}</Text>
20
- </TouchableOpacity>
21
- {placeholder1 && (
22
- <TextInput
23
- style={[styles.textField, { flex: 1, marginRight: 5 }]}
24
- placeholder={placeholder1}
25
- value={inputValue1}
26
- onChangeText={text => setInputValue1(text)}
27
- />
28
- )}
29
- {placeholder2 && (
30
- <TextInput
31
- style={[styles.textField, { flex: 1 }]}
32
- placeholder={placeholder2}
33
- value={inputValue2}
34
- onChangeText={text => setInputValue2(text)}
35
- />
36
- )}
37
- </View>
38
- );
39
- };
40
-
41
- const Button = ({ buttonText, onPress }) => {
42
- return (
43
- <View style={styles.header}>
44
- <TouchableOpacity
45
- style={[styles.button, { flex: 1 }]}
46
- onPress={onPress}
47
- >
48
- <Text style={styles.buttonText}>{buttonText}</Text>
49
- </TouchableOpacity>
50
- </View>
51
- );
52
- };
53
-
54
- const Actions = () => {
55
- return (
56
- <ScrollView contentContainerStyle={styles.container}>
57
- <View style={styles.imageContainer}>
58
- <Image
59
- source={require('./logos.png')}
60
- style={styles.image}
61
- />
62
- </View>
63
- <ButtonWithTextInput buttonText="SET USER ID" onPress={(inputValue1) => {
64
- /**
65
- * Set User indentifier. This could be Facebook ID, username or email, or any other user ID.
66
- * This allows data and events to be matched across multiple user devices.
67
- *
68
- * PUSHWOOSH CODE
69
- * | |
70
- * _| |_
71
- * \ /
72
- * \ /
73
- * \_/
74
- */
75
- Pushwoosh.setUserId(inputValue1,
76
- () => {
77
- console.log("User ID was successfully set.");
78
- },
79
- (error) => {
80
- console.error("Failed to set User ID:", error);
81
- }
82
- );
83
- }} placeholder1="USER ID" />
84
-
85
- <ButtonWithTextInput buttonText="POST EVENT" onPress={(inputValue1) => {
86
- /**
87
- * Post events for In-App Messages. This can trigger In-App message HTML as specified in Pushwoosh Control Panel.
88
- * [event] is string name of the event
89
- * [attributes] is map contains additional event attributes
90
- *
91
- * PUSHWOOSH CODE
92
- * | |
93
- * _| |_
94
- * \ /
95
- * \ /
96
- * \_/
97
- */
98
- Pushwoosh.postEvent(inputValue1, { attribute1: "value1", attribute2: "value2" });
99
- }} placeholder1="EVENT NAME" />
100
-
101
- <ButtonWithTextInput buttonText="SET LANGUAGE" onPress={(inputValue1) => {
102
- /**
103
- * setLanguage(language: string): void; method
104
- *
105
- * PUSHWOOSH CODE
106
- * | |
107
- * _| |_
108
- * \ /
109
- * \ /
110
- * \_/
111
- */
112
- Pushwoosh.setLanguage(inputValue1);
113
- }} placeholder1="en" />
114
-
115
- <ButtonWithTextInput buttonText="SET TAGS" onPress={(inputValue1, inputValue2) => {
116
- /**
117
- * Associates device with given [tags]. If setTags request fails tags will be resent on the next application launch.
118
- *
119
- * PUSHWOOSH CODE
120
- * | |
121
- * _| |_
122
- * \ /
123
- * \ /
124
- * \_/
125
- */
126
- Pushwoosh.setTags({ 'tags': inputValue1, 'value': inputValue2 },
127
- () => {
128
- console.log("Tags were successfully set.");
129
-
130
- },
131
- (error) => {
132
- console.error("Failed to set tags:", error);
133
- });
134
- }} placeholder1="KEY" placeholder2="VALUE" />
135
-
136
- <ButtonWithTextInput buttonText="USER EMAILS" onPress={(inputValue1, inputValue2) => {
137
- /**
138
- * SET USER EMAILS
139
- * setUserEmails(userId: string, emails: (string | string[]), success?: () => void, fail?: (error: Error) => void): void;
140
- *
141
- * PUSHWOOSH CODE
142
- * | |
143
- * _| |_
144
- * \ /
145
- * \ /
146
- * \_/
147
- */
148
- Pushwoosh.setUserEmails(
149
- inputValue1,
150
- [inputValue2],
151
- () => {
152
- console.log("User emails were successfully set.");
153
- },
154
- (error) => {
155
- console.error("Failed to set user emails:", error);
156
- }
157
- );
158
- }} placeholder1="USER" placeholder2="EMAILS" />
159
- <ButtonWithTextInput buttonText="SET EMAILS" onPress={(inputValue1) => {
160
- /**
161
- * SET EMAILS
162
- * setEmails(emails: (string | string[]), success?: () => void, fail?: (error: Error) => void): void;
163
- *
164
- * PUSHWOOSH CODE
165
- * | |
166
- * _| |_
167
- * \ /
168
- * \ /
169
- * \_/
170
- */
171
- Pushwoosh.setEmails( [inputValue1],
172
- () => {
173
- console.log("Emails were successfully set.");
174
- },
175
- (error) => {
176
- console.error("Failed to set emails:", error);
177
- }
178
- );
179
- }} placeholder1="EMAILS" />
180
-
181
- <Button buttonText="GET HWID" onPress={() => {
182
- /**
183
- * Pushwoosh HWID associated with current device
184
- *
185
- * PUSHWOOSH CODE
186
- * | |
187
- * _| |_
188
- * \ /
189
- * \ /
190
- * \_/
191
- */
192
- Pushwoosh.getHwid((hwid) => {
193
- Alert.alert('HWID: ', hwid);
194
- });
195
- }}/>
196
-
197
- <Button buttonText="GET PUSH TOKEN" onPress={() => {
198
- /**
199
- * Push notification token or null if device is not registered yet.
200
- *
201
- * PUSHWOOSH CODE
202
- * | |
203
- * _| |_
204
- * \ /
205
- * \ /
206
- * \_/
207
- */
208
- Pushwoosh.getPushToken((token) => {
209
- Alert.alert('PUSH TOKEN: ', token);
210
- });
211
- }}/>
212
- <Button buttonText="GET USER ID" onPress={() => {
213
- /**
214
- * GET USER ID
215
- *
216
- * PUSHWOOSH CODE
217
- * | |
218
- * _| |_
219
- * \ /
220
- * \ /
221
- * \_/
222
- */
223
- Pushwoosh.getUserId((userId) => {
224
- Alert.alert('USER ID: ', userId);
225
- });
226
- }}/>
227
- <Button
228
- buttonText="SHOW PUSH NOTIFICATION ALERT" onPress={() => {
229
- /**
230
- * GET SHOW PUSH NOTIFICATION ALERT STATE
231
- *
232
- * PUSHWOOSH CODE
233
- * | |
234
- * _| |_
235
- * \ /
236
- * \ /
237
- * \_/
238
- */
239
- Pushwoosh.getShowPushnotificationAlert((willShow) => {
240
- if (willShow) {
241
- Alert.alert('PUSH NOTIFICATION ALERT ENABLED');
242
- } else {
243
- Alert.alert('PUSH NOTIFICATION ALERT DISABLED');
244
- }
245
- });
246
- }}
247
- />
248
- </ScrollView>
249
- );
250
- };
251
-
252
- const styles = StyleSheet.create({
253
- container: {
254
- flexGrow: 1,
255
- backgroundColor: '#ffffff',
256
- alignItems: 'center',
257
- },
258
- header: {
259
- flexDirection: 'row',
260
- justifyContent: 'space-between',
261
- paddingHorizontal: 20,
262
- paddingVertical: 10,
263
- },
264
- textField: {
265
- borderWidth: 1,
266
- borderColor: '#cccccc',
267
- borderRadius: 5,
268
- padding: 10,
269
- },
270
- button: {
271
- backgroundColor: '#cccccc',
272
- borderRadius: 10,
273
- paddingVertical: 10,
274
- paddingHorizontal: 20,
275
- marginRight: 10,
276
- shadowColor: '#000',
277
- shadowOffset: {
278
- width: 0,
279
- height: 2,
280
- },
281
- shadowOpacity: 0.25,
282
- shadowRadius: 3.84,
283
- elevation: 5,
284
- },
285
- buttonText: {
286
- color: '#800080',
287
- fontWeight: 'bold',
288
- textAlign: 'center',
289
- },
290
- imageContainer: {
291
- justifyContent: 'center',
292
- alignItems: 'center',
293
- marginTop: 20,
294
- },
295
- image: {
296
- width: 75,
297
- height: 75,
298
- borderRadius: 20
299
- },
300
- });
301
-
302
- export default Actions;
@@ -1,118 +0,0 @@
1
- /**
2
- * Sample React Native App
3
- * https://github.com/facebook/react-native
4
- *
5
- * @format
6
- */
7
-
8
- import React from 'react';
9
- import type {PropsWithChildren} from 'react';
10
- import {
11
- SafeAreaView,
12
- ScrollView,
13
- StatusBar,
14
- StyleSheet,
15
- Text,
16
- useColorScheme,
17
- View,
18
- } from 'react-native';
19
-
20
- import {
21
- Colors,
22
- DebugInstructions,
23
- Header,
24
- LearnMoreLinks,
25
- ReloadInstructions,
26
- } from 'react-native/Libraries/NewAppScreen';
27
-
28
- type SectionProps = PropsWithChildren<{
29
- title: string;
30
- }>;
31
-
32
- function Section({children, title}: SectionProps): React.JSX.Element {
33
- const isDarkMode = useColorScheme() === 'dark';
34
- return (
35
- <View style={styles.sectionContainer}>
36
- <Text
37
- style={[
38
- styles.sectionTitle,
39
- {
40
- color: isDarkMode ? Colors.white : Colors.black,
41
- },
42
- ]}>
43
- {title}
44
- </Text>
45
- <Text
46
- style={[
47
- styles.sectionDescription,
48
- {
49
- color: isDarkMode ? Colors.light : Colors.dark,
50
- },
51
- ]}>
52
- {children}
53
- </Text>
54
- </View>
55
- );
56
- }
57
-
58
- function App(): React.JSX.Element {
59
- const isDarkMode = useColorScheme() === 'dark';
60
-
61
- const backgroundStyle = {
62
- backgroundColor: isDarkMode ? Colors.darker : Colors.lighter,
63
- };
64
-
65
- return (
66
- <SafeAreaView style={backgroundStyle}>
67
- <StatusBar
68
- barStyle={isDarkMode ? 'light-content' : 'dark-content'}
69
- backgroundColor={backgroundStyle.backgroundColor}
70
- />
71
- <ScrollView
72
- contentInsetAdjustmentBehavior="automatic"
73
- style={backgroundStyle}>
74
- <Header />
75
- <View
76
- style={{
77
- backgroundColor: isDarkMode ? Colors.black : Colors.white,
78
- }}>
79
- <Section title="Step One">
80
- Edit <Text style={styles.highlight}>App.tsx</Text> to change this
81
- screen and then come back to see your edits.
82
- </Section>
83
- <Section title="See Your Changes">
84
- <ReloadInstructions />
85
- </Section>
86
- <Section title="Debug">
87
- <DebugInstructions />
88
- </Section>
89
- <Section title="Learn More">
90
- Read the docs to discover what to do next:
91
- </Section>
92
- <LearnMoreLinks />
93
- </View>
94
- </ScrollView>
95
- </SafeAreaView>
96
- );
97
- }
98
-
99
- const styles = StyleSheet.create({
100
- sectionContainer: {
101
- marginTop: 32,
102
- paddingHorizontal: 24,
103
- },
104
- sectionTitle: {
105
- fontSize: 24,
106
- fontWeight: '600',
107
- },
108
- sectionDescription: {
109
- marginTop: 8,
110
- fontSize: 18,
111
- fontWeight: '400',
112
- },
113
- highlight: {
114
- fontWeight: '700',
115
- },
116
- });
117
-
118
- export default App;
@@ -1,9 +0,0 @@
1
- source 'https://rubygems.org'
2
-
3
- # You may use http://rbenv.org/ or https://rvm.io/ to install and use this version
4
- ruby ">= 2.6.10"
5
-
6
- # Cocoapods 1.15 introduced a bug which break the build. We will remove the upper
7
- # bound in the template on Cocoapods with next React Native release.
8
- gem 'cocoapods', '>= 1.13', '< 1.15'
9
- gem 'activesupport', '>= 6.1.7.5', '< 7.1.0'
@@ -1,105 +0,0 @@
1
- GEM
2
- remote: https://rubygems.org/
3
- specs:
4
- CFPropertyList (3.0.7)
5
- base64
6
- nkf
7
- rexml
8
- activesupport (6.1.7.7)
9
- concurrent-ruby (~> 1.0, >= 1.0.2)
10
- i18n (>= 1.6, < 2)
11
- minitest (>= 5.1)
12
- tzinfo (~> 2.0)
13
- zeitwerk (~> 2.3)
14
- addressable (2.8.6)
15
- public_suffix (>= 2.0.2, < 6.0)
16
- algoliasearch (1.27.5)
17
- httpclient (~> 2.8, >= 2.8.3)
18
- json (>= 1.5.1)
19
- atomos (0.1.3)
20
- base64 (0.2.0)
21
- claide (1.1.0)
22
- cocoapods (1.14.3)
23
- addressable (~> 2.8)
24
- claide (>= 1.0.2, < 2.0)
25
- cocoapods-core (= 1.14.3)
26
- cocoapods-deintegrate (>= 1.0.3, < 2.0)
27
- cocoapods-downloader (>= 2.1, < 3.0)
28
- cocoapods-plugins (>= 1.0.0, < 2.0)
29
- cocoapods-search (>= 1.0.0, < 2.0)
30
- cocoapods-trunk (>= 1.6.0, < 2.0)
31
- cocoapods-try (>= 1.1.0, < 2.0)
32
- colored2 (~> 3.1)
33
- escape (~> 0.0.4)
34
- fourflusher (>= 2.3.0, < 3.0)
35
- gh_inspector (~> 1.0)
36
- molinillo (~> 0.8.0)
37
- nap (~> 1.0)
38
- ruby-macho (>= 2.3.0, < 3.0)
39
- xcodeproj (>= 1.23.0, < 2.0)
40
- cocoapods-core (1.14.3)
41
- activesupport (>= 5.0, < 8)
42
- addressable (~> 2.8)
43
- algoliasearch (~> 1.0)
44
- concurrent-ruby (~> 1.1)
45
- fuzzy_match (~> 2.0.4)
46
- nap (~> 1.0)
47
- netrc (~> 0.11)
48
- public_suffix (~> 4.0)
49
- typhoeus (~> 1.0)
50
- cocoapods-deintegrate (1.0.5)
51
- cocoapods-downloader (2.1)
52
- cocoapods-plugins (1.0.0)
53
- nap
54
- cocoapods-search (1.0.1)
55
- cocoapods-trunk (1.6.0)
56
- nap (>= 0.8, < 2.0)
57
- netrc (~> 0.11)
58
- cocoapods-try (1.2.0)
59
- colored2 (3.1.2)
60
- concurrent-ruby (1.2.3)
61
- escape (0.0.4)
62
- ethon (0.16.0)
63
- ffi (>= 1.15.0)
64
- ffi (1.16.3)
65
- fourflusher (2.3.1)
66
- fuzzy_match (2.0.4)
67
- gh_inspector (1.1.3)
68
- httpclient (2.8.3)
69
- i18n (1.14.5)
70
- concurrent-ruby (~> 1.0)
71
- json (2.7.2)
72
- minitest (5.22.3)
73
- molinillo (0.8.0)
74
- nanaimo (0.3.0)
75
- nap (1.1.0)
76
- netrc (0.11.0)
77
- nkf (0.2.0)
78
- public_suffix (4.0.7)
79
- rexml (3.2.6)
80
- ruby-macho (2.5.1)
81
- typhoeus (1.4.1)
82
- ethon (>= 0.9.0)
83
- tzinfo (2.0.6)
84
- concurrent-ruby (~> 1.0)
85
- xcodeproj (1.24.0)
86
- CFPropertyList (>= 2.3.3, < 4.0)
87
- atomos (~> 0.1.3)
88
- claide (>= 1.0.2, < 2.0)
89
- colored2 (~> 3.1)
90
- nanaimo (~> 0.3.0)
91
- rexml (~> 3.2.4)
92
- zeitwerk (2.6.14)
93
-
94
- PLATFORMS
95
- ruby
96
-
97
- DEPENDENCIES
98
- activesupport (>= 6.1.7.5, < 7.1.0)
99
- cocoapods (>= 1.13, < 1.15)
100
-
101
- RUBY VERSION
102
- ruby 2.6.10p210
103
-
104
- BUNDLED WITH
105
- 1.17.2
@@ -1,79 +0,0 @@
1
- This is a new [**React Native**](https://reactnative.dev) project, bootstrapped using [`@react-native-community/cli`](https://github.com/react-native-community/cli).
2
-
3
- # Getting Started
4
-
5
- >**Note**: Make sure you have completed the [React Native - Environment Setup](https://reactnative.dev/docs/environment-setup) instructions till "Creating a new application" step, before proceeding.
6
-
7
- ## Step 1: Start the Metro Server
8
-
9
- First, you will need to start **Metro**, the JavaScript _bundler_ that ships _with_ React Native.
10
-
11
- To start Metro, run the following command from the _root_ of your React Native project:
12
-
13
- ```bash
14
- # using npm
15
- npm start
16
-
17
- # OR using Yarn
18
- yarn start
19
- ```
20
-
21
- ## Step 2: Start your Application
22
-
23
- Let Metro Bundler run in its _own_ terminal. Open a _new_ terminal from the _root_ of your React Native project. Run the following command to start your _Android_ or _iOS_ app:
24
-
25
- ### For Android
26
-
27
- ```bash
28
- # using npm
29
- npm run android
30
-
31
- # OR using Yarn
32
- yarn android
33
- ```
34
-
35
- ### For iOS
36
-
37
- ```bash
38
- # using npm
39
- npm run ios
40
-
41
- # OR using Yarn
42
- yarn ios
43
- ```
44
-
45
- If everything is set up _correctly_, you should see your new app running in your _Android Emulator_ or _iOS Simulator_ shortly provided you have set up your emulator/simulator correctly.
46
-
47
- This is one way to run your app — you can also run it directly from within Android Studio and Xcode respectively.
48
-
49
- ## Step 3: Modifying your App
50
-
51
- Now that you have successfully run the app, let's modify it.
52
-
53
- 1. Open `App.tsx` in your text editor of choice and edit some lines.
54
- 2. For **Android**: Press the <kbd>R</kbd> key twice or select **"Reload"** from the **Developer Menu** (<kbd>Ctrl</kbd> + <kbd>M</kbd> (on Window and Linux) or <kbd>Cmd ⌘</kbd> + <kbd>M</kbd> (on macOS)) to see your changes!
55
-
56
- For **iOS**: Hit <kbd>Cmd ⌘</kbd> + <kbd>R</kbd> in your iOS Simulator to reload the app and see your changes!
57
-
58
- ## Congratulations! :tada:
59
-
60
- You've successfully run and modified your React Native App. :partying_face:
61
-
62
- ### Now what?
63
-
64
- - If you want to add this new React Native code to an existing application, check out the [Integration guide](https://reactnative.dev/docs/integration-with-existing-apps).
65
- - If you're curious to learn more about React Native, check out the [Introduction to React Native](https://reactnative.dev/docs/getting-started).
66
-
67
- # Troubleshooting
68
-
69
- If you can't get this to work, see the [Troubleshooting](https://reactnative.dev/docs/troubleshooting) page.
70
-
71
- # Learn More
72
-
73
- To learn more about React Native, take a look at the following resources:
74
-
75
- - [React Native Website](https://reactnative.dev) - learn more about React Native.
76
- - [Getting Started](https://reactnative.dev/docs/environment-setup) - an **overview** of React Native and how setup your environment.
77
- - [Learn the Basics](https://reactnative.dev/docs/getting-started) - a **guided tour** of the React Native **basics**.
78
- - [Blog](https://reactnative.dev/blog) - read the latest official React Native **Blog** posts.
79
- - [`@facebook/react-native`](https://github.com/facebook/react-native) - the Open Source; GitHub **repository** for React Native.