Skip to content

Commit 6f3bd53

Browse files
committed
Initial commit
0 parents  commit 6f3bd53

Some content is hidden

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

49 files changed

+7041
-0
lines changed

.gitignore

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
2+
# osx
3+
.DS_Store
4+
5+
# project
6+
node_modules/
7+
logs
8+
*.log
9+
npm-debug.log*
10+
*.idea

LICENSE

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
2+
The MIT License
3+
4+
Copyright (c) 2017- Niftylettuce LLC <[email protected]> (http://niftylettuce.com/)
5+
6+
Permission is hereby granted, free of charge, to any person obtaining a copy
7+
of this software and associated documentation files (the "Software"), to deal
8+
in the Software without restriction, including without limitation the rights
9+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10+
copies of the Software, and to permit persons to whom the Software is
11+
furnished to do so, subject to the following conditions:
12+
13+
The above copyright notice and this permission notice shall be included in all
14+
copies or substantial portions of the Software.
15+
16+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22+
SOFTWARE.

Readme.md

+74
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
2+
# React Native Phone Verification
3+
4+
[![PayPal Donate][paypal-donate-image]][paypal-donate-url]
5+
[![Slack Status][slack-image]][slack-url]
6+
[![Standard JS Style][standard-image]][standard-url]
7+
[![MIT License][license-image]][license-url]
8+
9+
The best React Native example for phone verification (an alternative to [Twitter Digits][twitter-digits]). This package was built for [CrocodileJS][crocodile-url].
10+
11+
![React Native Phone Verification][demo]
12+
13+
## Features
14+
15+
* :boom: Works with iOS and Android! :100: 100% Cross-platform baby :baby:!
16+
* :flags: Built-in country picker (uses [react-native-country-picker-modal][react-native-country-picker-modal])!
17+
* :wrench: Completely customizable form (uses [react-native-form][react-native-form], but you could also use [tcomb-form-native][tcomb-form-native])!
18+
* :crystal_ball: Spinner overlay (uses [react-native-loading-spinner-overlay][react-native-loading-spinner-overlay])!
19+
* :sparkles: Optional Android support for reading verification codes automatically (uses [react-native-android-sms-listener][react-native-android-sms-listener])!
20+
21+
## Usage
22+
23+
1. Install [React Native][react-native]:
24+
25+
```bash
26+
npm install -g react-native
27+
```
28+
29+
2. Initialize a new project:
30+
31+
```bash
32+
react-native init myproject
33+
```
34+
35+
3. Install dependencies:
36+
37+
> If you're using `npm` to install packages:
38+
39+
```bash
40+
npm install --save frisbee react-native-android-sms-listener niftylettuce/react-native-country-picker-modal react-native-form react-native-loading-spinner-overlay
41+
```
42+
43+
> Or, if you're using `yarn` to install packages:
44+
45+
```bash
46+
yarn add frisbee react-native-android-sms-listener niftylettuce/react-native-country-picker-modal react-native-form react-native-loading-spinner-overlay
47+
```
48+
49+
4. See [example][example] directory for how to integrate into your codebase (you can also just clone this repo and run the example to test it out).
50+
51+
52+
## License
53+
54+
All code is licensed under [MIT][license-url]
55+
56+
57+
[paypal-donate-image]: https://img.shields.io/badge/paypal-donate-orange.svg
58+
[paypal-donate-url]: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=FE3EFQ5X9RHT6
59+
[license-image]: http://img.shields.io/badge/license-MIT-blue.svg
60+
[license-url]: LICENSE
61+
[crocodile-url]: https://crocodilejs.com
62+
[slack-image]: http://slack.crocodilejs.com/badge.svg
63+
[slack-url]: http://slack.crocodilejs.com
64+
[standard-image]: https://img.shields.io/badge/code%20style-standard%2Bes7-brightgreen.svg
65+
[standard-url]: https://github.com/crocodilejs/eslint-config-crocodile
66+
[react-native-country-picker-modal]: https://github.com/xcarpentier/react-native-country-picker-modal
67+
[react-native]: https://facebook.github.io/react-native/
68+
[react-native-android-sms-listener]: https://github.com/CentaurWarchief/react-native-android-sms-listener
69+
[tcomb-form-native]: https://github.com/gcanti/tcomb-form-native
70+
[react-native-form]: https://github.com/julianocomg/react-native-form
71+
[react-native-loading-spinner-overlay]: https://github.com/niftylettuce/react-native-loading-spinner-overlay
72+
[demo]: https://cdn.rawgit.com/niftylettuce/react-native-phone-verification/master/media/example.png
73+
[example]: example/index.ios.js
74+
[twitter-digits]: https://get.digits.com/

example/.babelrc

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"presets": ["react-native"]
3+
}

example/.buckconfig

+6
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

example/.flowconfig

