Skip to content

Commit aee387b

Browse files
oucbysfscream
authored andcommitted
feat(RNMQTTDemo): react native mqtt demo
1 parent 3bdf32d commit aee387b

File tree

74 files changed

+30269
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

74 files changed

+30269
-0
lines changed

mqtt-client-React-Native/README.md

+42
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
# mqtt-client-React-Native
2+
3+
A simple demo to show how to use mqtt with React Native.
4+
5+
6+
7+
## Prerequisites
8+
9+
* Xcode and iOS Simulator
10+
11+
12+
13+
## Installation
14+
15+
Execute the following command in the `RNMQTTDemo` directory environment
16+
17+
```shell
18+
npm install
19+
```
20+
21+
Execute the following command in the `RNMQTTDemo/ios` directory environment
22+
23+
```shell
24+
pod install
25+
```
26+
27+
28+
29+
## Run
30+
31+
In the `RNMQTTDemo` directory environment, create two new terminal windows and execute the following commands respectively
32+
33+
```shell
34+
npx react-native start
35+
```
36+
37+
```shell
38+
npx react-native run-ios
39+
```
40+
41+
42+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
2+
[android]
3+
target = Google Inc.:Google APIs:23
4+
5+
[maven_repositories]
6+
central = https://repo1.maven.org/maven2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
BUNDLE_PATH: "vendor/bundle"
2+
BUNDLE_FORCE_RUBY_PLATFORM: 1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
module.exports = {
2+
root: true,
3+
extends: '@react-native-community',
4+
};
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
[ignore]
2+
; We fork some components by platform
3+
.*/*[.]android.js
4+
5+
; Ignore "BUCK" generated dirs
6+
<PROJECT_ROOT>/\.buckd/
7+
8+
; Ignore polyfills
9+
node_modules/react-native/Libraries/polyfills/.*
10+
11+
; Flow doesn't support platforms
12+
.*/Libraries/Utilities/LoadingView.js
13+
14+
.*/node_modules/resolve/test/resolver/malformed_package_json/package\.json$
15+
16+
[untyped]
17+
.*/node_modules/@react-native-community/cli/.*/.*
18+
19+
[include]
20+
21+
[libs]
22+
node_modules/react-native/interface.js
23+
node_modules/react-native/flow/
24+
25+
[options]
26+
emoji=true
27+
28+
exact_by_default=true
29+
30+
format.bracket_spacing=false
31+
32+
module.file_ext=.js
33+
module.file_ext=.json
34+
module.file_ext=.ios.js
35+
36+
munge_underscores=true
37+
38+
module.name_mapper='^react-native/\(.*\)$' -> '<PROJECT_ROOT>/node_modules/react-native/\1'
39+
module.name_mapper='^@?[./a-zA-Z0-9$_-]+\.\(bmp\|gif\|jpg\|jpeg\|png\|psd\|svg\|webp\|m4v\|mov\|mp4\|mpeg\|mpg\|webm\|aac\|aiff\|caf\|m4a\|mp3\|wav\|html\|pdf\)$' -> '<PROJECT_ROOT>/node_modules/react-native/Libraries/Image/RelativeImageStub'
40+
41+
suppress_type=$FlowIssue
42+
suppress_type=$FlowFixMe
43+
suppress_type=$FlowFixMeProps
44+
suppress_type=$FlowFixMeState
45+
46+
[lints]
47+
sketchy-null-number=warn
48+
sketchy-null-mixed=warn
49+
sketchy-number=warn
50+
untyped-type-import=warn
51+
nonstrict-import=warn
52+
deprecated-type=warn
53+
unsafe-getters-setters=warn
54+
unnecessary-invariant=warn
55+
signature-verification-failure=warn
56+
57+
[strict]
58+
deprecated-type
59+
nonstrict-import
60+
sketchy-null
61+
unclear-type
62+
unsafe-getters-setters
63+
untyped-import
64+
untyped-type-import
65+
66+
[version]
67+
^0.170.0
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
# OSX
2+
#
3+
.DS_Store
4+
5+
# Xcode
6+
#
7+
build/
8+
*.pbxuser
9+
!default.pbxuser
10+
*.mode1v3
11+
!default.mode1v3
12+
*.mode2v3
13+
!default.mode2v3
14+
*.perspectivev3
15+
!default.perspectivev3
16+
xcuserdata
17+
*.xccheckout
18+
*.moved-aside
19+
DerivedData
20+
*.hmap
21+
*.ipa
22+
*.xcuserstate
23+
24+
# Android/IntelliJ
25+
#
26+
build/
27+
.idea
28+
.gradle
29+
local.properties
30+
*.iml
31+
*.hprof
32+
33+
# node.js
34+
#
35+
node_modules/
36+
npm-debug.log
37+
yarn-error.log
38+
39+
# BUCK
40+
buck-out/
41+
\.buckd/
42+
*.keystore
43+
!debug.keystore
44+
45+
# fastlane
46+
#
47+
# It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the
48+
# screenshots whenever they are needed.
49+
# For more information about the recommended setup visit:
50+
# https://docs.fastlane.tools/best-practices/source-control/
51+
52+
*/fastlane/report.xml
53+
*/fastlane/Preview.html
54+
*/fastlane/screenshots
55+
56+
# Bundle artifact
57+
*.jsbundle
58+
59+
# Ruby / CocoaPods
60+
/ios/Pods/
61+
/vendor/bundle/
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
module.exports = {
2+
arrowParens: 'avoid',
3+
bracketSameLine: true,
4+
bracketSpacing: false,
5+
singleQuote: true,
6+
trailingComma: 'all',
7+
};
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
2.7.4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{}

0 commit comments

Comments
 (0)