+44
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
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 unexpected extra "@providesModule"
9+
.*/node_modules/.*/node_modules/fbjs/.*
10+
11+
; Ignore duplicate module providers
12+
; For RN Apps installed via npm, "Libraries" folder is inside
13+
; "node_modules/react-native" but in the source repo it is in the root
14+
.*/Libraries/react-native/React.js
15+
.*/Libraries/react-native/ReactNative.js
16+
17+
[include]
18+
19+
[libs]
20+
node_modules/react-native/Libraries/react-native/react-native-interface.js
21+
node_modules/react-native/flow
22+
flow/
23+
24+
[options]
25+
module.system=haste
26+
27+
experimental.strict_type_args=true
28+
29+
munge_underscores=true
30+
31+
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\)$' -> 'RelativeImageStub'
32+
33+
suppress_type=$FlowIssue
34+
suppress_type=$FlowFixMe
35+
suppress_type=$FixMe
36+
37+
suppress_comment=\\(.\\|\n\\)*\\$FlowFixMe\\($\\|[^(]\\|(\\(>=0\\.\\(3[0-6]\\|[1-2][0-9]\\|[0-9]\\).[0-9]\\)? *\\(site=[a-z,_]*react_native[a-z,_]*\\)?)\\)
38+
suppress_comment=\\(.\\|\n\\)*\\$FlowIssue\\((\\(>=0\\.\\(3[0-6]\\|1[0-9]\\|[1-2][0-9]\\).[0-9]\\)? *\\(site=[a-z,_]*react_native[a-z,_]*\\)?)\\)?:? #[0-9]+
39+
suppress_comment=\\(.\\|\n\\)*\\$FlowFixedInNextDeploy
40+
41+
unsafe.enable_getters_and_setters=true
42+
43+
[version]
44+
^0.36.0

example/.gitattributes

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
*.pbxproj -text

example/.gitignore

+53
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
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+
project.xcworkspace
24+
25+
# Android/IntelliJ
26+
#
27+
build/
28+
.idea
29+
.gradle
30+
local.properties
31+
*.iml
32+
33+
# node.js
34+
#
35+
node_modules/
36+
npm-debug.log
37+
38+
# BUCK
39+
buck-out/
40+
\.buckd/
41+
android/app/libs
42+
*.keystore
43+
44+
# fastlane
45+
#
46+
# It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the
47+
# screenshots whenever they are needed.
48+
# For more information about the recommended setup visit:
49+
# https://github.com/fastlane/fastlane/blob/master/fastlane/docs/Gitignore.md
50+
51+
fastlane/report.xml
52+
fastlane/Preview.html
53+
fastlane/screenshots

example/.watchmanconfig

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{}

example/__tests__/index.android.js

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
import 'react-native';
2+
import React from 'react';
3+
import Index from '../index.android.js';
4+
5+
// Note: test renderer must be required after react-native.
6+
import renderer from 'react-test-renderer';
7+
8+
it('renders correctly', () => {
9+
const tree = renderer.create(
10+
<Index />
11+
);
12+
});

example/__tests__/index.ios.js

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
import 'react-native';
2+
import React from 'react';
3+
import Index from '../index.ios.js';
4+
5+
// Note: test renderer must be required after react-native.
6+
import renderer from 'react-test-renderer';
7+
8+
it('renders correctly', () => {
9+
const tree = renderer.create(
10+
<Index />
11+
);
12+
});

example/android/app/BUCK

+66
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
import re
2+
3+
# To learn about Buck see [Docs](https://buckbuild.com/).
4+
# To run your application with Buck:
5+
# - install Buck
6+
# - `npm start` - to start the packager
7+
# - `cd android`
8+
# - `keytool -genkey -v -keystore keystores/debug.keystore -storepass android -alias androiddebugkey -keypass android -dname "CN=Android Debug,O=Android,C=US"`
9+
# - `./gradlew :app:copyDownloadableDepsToLibs` - make all Gradle compile dependencies available to Buck
10+
# - `buck install -r android/app` - compile, install and run application
11+
#
12+
13+
lib_deps = []
14+
for jarfile in glob(['libs/*.jar']):
15+
name = 'jars__' + re.sub(r'^.*/([^/]+)\.jar$', r'\1', jarfile)
16+
lib_deps.append(':' + name)
17+
prebuilt_jar(
18+
name = name,
19+
binary_jar = jarfile,
20+
)
21+
22+
for aarfile in glob(['libs/*.aar']):
23+
name = 'aars__' + re.sub(r'^.*/([^/]+)\.aar$', r'\1', aarfile)
24+
lib_deps.append(':' + name)
25+
android_prebuilt_aar(
26+
name = name,
27+
aar = aarfile,
28+
)
29+
30+
android_library(
31+
name = 'all-libs',
32+
exported_deps = lib_deps
33+
)
34+
35+
android_library(
36+
name = 'app-code',
37+
srcs = glob([
38+
'src/main/java/**/*.java',
39+
]),
40+
deps = [
41+
':all-libs',
42+
':build_config',
43+
':res',
44+
],
45+
)
46+
47+
android_build_config(
48+
name = 'build_config',
49+
package = 'com.example',
50+
)
51+
52+
android_resource(
53+
name = 'res',
54+
res = 'src/main/res',
55+
package = 'com.example',
56+
)
57+
58+
android_binary(
59+
name = 'app',
60+
package_type = 'debug',
61+
manifest = 'src/main/AndroidManifest.xml',
62+
keystore = '//android/keystores:debug',
63+
deps = [
64+
':app-code',
65+
],
66+
)

0 commit comments

Comments
 (0)