├── .babelrc
├── .bundle
└── config
├── .gitattributes
├── .gitignore
├── .npmignore
├── CHANGELOG.md
├── Gemfile
├── Gemfile.lock
├── LICENSE
├── README.md
├── android
├── build.gradle
├── gradle
│ └── wrapper
│ │ ├── gradle-wrapper.jar
│ │ └── gradle-wrapper.properties
├── gradlew
├── gradlew.bat
└── src
│ └── main
│ ├── AndroidManifest.xml
│ └── java
│ └── com
│ └── badfeatures
│ └── nearby
│ ├── RNNearbyApiModule.java
│ └── RNNearbyApiPackage.java
├── build.gradle
├── example
├── .package.json
├── .watchmanconfig
├── App.js
├── android
│ ├── app
│ │ ├── BUCK
│ │ ├── build.gradle
│ │ ├── proguard-rules.pro
│ │ └── src
│ │ │ └── main
│ │ │ ├── AndroidManifest.xml
│ │ │ ├── java
│ │ │ └── com
│ │ │ │ └── example
│ │ │ │ ├── MainActivity.java
│ │ │ │ └── MainApplication.java
│ │ │ └── res
│ │ │ ├── mipmap-hdpi
│ │ │ └── ic_launcher.png
│ │ │ ├── mipmap-mdpi
│ │ │ └── ic_launcher.png
│ │ │ ├── mipmap-xhdpi
│ │ │ └── ic_launcher.png
│ │ │ ├── mipmap-xxhdpi
│ │ │ └── ic_launcher.png
│ │ │ └── values
│ │ │ ├── strings.xml
│ │ │ └── styles.xml
│ ├── gradle
│ │ └── wrapper
│ │ │ ├── gradle-wrapper.jar
│ │ │ └── gradle-wrapper.properties
│ └── keystores
│ │ ├── BUCK
│ │ └── debug.keystore.properties
├── index.js
└── ios
│ ├── Podfile
│ ├── Podfile.lock
│ ├── example.xcodeproj
│ ├── project.pbxproj
│ └── xcshareddata
│ │ └── xcschemes
│ │ ├── example-tvOS.xcscheme
│ │ └── example.xcscheme
│ ├── example.xcworkspace
│ └── contents.xcworkspacedata
│ ├── example
│ ├── AppDelegate.h
│ ├── AppDelegate.m
│ ├── Base.lproj
│ │ └── LaunchScreen.xib
│ ├── Images.xcassets
│ │ ├── AppIcon.appiconset
│ │ │ └── Contents.json
│ │ └── Contents.json
│ ├── Info.plist
│ └── main.m
│ └── exampleTests
│ ├── Info.plist
│ └── exampleTests.m
├── gradle.properties
├── gradle
└── wrapper
│ ├── gradle-wrapper.jar
│ └── gradle-wrapper.properties
├── gradlew
├── gradlew.bat
├── index.js
├── ios
├── Classes
│ ├── RNNearbyApi.h
│ └── RNNearbyApi.m
└── RNNearbyApi.xcodeproj
│ └── project.pbxproj
├── package.json
├── renameLogger.sh
├── rn-cli.config.js
├── scripts
└── install.js
├── settings.gradle
└── yarn.lock
/.babelrc:
--------------------------------------------------------------------------------
1 | {
2 | "presets": ["react-native"],
3 | "plugins": [
4 | [
5 | "module-resolver",
6 | {
7 | "alias": {
8 | "react-native-nearby-api": "."
9 | },
10 | "cwd": "babelrc"
11 | }
12 | ]
13 | ]
14 | }
15 |
--------------------------------------------------------------------------------
/.bundle/config:
--------------------------------------------------------------------------------
1 | ---
2 | BUNDLE_BIN: "./example/ios"
3 |
--------------------------------------------------------------------------------
/.gitattributes:
--------------------------------------------------------------------------------
1 | *.pbxproj -text
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 |
2 | # OSX
3 | #
4 | .DS_Store
5 |
6 | # node.js
7 | #
8 | node_modules/
9 | npm-debug.log
10 | yarn-error.log
11 |
12 |
13 | # Xcode
14 | #
15 | build/
16 | *.pbxuser
17 | !default.pbxuser
18 | *.mode1v3
19 | !default.mode1v3
20 | *.mode2v3
21 | !default.mode2v3
22 | *.perspectivev3
23 | !default.perspectivev3
24 | xcuserdata
25 | *.xccheckout
26 | *.moved-aside
27 | DerivedData
28 | *.hmap
29 | *.ipa
30 | *.xcuserstate
31 | project.xcworkspace
32 | Pods/
33 | RNNearbyApi.xcworkspace
34 |
35 |
36 | # Android/IntelliJ
37 | #
38 | build/
39 | .idea
40 | .gradle
41 | local.properties
42 | *.iml
43 |
44 | # BUCK
45 | buck-out/
46 | \.buckd/
47 | *.keystore
48 |
--------------------------------------------------------------------------------
/.npmignore:
--------------------------------------------------------------------------------
1 | example/
2 | .babelrc
--------------------------------------------------------------------------------
/CHANGELOG.md:
--------------------------------------------------------------------------------
1 | # Change Log
2 |
3 | ## 0.0.5 (November 30, 2017)
4 | - Removed from npm organization
5 | - Documentation updates
6 |
7 | ## 0.0.4 (November 29, 2017)
8 | - iOS | Android: [#10](https://github.com/badfeatures/react-native-nearby-api/pull/10) Configuration enhancements for BLE only use.
9 | - Android: Adds Google Play and Android version check
10 |
11 |
12 | ## 0.0.3
13 |
14 | - iOS support [#4](https://github.com/badfeatures/react-native-nearby-api/pull/4)
15 | - Project structure improvements
16 |
17 | ## 0.0.2
18 |
19 | - [Android] Basic function improvements
20 |
21 | ## 0.0.1
22 |
23 | - Initial release
--------------------------------------------------------------------------------
/Gemfile:
--------------------------------------------------------------------------------
1 | source 'https://rubygems.org'
2 | ruby '2.4.1'
3 | gem 'cocoapods', '1.2.0'
--------------------------------------------------------------------------------
/Gemfile.lock:
--------------------------------------------------------------------------------
1 | GEM
2 | remote: https://rubygems.org/
3 | specs:
4 | CFPropertyList (2.3.5)
5 | activesupport (4.2.10)
6 | i18n (~> 0.7)
7 | minitest (~> 5.1)
8 | thread_safe (~> 0.3, >= 0.3.4)
9 | tzinfo (~> 1.1)
10 | claide (1.0.2)
11 | cocoapods (1.2.0)
12 | activesupport (>= 4.0.2, < 5)
13 | claide (>= 1.0.1, < 2.0)
14 | cocoapods-core (= 1.2.0)
15 | cocoapods-deintegrate (>= 1.0.1, < 2.0)
16 | cocoapods-downloader (>= 1.1.3, < 2.0)
17 | cocoapods-plugins (>= 1.0.0, < 2.0)
18 | cocoapods-search (>= 1.0.0, < 2.0)
19 | cocoapods-stats (>= 1.0.0, < 2.0)
20 | cocoapods-trunk (>= 1.1.2, < 2.0)
21 | cocoapods-try (>= 1.1.0, < 2.0)
22 | colored (~> 1.2)
23 | escape (~> 0.0.4)
24 | fourflusher (~> 2.0.1)
25 | gh_inspector (~> 1.0)
26 | molinillo (~> 0.5.5)
27 | nap (~> 1.0)
28 | ruby-macho (~> 0.2.5)
29 | xcodeproj (>= 1.4.1, < 2.0)
30 | cocoapods-core (1.2.0)
31 | activesupport (>= 4.0.2, < 5)
32 | fuzzy_match (~> 2.0.4)
33 | nap (~> 1.0)
34 | cocoapods-deintegrate (1.0.1)
35 | cocoapods-downloader (1.1.3)
36 | cocoapods-plugins (1.0.0)
37 | nap
38 | cocoapods-search (1.0.0)
39 | cocoapods-stats (1.0.0)
40 | cocoapods-trunk (1.3.0)
41 | nap (>= 0.8, < 2.0)
42 | netrc (~> 0.11)
43 | cocoapods-try (1.1.0)
44 | colored (1.2)
45 | colored2 (3.1.2)
46 | concurrent-ruby (1.0.5)
47 | escape (0.0.4)
48 | fourflusher (2.0.1)
49 | fuzzy_match (2.0.4)
50 | gh_inspector (1.0.3)
51 | i18n (0.9.1)
52 | concurrent-ruby (~> 1.0)
53 | minitest (5.10.3)
54 | molinillo (0.5.7)
55 | nanaimo (0.2.3)
56 | nap (1.1.0)
57 | netrc (0.11.0)
58 | ruby-macho (0.2.6)
59 | thread_safe (0.3.6)
60 | tzinfo (1.2.4)
61 | thread_safe (~> 0.1)
62 | xcodeproj (1.5.3)
63 | CFPropertyList (~> 2.3.3)
64 | claide (>= 1.0.2, < 2.0)
65 | colored2 (~> 3.1)
66 | nanaimo (~> 0.2.3)
67 |
68 | PLATFORMS
69 | ruby
70 |
71 | DEPENDENCIES
72 | cocoapods (= 1.2.0)
73 |
74 | RUBY VERSION
75 | ruby 2.4.1p111
76 |
77 | BUNDLED WITH
78 | 1.16.0
79 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/badfeatures/react-native-nearby-api/7a916d859712e1a66005a256db18be8120442e0e/LICENSE
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # react-native-nearby-api [](https://badge.fury.io/js/react-native-nearby-api)
2 |
3 | ## Getting started
4 |
5 | `$ yarn add react-native-nearby-api` or `$ npm install react-native-nearby-api --save`
6 |
7 | ### Mostly automatic installation
8 |
9 | `$ react-native link react-native-nearby-api`
10 |
11 | ### Manual installation
12 |
13 | #### iOS
14 |
15 | - To utilize the Nearby SDK, `NearbyMessages` need to be linked to the project. Look to the example for Cocoapods usage.
16 | ```
17 | cd ios/
18 | pod init
19 | ```
20 | - Add the following pod to the `Podfile` in the project's target.
21 | ```
22 | pod 'NearbyMessages'
23 | ```
24 | - Then `pod install` to install dependencies.
25 | - Open the newly generated `.xcworkspace`.
26 | - In `node_modules/react-native-nearby-api/ios`, drag and drop `RNNearbyApi.xcodeproj` into your `Libraries` group.
27 | - In Build Phases > Link Binary with Libraries > Click (+) > Add `libRNNearbyApi.a`.
28 | - Build and run project on device.
29 |
30 | #### Android
31 |
32 | 1. Open up `android/app/src/main/java/[...]/MainActivity.java`
33 |
34 | - Add `import com.badfeatures.nearby.RNNearbyApiPackage;` to the imports at the top of the file
35 | - Add `new RNNearbyApiPackage()` to the list returned by the `getPackages()` method
36 |
37 | 2. Append the following lines to `android/settings.gradle`:
38 | ```gradle
39 | include ':react-native-nearby-api'
40 | project(':react-native-nearby-api').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-nearby-api/android')
41 | ```
42 | 3. Insert the following lines inside the dependencies block in `android/app/build.gradle`:
43 | ```gradle
44 | compile project(':react-native-nearby-api')
45 | ```
46 |
47 | ## Usage
48 |
49 | See the
50 | [example app](https://github.com/badfeatures/react-native-nearby-api/tree/master/example) for more detail and code examples.
51 |
52 | - Retrieve your API Keys from the Google Console [iOS](https://developers.google.com/nearby/messages/ios/get-started) | [Android](https://developers.google.com/nearby/messages/android/get-started)
53 | - Add the correct permissions to the AndroidManifest.
54 |
55 | ```xml
56 |
57 |
58 |
59 |
60 |
61 |
62 | ```
63 |
64 | - Add the Android API Key in the AndroidManifest .
65 |
66 | ```xml
67 |
70 | ```
71 |
72 | - The iOS API key will be supplied through the `connect()` method.
73 | - Add `NSBluetoothPeripheralUsageDescription` to the Info.plist
74 | - Add `NSMicrophoneUsageDescription` to the iOS project's Info.plist *if using audio*
75 |
76 | ```javascript
77 | import NearbyApi from "react-native-nearby-api";
78 |
79 | const nearbyAPI = new NearbyAPI(true); // Use BLE only, no audio.
80 | nearbyAPI.onConnected(message => {
81 | console.log(message);
82 | });
83 | nearbyAPI.onDisconnected(message => {
84 | console.log(message);
85 | });
86 | nearbyAPI.onFound(message => {
87 | console.log("Message Found!");
88 | console.log(message);
89 | });
90 | nearbyAPI.onLost(message => {
91 | console.log("Message Lost!");
92 | console.log(message);
93 | });
94 | // Android Only
95 | nearbyAPI.onDistanceChanged((message, value) => {
96 | console.log("Distance Changed!");
97 | console.log(message, value);
98 | });
99 | // Android Only
100 | nearbyAPI.onBLESignalChanged((message, value) => {
101 | console.log("BLE Signal Changed!");
102 | console.log(message, value);
103 | })
104 | nearbyAPI.onPublishSuccess(message => {
105 | console.log(message);
106 | });
107 | nearbyAPI.onPublishFailed(message => {
108 | console.log(message);
109 | });
110 | nearbyAPI.onSubscribeSuccess(() => {});
111 | nearbyAPI.onSubscribeFailed(() => {});
112 |
113 | // To connect from Google API Client
114 | nearbyAPI.connect(API_KEY);
115 |
116 | // To check if the nearby API is connected.
117 | nearbyAPI.isConnected((connected, error) => {
118 | console.log(connected);
119 | });
120 |
121 | // To disconnect later
122 | nearbyAPI.disconnect();
123 |
124 | // To publish to nearby devices
125 | nearbyAPI.publish("Hello World!");
126 |
127 | // To check if the nearby API is publishing.
128 | nearbyAPI.isPublishing((publishing, error) => {
129 | console.log(publishing);
130 | });
131 |
132 | // To subscribe to nearby devices broadcasting
133 | nearbyAPI.subscribe();
134 |
135 | // To check if the nearby API is subscribing.
136 | nearbyAPI.isSubscribing((subscribing, error) => {
137 | console.log(subscribing);
138 | });
139 |
140 | // To unpublish
141 | nearbyAPI.unpublish();
142 |
143 | // To unsubscribe
144 | nearbyAPI.unsubscribe();
145 | ```
146 |
147 | ## Running the Example
148 |
149 | - Install the dependencies in the root folder
150 |
151 | `yarn`
152 |
153 | #### Generate an API Key from the [Google Developer Console](https://console.developers.google.com/flows/enableapi?apiid=copresence&keyType=CLIENT_SIDE_ANDROID&reusekey=true)
154 | 1. Go to the Google Developers Console.
155 | 2. Create or select a project to register your application with.
156 | 3. Click Continue to Enable the API.
157 | 4. On the Credentials page, create a new API Key. (No key restrictions are needed for this example)
158 | 5. Copy/Paste your key in [example/index.js](https://github.com/badfeatures/react-native-nearby-api/blob/develop/example/App.js#L26) and in the example [AndroidManifest.xml](https://github.com/badfeatures/react-native-nearby-api/blob/develop/example/android/app/src/main/AndroidManifest.xml#L31)
159 |
160 | #### Android
161 |
162 | - To run the example app, the packager must have the `projectRoots` reordered
163 | for the example/ directory. In another terminal window:
164 |
165 | `yarn start --projectRoots /react-native-nearby-api/example,/react-native-nearby-api`
166 |
167 | `yarn run:android`
168 |
169 | `adb reverse tcp:8081 tcp:8081`
170 |
171 | #### iOS
172 |
173 | - `cd example ios/`
174 | - `bundle exec pod install`
175 | - Open `example.xcworkspace`
176 | - Add your IP to `AppDelegate.m`
177 |
178 | ```objective-c
179 | jsCodeLocation = [NSURL URLWithString:@"http://:8081/index.bundle?platform=ios&dev=true"];
180 | ```
181 |
182 | - In another terminal window: `yarn start`
183 | - Run on device
184 |
185 | NOTE: If you receive a `duplicate symbols for architecture` error through Xcode, this is a [known issue](https://github.com/facebook/react-native/issues/16406). A work around is to run `./renameLogger.sh` after `node_modules` have been installed and you've attempted to run in Xcode.
186 |
--------------------------------------------------------------------------------
/android/build.gradle:
--------------------------------------------------------------------------------
1 |
2 | buildscript {
3 | repositories {
4 | jcenter()
5 | }
6 |
7 | dependencies {
8 | classpath 'com.android.tools.build:gradle:2.2.3'
9 | }
10 | }
11 |
12 | apply plugin: 'com.android.library'
13 |
14 | android {
15 | compileSdkVersion 23
16 | buildToolsVersion "23.0.1"
17 |
18 | defaultConfig {
19 | minSdkVersion 16
20 | targetSdkVersion 22
21 | versionCode 1
22 | versionName "1.0"
23 | }
24 | lintOptions {
25 | abortOnError false
26 | }
27 | }
28 |
29 | repositories {
30 | mavenCentral()
31 | }
32 |
33 | dependencies {
34 | compile 'com.facebook.react:react-native:+'
35 | compile 'com.google.android.gms:play-services-nearby:10.2.4'
36 | }
37 |
--------------------------------------------------------------------------------
/android/gradle/wrapper/gradle-wrapper.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/badfeatures/react-native-nearby-api/7a916d859712e1a66005a256db18be8120442e0e/android/gradle/wrapper/gradle-wrapper.jar
--------------------------------------------------------------------------------
/android/gradle/wrapper/gradle-wrapper.properties:
--------------------------------------------------------------------------------
1 | #Wed Oct 18 13:35:47 PDT 2017
2 | distributionBase=GRADLE_USER_HOME
3 | distributionPath=wrapper/dists
4 | zipStoreBase=GRADLE_USER_HOME
5 | zipStorePath=wrapper/dists
6 | distributionUrl=https\://services.gradle.org/distributions/gradle-2.14.1-all.zip
7 |
--------------------------------------------------------------------------------
/android/gradlew:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env bash
2 |
3 | ##############################################################################
4 | ##
5 | ## Gradle start up script for UN*X
6 | ##
7 | ##############################################################################
8 |
9 | # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
10 | DEFAULT_JVM_OPTS=""
11 |
12 | APP_NAME="Gradle"
13 | APP_BASE_NAME=`basename "$0"`
14 |
15 | # Use the maximum available, or set MAX_FD != -1 to use that value.
16 | MAX_FD="maximum"
17 |
18 | warn ( ) {
19 | echo "$*"
20 | }
21 |
22 | die ( ) {
23 | echo
24 | echo "$*"
25 | echo
26 | exit 1
27 | }
28 |
29 | # OS specific support (must be 'true' or 'false').
30 | cygwin=false
31 | msys=false
32 | darwin=false
33 | case "`uname`" in
34 | CYGWIN* )
35 | cygwin=true
36 | ;;
37 | Darwin* )
38 | darwin=true
39 | ;;
40 | MINGW* )
41 | msys=true
42 | ;;
43 | esac
44 |
45 | # Attempt to set APP_HOME
46 | # Resolve links: $0 may be a link
47 | PRG="$0"
48 | # Need this for relative symlinks.
49 | while [ -h "$PRG" ] ; do
50 | ls=`ls -ld "$PRG"`
51 | link=`expr "$ls" : '.*-> \(.*\)$'`
52 | if expr "$link" : '/.*' > /dev/null; then
53 | PRG="$link"
54 | else
55 | PRG=`dirname "$PRG"`"/$link"
56 | fi
57 | done
58 | SAVED="`pwd`"
59 | cd "`dirname \"$PRG\"`/" >/dev/null
60 | APP_HOME="`pwd -P`"
61 | cd "$SAVED" >/dev/null
62 |
63 | CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
64 |
65 | # Determine the Java command to use to start the JVM.
66 | if [ -n "$JAVA_HOME" ] ; then
67 | if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
68 | # IBM's JDK on AIX uses strange locations for the executables
69 | JAVACMD="$JAVA_HOME/jre/sh/java"
70 | else
71 | JAVACMD="$JAVA_HOME/bin/java"
72 | fi
73 | if [ ! -x "$JAVACMD" ] ; then
74 | die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
75 |
76 | Please set the JAVA_HOME variable in your environment to match the
77 | location of your Java installation."
78 | fi
79 | else
80 | JAVACMD="java"
81 | which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
82 |
83 | Please set the JAVA_HOME variable in your environment to match the
84 | location of your Java installation."
85 | fi
86 |
87 | # Increase the maximum file descriptors if we can.
88 | if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then
89 | MAX_FD_LIMIT=`ulimit -H -n`
90 | if [ $? -eq 0 ] ; then
91 | if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
92 | MAX_FD="$MAX_FD_LIMIT"
93 | fi
94 | ulimit -n $MAX_FD
95 | if [ $? -ne 0 ] ; then
96 | warn "Could not set maximum file descriptor limit: $MAX_FD"
97 | fi
98 | else
99 | warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
100 | fi
101 | fi
102 |
103 | # For Darwin, add options to specify how the application appears in the dock
104 | if $darwin; then
105 | GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
106 | fi
107 |
108 | # For Cygwin, switch paths to Windows format before running java
109 | if $cygwin ; then
110 | APP_HOME=`cygpath --path --mixed "$APP_HOME"`
111 | CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
112 | JAVACMD=`cygpath --unix "$JAVACMD"`
113 |
114 | # We build the pattern for arguments to be converted via cygpath
115 | ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
116 | SEP=""
117 | for dir in $ROOTDIRSRAW ; do
118 | ROOTDIRS="$ROOTDIRS$SEP$dir"
119 | SEP="|"
120 | done
121 | OURCYGPATTERN="(^($ROOTDIRS))"
122 | # Add a user-defined pattern to the cygpath arguments
123 | if [ "$GRADLE_CYGPATTERN" != "" ] ; then
124 | OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
125 | fi
126 | # Now convert the arguments - kludge to limit ourselves to /bin/sh
127 | i=0
128 | for arg in "$@" ; do
129 | CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
130 | CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
131 |
132 | if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
133 | eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
134 | else
135 | eval `echo args$i`="\"$arg\""
136 | fi
137 | i=$((i+1))
138 | done
139 | case $i in
140 | (0) set -- ;;
141 | (1) set -- "$args0" ;;
142 | (2) set -- "$args0" "$args1" ;;
143 | (3) set -- "$args0" "$args1" "$args2" ;;
144 | (4) set -- "$args0" "$args1" "$args2" "$args3" ;;
145 | (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
146 | (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
147 | (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
148 | (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
149 | (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
150 | esac
151 | fi
152 |
153 | # Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules
154 | function splitJvmOpts() {
155 | JVM_OPTS=("$@")
156 | }
157 | eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS
158 | JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME"
159 |
160 | exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@"
161 |
--------------------------------------------------------------------------------
/android/gradlew.bat:
--------------------------------------------------------------------------------
1 | @if "%DEBUG%" == "" @echo off
2 | @rem ##########################################################################
3 | @rem
4 | @rem Gradle startup script for Windows
5 | @rem
6 | @rem ##########################################################################
7 |
8 | @rem Set local scope for the variables with windows NT shell
9 | if "%OS%"=="Windows_NT" setlocal
10 |
11 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
12 | set DEFAULT_JVM_OPTS=
13 |
14 | set DIRNAME=%~dp0
15 | if "%DIRNAME%" == "" set DIRNAME=.
16 | set APP_BASE_NAME=%~n0
17 | set APP_HOME=%DIRNAME%
18 |
19 | @rem Find java.exe
20 | if defined JAVA_HOME goto findJavaFromJavaHome
21 |
22 | set JAVA_EXE=java.exe
23 | %JAVA_EXE% -version >NUL 2>&1
24 | if "%ERRORLEVEL%" == "0" goto init
25 |
26 | echo.
27 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
28 | echo.
29 | echo Please set the JAVA_HOME variable in your environment to match the
30 | echo location of your Java installation.
31 |
32 | goto fail
33 |
34 | :findJavaFromJavaHome
35 | set JAVA_HOME=%JAVA_HOME:"=%
36 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe
37 |
38 | if exist "%JAVA_EXE%" goto init
39 |
40 | echo.
41 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
42 | echo.
43 | echo Please set the JAVA_HOME variable in your environment to match the
44 | echo location of your Java installation.
45 |
46 | goto fail
47 |
48 | :init
49 | @rem Get command-line arguments, handling Windowz variants
50 |
51 | if not "%OS%" == "Windows_NT" goto win9xME_args
52 | if "%@eval[2+2]" == "4" goto 4NT_args
53 |
54 | :win9xME_args
55 | @rem Slurp the command line arguments.
56 | set CMD_LINE_ARGS=
57 | set _SKIP=2
58 |
59 | :win9xME_args_slurp
60 | if "x%~1" == "x" goto execute
61 |
62 | set CMD_LINE_ARGS=%*
63 | goto execute
64 |
65 | :4NT_args
66 | @rem Get arguments from the 4NT Shell from JP Software
67 | set CMD_LINE_ARGS=%$
68 |
69 | :execute
70 | @rem Setup the command line
71 |
72 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
73 |
74 | @rem Execute Gradle
75 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
76 |
77 | :end
78 | @rem End local scope for the variables with windows NT shell
79 | if "%ERRORLEVEL%"=="0" goto mainEnd
80 |
81 | :fail
82 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
83 | rem the _cmd.exe /c_ return code!
84 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
85 | exit /b 1
86 |
87 | :mainEnd
88 | if "%OS%"=="Windows_NT" endlocal
89 |
90 | :omega
91 |
--------------------------------------------------------------------------------
/android/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
--------------------------------------------------------------------------------
/android/src/main/java/com/badfeatures/nearby/RNNearbyApiModule.java:
--------------------------------------------------------------------------------
1 |
2 | package com.badfeatures.nearby;
3 |
4 | import android.app.PendingIntent;
5 | import android.os.Build;
6 | import android.os.Bundle;
7 | import android.support.annotation.NonNull;
8 | import android.support.annotation.Nullable;
9 | import android.util.Log;
10 |
11 | import com.facebook.react.bridge.Arguments;
12 | import com.facebook.react.bridge.Callback;
13 | import com.facebook.react.bridge.LifecycleEventListener;
14 | import com.facebook.react.bridge.ReactApplicationContext;
15 | import com.facebook.react.bridge.ReactContext;
16 | import com.facebook.react.bridge.ReactContextBaseJavaModule;
17 | import com.facebook.react.bridge.ReactMethod;
18 | import com.facebook.react.bridge.WritableMap;
19 | import com.facebook.react.modules.core.DeviceEventManagerModule;
20 | import com.google.android.gms.common.ConnectionResult;
21 | import com.google.android.gms.common.GoogleApiAvailability;
22 | import com.google.android.gms.common.api.GoogleApiClient;
23 | import com.google.android.gms.common.api.ResultCallback;
24 | import com.google.android.gms.common.api.Status;
25 | import com.google.android.gms.nearby.Nearby;
26 | import com.google.android.gms.nearby.messages.BleSignal;
27 | import com.google.android.gms.nearby.messages.Distance;
28 | import com.google.android.gms.nearby.messages.Message;
29 | import com.google.android.gms.nearby.messages.MessageListener;
30 | import com.google.android.gms.nearby.messages.PublishCallback;
31 | import com.google.android.gms.nearby.messages.PublishOptions;
32 | import com.google.android.gms.nearby.messages.Strategy;
33 | import com.google.android.gms.nearby.messages.SubscribeCallback;
34 | import com.google.android.gms.nearby.messages.SubscribeOptions;
35 |
36 | public class RNNearbyApiModule extends ReactContextBaseJavaModule implements LifecycleEventListener, GoogleApiClient.ConnectionCallbacks, GoogleApiClient.OnConnectionFailedListener {
37 |
38 | private static int PLAY_SERVICES_RESOLUTION_REQUEST = 9000;
39 |
40 | private enum RNNearbyApiEvent {
41 | CONNECTED("CONNECTED"),
42 | CONNECTION_SUSPENDED("CONNECTION_SUSPENDED"),
43 | CONNECTION_FAILED("CONNECTION_FAILED"),
44 | DISCONNECTED("DISCONNECTED"),
45 | MESSAGE_FOUND("MESSAGE_FOUND"),
46 | MESSAGE_LOST("MESSAGE_LOST"),
47 | DISTANCE_CHANGED("DISTANCE_CHANGED"),
48 | BLE_SIGNAL_CHANGED("BLE_SIGNAL_CHANGED"),
49 | PUBLISH_SUCCESS("PUBLISH_SUCCESS"),
50 | PUBLISH_FAILED("PUBLISH_FAILED"),
51 | SUBSCRIBE_SUCCESS("SUBSCRIBE_SUCCESS"),
52 | SUBSCRIBE_FAILED("SUBSCRIBE_FAILED")
53 | ;
54 |
55 | private final String _type;
56 |
57 | RNNearbyApiEvent(String type) {
58 | _type = type;
59 | }
60 |
61 | @Override
62 | public String toString() {
63 | return _type;
64 | }
65 | }
66 |
67 | private final ReactApplicationContext _reactContext;
68 | private GoogleApiClient _googleAPIClient;
69 | @Nullable private Message _publishedMessage;
70 | @NonNull private volatile Boolean _isPublishing = false;
71 | @NonNull private volatile Boolean _isSubscribing = false;
72 | @NonNull private Boolean _isBLEOnly = false;
73 | @NonNull private MessageListener _messageListener = new MessageListener() {
74 | @Override
75 | public void onFound(Message message) {
76 | super.onFound(message);
77 | String messageAsString = new String(message.getContent());
78 | Log.d(getName(), "Message Found: " + messageAsString);
79 | emitEvent(RNNearbyApiEvent.MESSAGE_FOUND, messageAsString);
80 | }
81 |
82 | @Override
83 | public void onLost(Message message) {
84 | super.onLost(message);
85 | String messageAsString = new String(message.getContent());
86 | Log.d(getName(), "Message Lost: " + messageAsString);
87 | emitEvent(RNNearbyApiEvent.MESSAGE_LOST, messageAsString);
88 | }
89 |
90 | @Override
91 | public void onDistanceChanged(Message message, Distance distance) {
92 | super.onDistanceChanged(message, distance);
93 | //TODO: Combine both message + distance
94 | Log.d(getName(), "Distance Changed: " + message.toString() + " " + distance.getMeters() + "m");
95 | emitEvent(RNNearbyApiEvent.DISTANCE_CHANGED, message, (int)distance.getMeters());
96 | }
97 |
98 | @Override
99 | public void onBleSignalChanged(Message message, BleSignal bleSignal) {
100 | super.onBleSignalChanged(message, bleSignal);
101 | //TODO: Combine both message + bleSignal
102 | Log.d(getName(), "Distance Changed: " + message.toString() + " " + bleSignal.getRssi() + " rssi");
103 | emitEvent(RNNearbyApiEvent.BLE_SIGNAL_CHANGED, message, bleSignal.getRssi());
104 | }
105 | };
106 |
107 | public RNNearbyApiModule(ReactApplicationContext reactContext) {
108 | super(reactContext);
109 | this._reactContext = reactContext;
110 | reactContext.addLifecycleEventListener(this);
111 | }
112 |
113 | @Nullable
114 | private String getPublishedMessageString() {
115 | return _publishedMessage == null ? null : new String(_publishedMessage.getContent());
116 | }
117 |
118 | @Override
119 | public String getName() {
120 | return "RNNearbyApi";
121 | }
122 |
123 | private synchronized GoogleApiClient getGoogleAPIInstance() {
124 | if (_googleAPIClient == null) {
125 | _googleAPIClient = new GoogleApiClient
126 | .Builder(this.getReactApplicationContext())
127 | .addApi(Nearby.MESSAGES_API)
128 | //TODO: Add more functionality (Currently only: Messages API)
129 | .addConnectionCallbacks(this)
130 | .addOnConnectionFailedListener(this)
131 | .build();
132 | }
133 | return _googleAPIClient;
134 | }
135 |
136 | private PublishOptions createPublishOptions(int ttlSeconds) {
137 | Strategy pubSubStrategy = new Strategy.Builder().setTtlSeconds(ttlSeconds).build();
138 |
139 | PublishOptions options = new PublishOptions.Builder()
140 | .setStrategy(pubSubStrategy)
141 | .setCallback(new PublishCallback() {
142 | @Override
143 | public void onExpired() {
144 | super.onExpired();
145 | }
146 | }).build();
147 | return options;
148 | }
149 |
150 | private SubscribeOptions createSubscribeOptions(int ttlSeconds, boolean bleOnly) {
151 | Strategy pubSubStrategy;
152 | if(bleOnly) {
153 | pubSubStrategy = Strategy.BLE_ONLY;
154 | } else {
155 | pubSubStrategy = new Strategy.Builder().setTtlSeconds(ttlSeconds).build();
156 | }
157 |
158 | SubscribeOptions options = new SubscribeOptions.Builder()
159 | .setStrategy(pubSubStrategy)
160 | .setCallback(new SubscribeCallback() {
161 | @Override
162 | public void onExpired() {
163 | super.onExpired();
164 | }
165 | })
166 | .build();
167 | return options;
168 | }
169 |
170 | private boolean isMinimumAndroidVersion() {
171 | return Build.VERSION.SDK_INT >= Build.VERSION_CODES.ICE_CREAM_SANDWICH;
172 | }
173 |
174 | private boolean isGooglePlayServicesAvailable(boolean showErrorDialog) {
175 | GoogleApiAvailability googleApi = GoogleApiAvailability.getInstance();
176 | int availability = googleApi.isGooglePlayServicesAvailable(getReactApplicationContext());
177 | boolean result = availability == ConnectionResult.SUCCESS;
178 | if(!result &&
179 | showErrorDialog &&
180 | googleApi.isUserResolvableError(availability)
181 | ) {
182 | googleApi.getErrorDialog(getCurrentActivity(), availability, PLAY_SERVICES_RESOLUTION_REQUEST).show();
183 | }
184 | return result;
185 | }
186 |
187 | /**
188 | *
189 | * @param apiKey - Note: API is unused for Android. Must be set in the AndroidManifest.
190 | */
191 | @ReactMethod
192 | public void connect(String apiKey, boolean bleOnly) {
193 | if(!isMinimumAndroidVersion()) {
194 | emitEvent(RNNearbyApiEvent.CONNECTION_FAILED, "Current Android version is too low: " + Integer.toString(Build.VERSION.SDK_INT));
195 | return;
196 | }
197 | if(!isGooglePlayServicesAvailable(true)) {
198 | emitEvent(RNNearbyApiEvent.CONNECTION_FAILED, "Google Play Services is not available on this device.");
199 | return;
200 | }
201 | _isBLEOnly = bleOnly;
202 | GoogleApiClient client = getGoogleAPIInstance();
203 | if(client.isConnected()) {
204 | Log.w(getName(), "Google API Client is already connected.");
205 | emitEvent(RNNearbyApiEvent.CONNECTED, "Google API Client is already connected.");
206 | return;
207 | }
208 | client.connect();
209 | }
210 |
211 | @ReactMethod
212 | public void disconnect() {
213 | GoogleApiClient client = getGoogleAPIInstance();
214 | client.disconnect();
215 | Log.d(getName(), "Google API Client disconnected.");
216 | emitEvent(RNNearbyApiEvent.DISCONNECTED, "Google API Client is disconnected.");
217 | }
218 |
219 | @ReactMethod
220 | public void isConnected(Callback callback) {
221 | boolean connected = getGoogleAPIInstance().isConnected();
222 | callback.invoke(connected);
223 | }
224 |
225 | @ReactMethod
226 | public void isPublishing(Callback callback) {
227 | callback.invoke(_isPublishing);
228 | }
229 |
230 | @ReactMethod
231 | public void publish(String message) {
232 | Log.i(getName(), "Attempting to publish: " + message);
233 | GoogleApiClient client = getGoogleAPIInstance();
234 | if(client.isConnected()) {
235 | final Message publishMessage = new Message(message.getBytes());
236 | _publishedMessage = publishMessage;
237 | PublishOptions options = createPublishOptions(180);
238 | Log.i(getName(), "Publishing message: " + new String(publishMessage.getContent()));
239 | Nearby.Messages.publish(client, publishMessage, options)
240 | .setResultCallback(new ResultCallback() {
241 | @Override
242 | public void onResult(@NonNull Status status) {
243 | if (status.isSuccess()) {
244 | Log.i(getName(), "Published message.");
245 | _isPublishing = true;
246 | emitEvent(RNNearbyApiEvent.PUBLISH_SUCCESS, publishMessage);
247 | } else {
248 | Log.e(getName(), "Publish failed");
249 | Log.e(getName(), status.getStatusMessage());
250 | _isPublishing = false;
251 | emitEvent(RNNearbyApiEvent.PUBLISH_FAILED, "Publish failed: " + status.getStatusMessage());
252 | }
253 | }
254 | });
255 | } else {
256 | Log.e(getName(), "Google API Client not connected. Call " + getName() + ".connect() before publishing.");
257 | emitEvent(RNNearbyApiEvent.PUBLISH_FAILED, "Google API Client not connected. Call " + getName() + ".connect() before publishing.");
258 | }
259 | }
260 |
261 | @ReactMethod
262 | public void unpublish() {
263 | GoogleApiClient client = getGoogleAPIInstance();
264 | if(client.isConnected() && (_publishedMessage != null || _isPublishing)) {
265 | Nearby.Messages.unpublish(client, _publishedMessage);
266 | _publishedMessage = null;
267 | _isPublishing = false;
268 | Log.i(getName(), "Unpublished message.");
269 | }
270 | }
271 |
272 | @ReactMethod
273 | public void isSubscribing(Callback callback) {
274 | callback.invoke(_isSubscribing);
275 | }
276 |
277 | @ReactMethod
278 | public void subscribe() {
279 | GoogleApiClient client = getGoogleAPIInstance();
280 | if(client.isConnected()) {
281 | SubscribeOptions options = createSubscribeOptions(180, _isBLEOnly);
282 | Nearby.Messages.subscribe(client, _messageListener, options)
283 | .setResultCallback(new ResultCallback() {
284 | @Override
285 | public void onResult(@NonNull Status status) {
286 | if (status.isSuccess()) {
287 | Log.i(getName(), "Subscribe success.");
288 | _isSubscribing = true;
289 | emitEvent(RNNearbyApiEvent.SUBSCRIBE_SUCCESS, "Subscribe success. Is currently subscribing.");
290 | } else {
291 | Log.e(getName(), "Subscribe failed");
292 | Log.e(getName(), status.getStatusMessage());
293 | _isSubscribing = false;
294 | emitEvent(RNNearbyApiEvent.SUBSCRIBE_FAILED, "Subscribe failed: " + status.getStatusMessage());
295 | }
296 | }
297 | });
298 | } else {
299 | Log.e(getName(), "Google API Client not connected. Call " + getName() + ".connect() before subscribing.");
300 | emitEvent(RNNearbyApiEvent.SUBSCRIBE_FAILED, "Google API Client not connected. Call " + getName() + ".connect() before subscribing.");
301 | }
302 | }
303 |
304 | @ReactMethod
305 | public void unsubscribe() {
306 | GoogleApiClient client = getGoogleAPIInstance();
307 | if(client.isConnected())
308 | Nearby.Messages.unsubscribe(client, _messageListener);
309 | Log.i(getName(), "Unsubscribe listener.");
310 | _isSubscribing = false;
311 | }
312 |
313 | @Override
314 | public void onConnected(@Nullable Bundle bundle) {
315 | if(getGoogleAPIInstance().isConnected()) {
316 | Log.d(getName(), "Google API Client connected.");
317 | emitEvent(RNNearbyApiEvent.CONNECTED, "Google API Client is connected.");
318 | } else {
319 | Log.e(getName(), "Google API Client not connected.");
320 | }
321 | }
322 |
323 | @Override
324 | public void onConnectionSuspended(int i) {
325 | Log.e(getName(), RNNearbyApiEvent.CONNECTION_SUSPENDED.toString() + " " + i);
326 | emitEvent(RNNearbyApiEvent.CONNECTION_SUSPENDED, "Google Client connection suspended.");
327 | }
328 |
329 | @Override
330 | public void onConnectionFailed(@NonNull ConnectionResult connectionResult) {
331 | Log.e(getName(), RNNearbyApiEvent.CONNECTION_FAILED.toString() + " " + connectionResult.toString());
332 | emitEvent(RNNearbyApiEvent.CONNECTION_FAILED, "Google Client connection failed: " + connectionResult.getErrorMessage());
333 | if(connectionResult.hasResolution()) {
334 | try {
335 | PendingIntent pi = connectionResult.getResolution();
336 | Log.d(getName(), "Attempting to launch permission modal after failure.");
337 | pi.send();
338 | } catch (PendingIntent.CanceledException exception) {
339 | Log.e(getName(), exception.getMessage());
340 | }
341 | }
342 | }
343 |
344 | @Override
345 | public void onHostResume() {
346 | Log.i(getName(), "onHostResume");
347 | String pubMsg = getPublishedMessageString();
348 | if(_isPublishing && pubMsg != null) {
349 | publish(pubMsg);
350 | }
351 | if(_isSubscribing) {
352 | subscribe();
353 | }
354 |
355 | }
356 |
357 | @Override
358 | public void onHostPause() {
359 | Log.i(getName(), "onHostPause");
360 | unpublish();
361 | unsubscribe();
362 | }
363 |
364 | @Override
365 | public void onHostDestroy() {
366 | Log.i(getName(), "onHostDestroy");
367 | unpublish();
368 | unsubscribe();
369 | }
370 |
371 | private void emitEvent(RNNearbyApiEvent event, Message message) {
372 | emitEvent(event, new String(message.getContent()));
373 | }
374 |
375 | private void emitEvent(RNNearbyApiEvent event, Message message, Integer value) {
376 | emitEvent(event, new String(message.getContent()), value);
377 | }
378 |
379 | private void emitEvent(RNNearbyApiEvent event, String message) {
380 | emitEvent(event, message, null);
381 | }
382 |
383 | private void emitEvent(RNNearbyApiEvent event, String message, Integer value) {
384 | WritableMap params = Arguments.createMap();
385 | params.putString("event", event.toString());
386 | params.putString("message", message);
387 | if(value != null) {
388 | params.putInt("value", value);
389 | }
390 | RNNearbyApiModule.emitEvent(getReactApplicationContext(), "subscribe", params);
391 | }
392 |
393 | private static void emitEvent(ReactContext context, String event, Object object) {
394 | if (context != null) {
395 | context.getJSModule(DeviceEventManagerModule.RCTDeviceEventEmitter.class)
396 | .emit(event, object);
397 | } else {
398 | Log.e("eventEmit", "Null context");
399 | }
400 |
401 | }
402 | }
--------------------------------------------------------------------------------
/android/src/main/java/com/badfeatures/nearby/RNNearbyApiPackage.java:
--------------------------------------------------------------------------------
1 |
2 | package com.badfeatures.nearby;
3 |
4 | import java.util.Arrays;
5 | import java.util.Collections;
6 | import java.util.List;
7 |
8 | import com.facebook.react.ReactPackage;
9 | import com.facebook.react.bridge.NativeModule;
10 | import com.facebook.react.bridge.ReactApplicationContext;
11 | import com.facebook.react.uimanager.ViewManager;
12 | import com.facebook.react.bridge.JavaScriptModule;
13 | public class RNNearbyApiPackage implements ReactPackage {
14 | @Override
15 | public List createNativeModules(ReactApplicationContext reactContext) {
16 | return Arrays.asList(new RNNearbyApiModule(reactContext));
17 | }
18 |
19 | // Deprecated from RN 0.47
20 | public List> createJSModules() {
21 | return Collections.emptyList();
22 | }
23 |
24 | @Override
25 | public List createViewManagers(ReactApplicationContext reactContext) {
26 | return Collections.emptyList();
27 | }
28 | }
--------------------------------------------------------------------------------
/build.gradle:
--------------------------------------------------------------------------------
1 | // Top-level build file where you can add configuration options common to all sub-projects/modules.
2 |
3 | buildscript {
4 | repositories {
5 | jcenter()
6 | }
7 | dependencies {
8 | classpath 'com.android.tools.build:gradle:2.2.3'
9 | }
10 | }
11 |
12 | allprojects {
13 | repositories {
14 | mavenLocal()
15 | jcenter()
16 | maven {
17 | // All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
18 | url "$rootDir/node_modules/react-native/android"
19 | }
20 | }
21 | }
22 |
23 | task clean(type: Delete) {
24 | delete rootProject.buildDir
25 | }
--------------------------------------------------------------------------------
/example/.package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "example",
3 | "version": "1.0.0",
4 | "main": "index.js",
5 | "scripts": {
6 | "start": "node ./node_modules/react-native/local-cli/cli.js start"
7 | },
8 | "peerDependencies": {
9 | "react": ">=15.4.0 || ^16.0.0-alpha",
10 | "react-native": "^0.41.2"
11 | },
12 | "devDependencies": {
13 | "babel-plugin-module-resolver": "^3.0.0",
14 | "escape-string-regexp": "^1.0.5",
15 | "metro-bundler": "^0.20.3",
16 | "react": "16.0.0-alpha.12",
17 | "react-native": "^0.50.1"
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/example/.watchmanconfig:
--------------------------------------------------------------------------------
1 | {}
--------------------------------------------------------------------------------
/example/App.js:
--------------------------------------------------------------------------------
1 | /**
2 | * Sample React Native App
3 | * https://github.com/facebook/react-native
4 | * @flow
5 | */
6 |
7 | import React, { Component } from "react";
8 | import {
9 | Platform,
10 | StyleSheet,
11 | Text,
12 | View,
13 | TouchableOpacity
14 | } from "react-native";
15 | import { NearbyAPI } from "react-native-nearby-api";
16 |
17 | const instructions = Platform.select({
18 | ios: "Press Cmd+R to reload,\n" + "Cmd+D or shake for dev menu",
19 | android:
20 | "Double tap R on your keyboard to reload,\n" +
21 | "Shake or press menu button for dev menu"
22 | });
23 |
24 | const nearbyAPI = new NearbyAPI(true);
25 |
26 | const API_KEY = "MY_API_KEY";
27 |
28 | export default class App extends Component {
29 | constructor() {
30 | super();
31 | this.state = {
32 | isConnected: false,
33 | nearbyMessage: null,
34 | connectText: "CONNECT",
35 | isPublishing: false,
36 | isSubscribing: false
37 | };
38 | }
39 |
40 | componentDidMount() {
41 | console.log("Mounting ", NearbyAPI);
42 | nearbyAPI.onConnected(message => {
43 | console.log(message);
44 | nearbyAPI.isConnected((connected, error) => {
45 | this.setState({
46 | nearbyMessage: `Connected - ${message}`,
47 | isConnected: connected
48 | });
49 | });
50 | });
51 | nearbyAPI.onDisconnected(message => {
52 | console.log(message);
53 | this.setState({
54 | isConnected: false,
55 | nearbyMessage: `Disconnected - ${message}`
56 | });
57 | });
58 | nearbyAPI.onFound(message => {
59 | console.log("Message Found!");
60 | console.log(message);
61 | this.setState({ nearbyMessage: `Message Found - ${message}` });
62 | });
63 | nearbyAPI.onLost(message => {
64 | console.log("Message Lost!");
65 | console.log(message);
66 | this.setState({ nearbyMessage: `Message Lost - ${message}` });
67 | });
68 | nearbyAPI.onDistanceChanged((message, value) => {
69 | console.log("Distance Changed!");
70 | console.log(message, value);
71 | this.setState({
72 | nearbyMessage: `Distance Changed - ${message} - ${value}`
73 | });
74 | });
75 | nearbyAPI.onPublishSuccess(message => {
76 | nearbyAPI.isPublishing((status, error) => {
77 | this.setState({
78 | nearbyMessage: `Publish Success - ${message}`,
79 | isPublishing: status
80 | });
81 | });
82 | });
83 | nearbyAPI.onPublishFailed(message => {
84 | console.log(message);
85 | nearbyAPI.isPublishing((status, error) => {
86 | this.setState({
87 | nearbyMessage: `Publish Failed - ${message}`,
88 | isPublishing: status
89 | });
90 | });
91 | });
92 | nearbyAPI.onSubscribeSuccess(() => {
93 | nearbyAPI.isSubscribing((status, error) => {
94 | this.setState({
95 | nearbyMessage: `Subscribe Success`,
96 | isSubscribing: status
97 | });
98 | });
99 | });
100 | nearbyAPI.onSubscribeFailed(() => {
101 | nearbyAPI.isSubscribing((status, error) => {
102 | this.setState({
103 | nearbyMessage: `Subscribe Failed`,
104 | isSubscribing: status
105 | });
106 | });
107 | });
108 | }
109 |
110 | _connectPress = () => {
111 | if (this.state.isConnected) {
112 | nearbyAPI.disconnect();
113 | nearbyAPI.isConnected((connected, error) => {
114 | this.setState({
115 | nearbyMessage: `Disconnected`,
116 | isConnected: connected
117 | });
118 | });
119 | } else {
120 | nearbyAPI.connect(API_KEY);
121 | }
122 | };
123 |
124 | _publishPress = () => {
125 | if (!this.state.isPublishing) {
126 | nearbyAPI.publish(`Hello World! - ${Math.random()}`);
127 | } else {
128 | nearbyAPI.unpublish();
129 | nearbyAPI.isPublishing((status, error) => {
130 | this.setState({
131 | nearbyMessage: `unpublished`,
132 | isPublishing: status
133 | });
134 | });
135 | }
136 | };
137 |
138 | _subscribePress = () => {
139 | if (!this.state.isSubscribing) {
140 | nearbyAPI.subscribe();
141 | } else {
142 | nearbyAPI.unsubscribe();
143 | nearbyAPI.isSubscribing((status, error) => {
144 | this.setState({
145 | nearbyMessage: `unsubscribed`,
146 | isSubscribing: status
147 | });
148 | });
149 | }
150 | };
151 |
152 | render() {
153 | return (
154 |
155 |
156 | Welcome to react-native-nearby-api test app!
157 |
158 |
159 | Is Connected: {`${this.state.isConnected}`}
160 |
161 |
162 | Is Publishing: {`${this.state.isPublishing}`}
163 |
164 |
165 | Is Subscribing: {`${this.state.isSubscribing}`}
166 |
167 | {this.state.nearbyMessage}
168 |
169 |
170 | {this.state.isConnected ? "DISCONNECT" : "CONNECT"}
171 |
172 |
173 |
174 |
175 |
176 | {this.state.isPublishing ? "UNPUBLISH" : "PUBLISH"}
177 |
178 |
179 |
180 |
181 |
182 | {this.state.isSubscribing ? "UNSUBSCRIBE" : "SUBSCRIBE"}
183 |
184 |
185 |
186 | );
187 | }
188 | }
189 |
190 | const styles = StyleSheet.create({
191 | container: {
192 | flex: 1,
193 | justifyContent: "center",
194 | alignItems: "center",
195 | backgroundColor: "#F5FCFF"
196 | },
197 | welcome: {
198 | fontSize: 20,
199 | textAlign: "center",
200 | margin: 10
201 | },
202 | connectButton: {
203 | fontSize: 30,
204 | textAlign: "center",
205 | margin: 10
206 | },
207 | instructions: {
208 | textAlign: "center",
209 | color: "#333333",
210 | marginBottom: 5
211 | }
212 | });
213 |
--------------------------------------------------------------------------------
/example/android/app/BUCK:
--------------------------------------------------------------------------------
1 | # To learn about Buck see [Docs](https://buckbuild.com/).
2 | # To run your application with Buck:
3 | # - install Buck
4 | # - `npm start` - to start the packager
5 | # - `cd android`
6 | # - `keytool -genkey -v -keystore keystores/debug.keystore -storepass android -alias androiddebugkey -keypass android -dname "CN=Android Debug,O=Android,C=US"`
7 | # - `./gradlew :app:copyDownloadableDepsToLibs` - make all Gradle compile dependencies available to Buck
8 | # - `buck install -r android/app` - compile, install and run application
9 | #
10 |
11 | lib_deps = []
12 |
13 | for jarfile in glob(['libs/*.jar']):
14 | name = 'jars__' + jarfile[jarfile.rindex('/') + 1: jarfile.rindex('.jar')]
15 | lib_deps.append(':' + name)
16 | prebuilt_jar(
17 | name = name,
18 | binary_jar = jarfile,
19 | )
20 |
21 | for aarfile in glob(['libs/*.aar']):
22 | name = 'aars__' + aarfile[aarfile.rindex('/') + 1: aarfile.rindex('.aar')]
23 | lib_deps.append(':' + name)
24 | android_prebuilt_aar(
25 | name = name,
26 | aar = aarfile,
27 | )
28 |
29 | android_library(
30 | name = "all-libs",
31 | exported_deps = lib_deps,
32 | )
33 |
34 | android_library(
35 | name = "app-code",
36 | srcs = glob([
37 | "src/main/java/**/*.java",
38 | ]),
39 | deps = [
40 | ":all-libs",
41 | ":build_config",
42 | ":res",
43 | ],
44 | )
45 |
46 | android_build_config(
47 | name = "build_config",
48 | package = "com.example",
49 | )
50 |
51 | android_resource(
52 | name = "res",
53 | package = "com.example",
54 | res = "src/main/res",
55 | )
56 |
57 | android_binary(
58 | name = "app",
59 | keystore = "//android/keystores:debug",
60 | manifest = "src/main/AndroidManifest.xml",
61 | package_type = "debug",
62 | deps = [
63 | ":app-code",
64 | ],
65 | )
66 |
--------------------------------------------------------------------------------
/example/android/app/build.gradle:
--------------------------------------------------------------------------------
1 | apply plugin: "com.android.application"
2 |
3 | import com.android.build.OutputFile
4 |
5 | /**
6 | * The react.gradle file registers a task for each build variant (e.g. bundleDebugJsAndAssets
7 | * and bundleReleaseJsAndAssets).
8 | * These basically call `react-native bundle` with the correct arguments during the Android build
9 | * cycle. By default, bundleDebugJsAndAssets is skipped, as in debug/dev mode we prefer to load the
10 | * bundle directly from the development server. Below you can see all the possible configurations
11 | * and their defaults. If you decide to add a configuration block, make sure to add it before the
12 | * `apply from: "../../node_modules/react-native/react.gradle"` line.
13 | *
14 | * project.ext.react = [
15 | * // the name of the generated asset file containing your JS bundle
16 | * bundleAssetName: "index.android.bundle",
17 | *
18 | * // the entry file for bundle generation
19 | * entryFile: "index.android.js",
20 | *
21 | * // whether to bundle JS and assets in debug mode
22 | * bundleInDebug: false,
23 | *
24 | * // whether to bundle JS and assets in release mode
25 | * bundleInRelease: true,
26 | *
27 | * // whether to bundle JS and assets in another build variant (if configured).
28 | * // See http://tools.android.com/tech-docs/new-build-system/user-guide#TOC-Build-Variants
29 | * // The configuration property can be in the following formats
30 | * // 'bundleIn${productFlavor}${buildType}'
31 | * // 'bundleIn${buildType}'
32 | * // bundleInFreeDebug: true,
33 | * // bundleInPaidRelease: true,
34 | * // bundleInBeta: true,
35 | *
36 | * // whether to disable dev mode in custom build variants (by default only disabled in release)
37 | * // for example: to disable dev mode in the staging build type (if configured)
38 | * devDisabledInStaging: true,
39 | * // The configuration property can be in the following formats
40 | * // 'devDisabledIn${productFlavor}${buildType}'
41 | * // 'devDisabledIn${buildType}'
42 | *
43 | * // the root of your project, i.e. where "package.json" lives
44 | * root: "../../",
45 | *
46 | * // where to put the JS bundle asset in debug mode
47 | * jsBundleDirDebug: "$buildDir/intermediates/assets/debug",
48 | *
49 | * // where to put the JS bundle asset in release mode
50 | * jsBundleDirRelease: "$buildDir/intermediates/assets/release",
51 | *
52 | * // where to put drawable resources / React Native assets, e.g. the ones you use via
53 | * // require('./image.png')), in debug mode
54 | * resourcesDirDebug: "$buildDir/intermediates/res/merged/debug",
55 | *
56 | * // where to put drawable resources / React Native assets, e.g. the ones you use via
57 | * // require('./image.png')), in release mode
58 | * resourcesDirRelease: "$buildDir/intermediates/res/merged/release",
59 | *
60 | * // by default the gradle tasks are skipped if none of the JS files or assets change; this means
61 | * // that we don't look at files in android/ or ios/ to determine whether the tasks are up to
62 | * // date; if you have any other folders that you want to ignore for performance reasons (gradle
63 | * // indexes the entire tree), add them here. Alternatively, if you have JS files in android/
64 | * // for example, you might want to remove it from here.
65 | * inputExcludes: ["android/**", "ios/**"],
66 | *
67 | * // override which node gets called and with what additional arguments
68 | * nodeExecutableAndArgs: ["node"],
69 | *
70 | * // supply additional arguments to the packager
71 | * extraPackagerArgs: []
72 | * ]
73 | */
74 |
75 | project.ext.react = [
76 | // the name of the generated asset file containing your JS bundle
77 | bundleAssetName : "index.android.bundle",
78 |
79 | // the entry file for bundle generation
80 | entryFile : "index.js",
81 |
82 | // the root of your project, i.e. where "package.json" lives
83 | root : "../../../",
84 |
85 | // supply additional arguments to the packager
86 | extraPackagerArgs: []
87 | ]
88 |
89 |
90 | apply from: "../../../node_modules/react-native/react.gradle"
91 |
92 | /**
93 | * Set this to true to create two separate APKs instead of one:
94 | * - An APK that only works on ARM devices
95 | * - An APK that only works on x86 devices
96 | * The advantage is the size of the APK is reduced by about 4MB.
97 | * Upload all the APKs to the Play Store and people will download
98 | * the correct one based on the CPU architecture of their device.
99 | */
100 | def enableSeparateBuildPerCPUArchitecture = false
101 |
102 | /**
103 | * Run Proguard to shrink the Java bytecode in release builds.
104 | */
105 | def enableProguardInReleaseBuilds = false
106 |
107 | android {
108 | compileSdkVersion 23
109 | buildToolsVersion "23.0.1"
110 |
111 | defaultConfig {
112 | applicationId "com.example"
113 | minSdkVersion 16
114 | targetSdkVersion 22
115 | versionCode 1
116 | versionName "1.0"
117 | ndk {
118 | abiFilters "armeabi-v7a", "x86"
119 | }
120 | }
121 | splits {
122 | abi {
123 | reset()
124 | enable enableSeparateBuildPerCPUArchitecture
125 | universalApk false // If true, also generate a universal APK
126 | include "armeabi-v7a", "x86"
127 | }
128 | }
129 | buildTypes {
130 | release {
131 | minifyEnabled enableProguardInReleaseBuilds
132 | proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro"
133 | }
134 | }
135 | // applicationVariants are e.g. debug, release
136 | applicationVariants.all { variant ->
137 | variant.outputs.each { output ->
138 | // For each separate APK per architecture, set a unique version code as described here:
139 | // http://tools.android.com/tech-docs/new-build-system/user-guide/apk-splits
140 | def versionCodes = ["armeabi-v7a":1, "x86":2]
141 | def abi = output.getFilter(OutputFile.ABI)
142 | if (abi != null) { // null for the universal-debug, universal-release variants
143 | output.versionCodeOverride =
144 | versionCodes.get(abi) * 1048576 + defaultConfig.versionCode
145 | }
146 | }
147 | }
148 | }
149 |
150 | dependencies {
151 | compile fileTree(dir: "libs", include: ["*.jar"])
152 | compile "com.android.support:appcompat-v7:23.0.1"
153 | compile "com.facebook.react:react-native:0.50+" // From node_modules
154 | compile project(':react-native-nearby-api-lib')
155 | }
156 |
157 | // Run this once to be able to run the application with BUCK
158 | // puts all compile dependencies into folder libs for BUCK to use
159 | task copyDownloadableDepsToLibs(type: Copy) {
160 | from configurations.compile
161 | into 'libs'
162 | }
--------------------------------------------------------------------------------
/example/android/app/proguard-rules.pro:
--------------------------------------------------------------------------------
1 | # Add project specific ProGuard rules here.
2 | # By default, the flags in this file are appended to flags specified
3 | # in /usr/local/Cellar/android-sdk/24.3.3/tools/proguard/proguard-android.txt
4 | # You can edit the include path and order by changing the proguardFiles
5 | # directive in build.gradle.
6 | #
7 | # For more details, see
8 | # http://developer.android.com/guide/developing/tools/proguard.html
9 |
10 | # Add any project specific keep options here:
11 |
12 | # If your project uses WebView with JS, uncomment the following
13 | # and specify the fully qualified class name to the JavaScript interface
14 | # class:
15 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview {
16 | # public *;
17 | #}
18 |
19 | # Disabling obfuscation is useful if you collect stack traces from production crashes
20 | # (unless you are using a system that supports de-obfuscate the stack traces).
21 | -dontobfuscate
22 |
23 | # React Native
24 |
25 | # Keep our interfaces so they can be used by other ProGuard rules.
26 | # See http://sourceforge.net/p/proguard/bugs/466/
27 | -keep,allowobfuscation @interface com.facebook.proguard.annotations.DoNotStrip
28 | -keep,allowobfuscation @interface com.facebook.proguard.annotations.KeepGettersAndSetters
29 | -keep,allowobfuscation @interface com.facebook.common.internal.DoNotStrip
30 |
31 | # Do not strip any method/class that is annotated with @DoNotStrip
32 | -keep @com.facebook.proguard.annotations.DoNotStrip class *
33 | -keep @com.facebook.common.internal.DoNotStrip class *
34 | -keepclassmembers class * {
35 | @com.facebook.proguard.annotations.DoNotStrip *;
36 | @com.facebook.common.internal.DoNotStrip *;
37 | }
38 |
39 | -keepclassmembers @com.facebook.proguard.annotations.KeepGettersAndSetters class * {
40 | void set*(***);
41 | *** get*();
42 | }
43 |
44 | -keep class * extends com.facebook.react.bridge.JavaScriptModule { *; }
45 | -keep class * extends com.facebook.react.bridge.NativeModule { *; }
46 | -keepclassmembers,includedescriptorclasses class * { native ; }
47 | -keepclassmembers class * { @com.facebook.react.uimanager.UIProp ; }
48 | -keepclassmembers class * { @com.facebook.react.uimanager.annotations.ReactProp ; }
49 | -keepclassmembers class * { @com.facebook.react.uimanager.annotations.ReactPropGroup ; }
50 |
51 | -dontwarn com.facebook.react.**
52 |
53 | # TextLayoutBuilder uses a non-public Android constructor within StaticLayout.
54 | # See libs/proxy/src/main/java/com/facebook/fbui/textlayoutbuilder/proxy for details.
55 | -dontwarn android.text.StaticLayout
56 |
57 | # okhttp
58 |
59 | -keepattributes Signature
60 | -keepattributes *Annotation*
61 | -keep class okhttp3.** { *; }
62 | -keep interface okhttp3.** { *; }
63 | -dontwarn okhttp3.**
64 |
65 | # okio
66 |
67 | -keep class sun.misc.Unsafe { *; }
68 | -dontwarn java.nio.file.*
69 | -dontwarn org.codehaus.mojo.animal_sniffer.IgnoreJRERequirement
70 | -dontwarn okio.**
71 |
--------------------------------------------------------------------------------
/example/android/app/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
16 |
17 |
23 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
37 |
38 |
39 |
--------------------------------------------------------------------------------
/example/android/app/src/main/java/com/example/MainActivity.java:
--------------------------------------------------------------------------------
1 | package com.example;
2 |
3 | import com.facebook.react.ReactActivity;
4 |
5 | public class MainActivity extends ReactActivity {
6 |
7 | /**
8 | * Returns the name of the main component registered from JavaScript.
9 | * This is used to schedule rendering of the component.
10 | */
11 | @Override
12 | protected String getMainComponentName() {
13 | return "example";
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/example/android/app/src/main/java/com/example/MainApplication.java:
--------------------------------------------------------------------------------
1 | package com.example;
2 |
3 | import android.app.Application;
4 |
5 | import com.badfeatures.nearby.RNNearbyApiPackage;
6 | import com.facebook.react.ReactApplication;
7 | import com.facebook.react.ReactNativeHost;
8 | import com.facebook.react.ReactPackage;
9 | import com.facebook.react.shell.MainReactPackage;
10 | import com.facebook.soloader.SoLoader;
11 |
12 | import java.util.Arrays;
13 | import java.util.List;
14 |
15 | public class MainApplication extends Application implements ReactApplication {
16 |
17 | private final ReactNativeHost mReactNativeHost = new ReactNativeHost(this) {
18 | @Override
19 | public boolean getUseDeveloperSupport() {
20 | return BuildConfig.DEBUG;
21 | }
22 |
23 | @Override
24 | protected List getPackages() {
25 | return Arrays.asList(
26 | new MainReactPackage(),
27 | new RNNearbyApiPackage()
28 | );
29 | }
30 |
31 | @Override
32 | protected String getJSMainModuleName() {
33 | return "index";
34 | }
35 | };
36 |
37 | @Override
38 | public ReactNativeHost getReactNativeHost() {
39 | return mReactNativeHost;
40 | }
41 |
42 | @Override
43 | public void onCreate() {
44 | super.onCreate();
45 | SoLoader.init(this, /* native exopackage */ false);
46 | }
47 | }
48 |
--------------------------------------------------------------------------------
/example/android/app/src/main/res/mipmap-hdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/badfeatures/react-native-nearby-api/7a916d859712e1a66005a256db18be8120442e0e/example/android/app/src/main/res/mipmap-hdpi/ic_launcher.png
--------------------------------------------------------------------------------
/example/android/app/src/main/res/mipmap-mdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/badfeatures/react-native-nearby-api/7a916d859712e1a66005a256db18be8120442e0e/example/android/app/src/main/res/mipmap-mdpi/ic_launcher.png
--------------------------------------------------------------------------------
/example/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/badfeatures/react-native-nearby-api/7a916d859712e1a66005a256db18be8120442e0e/example/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/badfeatures/react-native-nearby-api/7a916d859712e1a66005a256db18be8120442e0e/example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/example/android/app/src/main/res/values/strings.xml:
--------------------------------------------------------------------------------
1 |
2 | example
3 |
4 |
--------------------------------------------------------------------------------
/example/android/app/src/main/res/values/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/example/android/gradle/wrapper/gradle-wrapper.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/badfeatures/react-native-nearby-api/7a916d859712e1a66005a256db18be8120442e0e/example/android/gradle/wrapper/gradle-wrapper.jar
--------------------------------------------------------------------------------
/example/android/gradle/wrapper/gradle-wrapper.properties:
--------------------------------------------------------------------------------
1 | distributionBase=GRADLE_USER_HOME
2 | distributionPath=wrapper/dists
3 | zipStoreBase=GRADLE_USER_HOME
4 | zipStorePath=wrapper/dists
5 | distributionUrl=https\://services.gradle.org/distributions/gradle-2.14.1-all.zip
6 |
--------------------------------------------------------------------------------
/example/android/keystores/BUCK:
--------------------------------------------------------------------------------
1 | keystore(
2 | name = "debug",
3 | properties = "debug.keystore.properties",
4 | store = "debug.keystore",
5 | visibility = [
6 | "PUBLIC",
7 | ],
8 | )
9 |
--------------------------------------------------------------------------------
/example/android/keystores/debug.keystore.properties:
--------------------------------------------------------------------------------
1 | key.store=debug.keystore
2 | key.alias=androiddebugkey
3 | key.store.password=android
4 | key.alias.password=android
5 |
--------------------------------------------------------------------------------
/example/index.js:
--------------------------------------------------------------------------------
1 | import { AppRegistry } from 'react-native';
2 | import App from './App';
3 |
4 | AppRegistry.registerComponent('example', () => App);
5 |
--------------------------------------------------------------------------------
/example/ios/Podfile:
--------------------------------------------------------------------------------
1 | # Uncomment the next line to define a global platform for your project
2 | platform :ios, '9.0'
3 |
4 | target 'example' do
5 | pod 'NearbyMessages'
6 | end
7 |
--------------------------------------------------------------------------------
/example/ios/Podfile.lock:
--------------------------------------------------------------------------------
1 | PODS:
2 | - GoogleInterchangeUtilities (1.2.2):
3 | - GoogleSymbolUtilities (~> 1.1)
4 | - GoogleNetworkingUtilities (1.2.2):
5 | - GoogleSymbolUtilities (~> 1.1)
6 | - GoogleSymbolUtilities (1.1.2)
7 | - GoogleUtilities (1.3.2):
8 | - GoogleSymbolUtilities (~> 1.1)
9 | - NearbyMessages (1.1.0):
10 | - GoogleInterchangeUtilities (~> 1.2)
11 | - GoogleNetworkingUtilities (~> 1.2)
12 | - GoogleSymbolUtilities (~> 1.1)
13 | - GoogleUtilities (~> 1.3)
14 |
15 | DEPENDENCIES:
16 | - NearbyMessages
17 |
18 | SPEC CHECKSUMS:
19 | GoogleInterchangeUtilities: d5bc4d88d5b661ab72f9d70c58d02ca8c27ad1f7
20 | GoogleNetworkingUtilities: 3edd3a8161347494f2da60ea0deddc8a472d94cb
21 | GoogleSymbolUtilities: 631ee17048aa5e9ab133470d768ea997a5ef9b96
22 | GoogleUtilities: 8bbc733218aad26306f9d4a253823986110e3358
23 | NearbyMessages: be3e1c44b563c020246312647f3f1128b603693d
24 |
25 | PODFILE CHECKSUM: 76126e8ca75f4a4cba2360d9f48e4fd9bc2eac07
26 |
27 | COCOAPODS: 1.2.0
28 |
--------------------------------------------------------------------------------
/example/ios/example.xcodeproj/project.pbxproj:
--------------------------------------------------------------------------------
1 | // !$*UTF8*$!
2 | {
3 | archiveVersion = 1;
4 | classes = {
5 | };
6 | objectVersion = 46;
7 | objects = {
8 |
9 | /* Begin PBXBuildFile section */
10 | 13B07FBC1A68108700A75B9A /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 13B07FB01A68108700A75B9A /* AppDelegate.m */; };
11 | 13B07FBD1A68108700A75B9A /* LaunchScreen.xib in Resources */ = {isa = PBXBuildFile; fileRef = 13B07FB11A68108700A75B9A /* LaunchScreen.xib */; };
12 | 13B07FBF1A68108700A75B9A /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 13B07FB51A68108700A75B9A /* Images.xcassets */; };
13 | 13B07FC11A68108700A75B9A /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 13B07FB71A68108700A75B9A /* main.m */; };
14 | EA71BB971FC397E4008021B9 /* libPods-example.a in Frameworks */ = {isa = PBXBuildFile; fileRef = EA71BB981FC397E4008021B9 /* libPods-example.a */; };
15 | EA76A1DB1FC39242003CCADC /* libRCTActionSheet.a in Frameworks */ = {isa = PBXBuildFile; fileRef = EA76A1921FC391AE003CCADC /* libRCTActionSheet.a */; };
16 | EA76A1DC1FC39242003CCADC /* libRCTAnimation.a in Frameworks */ = {isa = PBXBuildFile; fileRef = EA76A15F1FC3918C003CCADC /* libRCTAnimation.a */; };
17 | EA76A1DD1FC39242003CCADC /* libRCTBlob.a in Frameworks */ = {isa = PBXBuildFile; fileRef = EA76A1981FC391B7003CCADC /* libRCTBlob.a */; };
18 | EA76A1DE1FC39242003CCADC /* libRCTGeolocation.a in Frameworks */ = {isa = PBXBuildFile; fileRef = EA76A19F1FC391C2003CCADC /* libRCTGeolocation.a */; };
19 | EA76A1DF1FC39242003CCADC /* libRCTImage.a in Frameworks */ = {isa = PBXBuildFile; fileRef = EA76A1A51FC391D0003CCADC /* libRCTImage.a */; };
20 | EA76A1E01FC39242003CCADC /* libRCTLinking.a in Frameworks */ = {isa = PBXBuildFile; fileRef = EA76A1AD1FC391DF003CCADC /* libRCTLinking.a */; };
21 | EA76A1E11FC39242003CCADC /* libRCTNetwork.a in Frameworks */ = {isa = PBXBuildFile; fileRef = EA76A1B51FC391EB003CCADC /* libRCTNetwork.a */; };
22 | EA76A1E21FC39242003CCADC /* libRCTSettings.a in Frameworks */ = {isa = PBXBuildFile; fileRef = EA76A1BD1FC391F7003CCADC /* libRCTSettings.a */; };
23 | EA76A1E31FC39242003CCADC /* libRCTText.a in Frameworks */ = {isa = PBXBuildFile; fileRef = EA76A1C51FC39203003CCADC /* libRCTText.a */; };
24 | EA76A1E41FC39242003CCADC /* libRCTVibration.a in Frameworks */ = {isa = PBXBuildFile; fileRef = EA76A1CC1FC3920E003CCADC /* libRCTVibration.a */; };
25 | EA76A1E51FC39242003CCADC /* libRCTWebSocket.a in Frameworks */ = {isa = PBXBuildFile; fileRef = EA76A1D41FC3921D003CCADC /* libRCTWebSocket.a */; };
26 | EA76A1E61FC39242003CCADC /* libReact.a in Frameworks */ = {isa = PBXBuildFile; fileRef = EA76A1731FC391A1003CCADC /* libReact.a */; };
27 | EAF425581FC4C18800292434 /* libRNNearbyApi.a in Frameworks */ = {isa = PBXBuildFile; fileRef = EAF425571FC4C17800292434 /* libRNNearbyApi.a */; };
28 | /* End PBXBuildFile section */
29 |
30 | /* Begin PBXContainerItemProxy section */
31 | EA76A15E1FC3918C003CCADC /* PBXContainerItemProxy */ = {
32 | isa = PBXContainerItemProxy;
33 | containerPortal = 5E91572D1DD0AC6500FF2AA8 /* RCTAnimation.xcodeproj */;
34 | proxyType = 2;
35 | remoteGlobalIDString = 134814201AA4EA6300B7C361;
36 | remoteInfo = RCTAnimation;
37 | };
38 | EA76A1601FC3918C003CCADC /* PBXContainerItemProxy */ = {
39 | isa = PBXContainerItemProxy;
40 | containerPortal = 5E91572D1DD0AC6500FF2AA8 /* RCTAnimation.xcodeproj */;
41 | proxyType = 2;
42 | remoteGlobalIDString = 2D2A28201D9B03D100D4039D;
43 | remoteInfo = "RCTAnimation-tvOS";
44 | };
45 | EA76A1721FC391A1003CCADC /* PBXContainerItemProxy */ = {
46 | isa = PBXContainerItemProxy;
47 | containerPortal = 146833FF1AC3E56700842450 /* React.xcodeproj */;
48 | proxyType = 2;
49 | remoteGlobalIDString = 83CBBA2E1A601D0E00E9B192;
50 | remoteInfo = React;
51 | };
52 | EA76A1741FC391A1003CCADC /* PBXContainerItemProxy */ = {
53 | isa = PBXContainerItemProxy;
54 | containerPortal = 146833FF1AC3E56700842450 /* React.xcodeproj */;
55 | proxyType = 2;
56 | remoteGlobalIDString = 2D2A28131D9B038B00D4039D;
57 | remoteInfo = "React-tvOS";
58 | };
59 | EA76A1761FC391A1003CCADC /* PBXContainerItemProxy */ = {
60 | isa = PBXContainerItemProxy;
61 | containerPortal = 146833FF1AC3E56700842450 /* React.xcodeproj */;
62 | proxyType = 2;
63 | remoteGlobalIDString = 3D3C059A1DE3340900C268FA;
64 | remoteInfo = yoga;
65 | };
66 | EA76A1781FC391A1003CCADC /* PBXContainerItemProxy */ = {
67 | isa = PBXContainerItemProxy;
68 | containerPortal = 146833FF1AC3E56700842450 /* React.xcodeproj */;
69 | proxyType = 2;
70 | remoteGlobalIDString = 3D3C06751DE3340C00C268FA;
71 | remoteInfo = "yoga-tvOS";
72 | };
73 | EA76A17A1FC391A1003CCADC /* PBXContainerItemProxy */ = {
74 | isa = PBXContainerItemProxy;
75 | containerPortal = 146833FF1AC3E56700842450 /* React.xcodeproj */;
76 | proxyType = 2;
77 | remoteGlobalIDString = 3D3CD9251DE5FBEC00167DC4;
78 | remoteInfo = cxxreact;
79 | };
80 | EA76A17C1FC391A1003CCADC /* PBXContainerItemProxy */ = {
81 | isa = PBXContainerItemProxy;
82 | containerPortal = 146833FF1AC3E56700842450 /* React.xcodeproj */;
83 | proxyType = 2;
84 | remoteGlobalIDString = 3D3CD9321DE5FBEE00167DC4;
85 | remoteInfo = "cxxreact-tvOS";
86 | };
87 | EA76A17E1FC391A1003CCADC /* PBXContainerItemProxy */ = {
88 | isa = PBXContainerItemProxy;
89 | containerPortal = 146833FF1AC3E56700842450 /* React.xcodeproj */;
90 | proxyType = 2;
91 | remoteGlobalIDString = 3D3CD90B1DE5FBD600167DC4;
92 | remoteInfo = jschelpers;
93 | };
94 | EA76A1801FC391A1003CCADC /* PBXContainerItemProxy */ = {
95 | isa = PBXContainerItemProxy;
96 | containerPortal = 146833FF1AC3E56700842450 /* React.xcodeproj */;
97 | proxyType = 2;
98 | remoteGlobalIDString = 3D3CD9181DE5FBD800167DC4;
99 | remoteInfo = "jschelpers-tvOS";
100 | };
101 | EA76A1821FC391A1003CCADC /* PBXContainerItemProxy */ = {
102 | isa = PBXContainerItemProxy;
103 | containerPortal = 146833FF1AC3E56700842450 /* React.xcodeproj */;
104 | proxyType = 2;
105 | remoteGlobalIDString = 139D7ECE1E25DB7D00323FB7;
106 | remoteInfo = "third-party";
107 | };
108 | EA76A1841FC391A1003CCADC /* PBXContainerItemProxy */ = {
109 | isa = PBXContainerItemProxy;
110 | containerPortal = 146833FF1AC3E56700842450 /* React.xcodeproj */;
111 | proxyType = 2;
112 | remoteGlobalIDString = 3D383D3C1EBD27B6005632C8;
113 | remoteInfo = "third-party-tvOS";
114 | };
115 | EA76A1861FC391A1003CCADC /* PBXContainerItemProxy */ = {
116 | isa = PBXContainerItemProxy;
117 | containerPortal = 146833FF1AC3E56700842450 /* React.xcodeproj */;
118 | proxyType = 2;
119 | remoteGlobalIDString = 139D7E881E25C6D100323FB7;
120 | remoteInfo = "double-conversion";
121 | };
122 | EA76A1881FC391A1003CCADC /* PBXContainerItemProxy */ = {
123 | isa = PBXContainerItemProxy;
124 | containerPortal = 146833FF1AC3E56700842450 /* React.xcodeproj */;
125 | proxyType = 2;
126 | remoteGlobalIDString = 3D383D621EBD27B9005632C8;
127 | remoteInfo = "double-conversion-tvOS";
128 | };
129 | EA76A18A1FC391A1003CCADC /* PBXContainerItemProxy */ = {
130 | isa = PBXContainerItemProxy;
131 | containerPortal = 146833FF1AC3E56700842450 /* React.xcodeproj */;
132 | proxyType = 2;
133 | remoteGlobalIDString = 9936F3131F5F2E4B0010BF04;
134 | remoteInfo = privatedata;
135 | };
136 | EA76A18C1FC391A1003CCADC /* PBXContainerItemProxy */ = {
137 | isa = PBXContainerItemProxy;
138 | containerPortal = 146833FF1AC3E56700842450 /* React.xcodeproj */;
139 | proxyType = 2;
140 | remoteGlobalIDString = 9936F32F1F5F2E5B0010BF04;
141 | remoteInfo = "privatedata-tvOS";
142 | };
143 | EA76A1911FC391AE003CCADC /* PBXContainerItemProxy */ = {
144 | isa = PBXContainerItemProxy;
145 | containerPortal = 00C302A71ABCB8CE00DB3ED1 /* RCTActionSheet.xcodeproj */;
146 | proxyType = 2;
147 | remoteGlobalIDString = 134814201AA4EA6300B7C361;
148 | remoteInfo = RCTActionSheet;
149 | };
150 | EA76A1971FC391B7003CCADC /* PBXContainerItemProxy */ = {
151 | isa = PBXContainerItemProxy;
152 | containerPortal = ADBDB91F1DFEBF0600ED6528 /* RCTBlob.xcodeproj */;
153 | proxyType = 2;
154 | remoteGlobalIDString = 358F4ED71D1E81A9004DF814;
155 | remoteInfo = RCTBlob;
156 | };
157 | EA76A1991FC391B7003CCADC /* PBXContainerItemProxy */ = {
158 | isa = PBXContainerItemProxy;
159 | containerPortal = ADBDB91F1DFEBF0600ED6528 /* RCTBlob.xcodeproj */;
160 | proxyType = 2;
161 | remoteGlobalIDString = ADD01A681E09402E00F6D226;
162 | remoteInfo = "RCTBlob-tvOS";
163 | };
164 | EA76A19E1FC391C2003CCADC /* PBXContainerItemProxy */ = {
165 | isa = PBXContainerItemProxy;
166 | containerPortal = 00C302B51ABCB90400DB3ED1 /* RCTGeolocation.xcodeproj */;
167 | proxyType = 2;
168 | remoteGlobalIDString = 134814201AA4EA6300B7C361;
169 | remoteInfo = RCTGeolocation;
170 | };
171 | EA76A1A41FC391D0003CCADC /* PBXContainerItemProxy */ = {
172 | isa = PBXContainerItemProxy;
173 | containerPortal = 00C302BB1ABCB91800DB3ED1 /* RCTImage.xcodeproj */;
174 | proxyType = 2;
175 | remoteGlobalIDString = 58B5115D1A9E6B3D00147676;
176 | remoteInfo = RCTImage;
177 | };
178 | EA76A1A61FC391D0003CCADC /* PBXContainerItemProxy */ = {
179 | isa = PBXContainerItemProxy;
180 | containerPortal = 00C302BB1ABCB91800DB3ED1 /* RCTImage.xcodeproj */;
181 | proxyType = 2;
182 | remoteGlobalIDString = 2D2A283A1D9B042B00D4039D;
183 | remoteInfo = "RCTImage-tvOS";
184 | };
185 | EA76A1AC1FC391DF003CCADC /* PBXContainerItemProxy */ = {
186 | isa = PBXContainerItemProxy;
187 | containerPortal = 78C398B01ACF4ADC00677621 /* RCTLinking.xcodeproj */;
188 | proxyType = 2;
189 | remoteGlobalIDString = 134814201AA4EA6300B7C361;
190 | remoteInfo = RCTLinking;
191 | };
192 | EA76A1AE1FC391DF003CCADC /* PBXContainerItemProxy */ = {
193 | isa = PBXContainerItemProxy;
194 | containerPortal = 78C398B01ACF4ADC00677621 /* RCTLinking.xcodeproj */;
195 | proxyType = 2;
196 | remoteGlobalIDString = 2D2A28471D9B043800D4039D;
197 | remoteInfo = "RCTLinking-tvOS";
198 | };
199 | EA76A1B41FC391EB003CCADC /* PBXContainerItemProxy */ = {
200 | isa = PBXContainerItemProxy;
201 | containerPortal = 00C302D31ABCB9D200DB3ED1 /* RCTNetwork.xcodeproj */;
202 | proxyType = 2;
203 | remoteGlobalIDString = 58B511DB1A9E6C8500147676;
204 | remoteInfo = RCTNetwork;
205 | };
206 | EA76A1B61FC391EB003CCADC /* PBXContainerItemProxy */ = {
207 | isa = PBXContainerItemProxy;
208 | containerPortal = 00C302D31ABCB9D200DB3ED1 /* RCTNetwork.xcodeproj */;
209 | proxyType = 2;
210 | remoteGlobalIDString = 2D2A28541D9B044C00D4039D;
211 | remoteInfo = "RCTNetwork-tvOS";
212 | };
213 | EA76A1BC1FC391F7003CCADC /* PBXContainerItemProxy */ = {
214 | isa = PBXContainerItemProxy;
215 | containerPortal = 139105B61AF99BAD00B5F7CC /* RCTSettings.xcodeproj */;
216 | proxyType = 2;
217 | remoteGlobalIDString = 134814201AA4EA6300B7C361;
218 | remoteInfo = RCTSettings;
219 | };
220 | EA76A1BE1FC391F7003CCADC /* PBXContainerItemProxy */ = {
221 | isa = PBXContainerItemProxy;
222 | containerPortal = 139105B61AF99BAD00B5F7CC /* RCTSettings.xcodeproj */;
223 | proxyType = 2;
224 | remoteGlobalIDString = 2D2A28611D9B046600D4039D;
225 | remoteInfo = "RCTSettings-tvOS";
226 | };
227 | EA76A1C41FC39203003CCADC /* PBXContainerItemProxy */ = {
228 | isa = PBXContainerItemProxy;
229 | containerPortal = 832341B01AAA6A8300B99B32 /* RCTText.xcodeproj */;
230 | proxyType = 2;
231 | remoteGlobalIDString = 58B5119B1A9E6C1200147676;
232 | remoteInfo = RCTText;
233 | };
234 | EA76A1C61FC39203003CCADC /* PBXContainerItemProxy */ = {
235 | isa = PBXContainerItemProxy;
236 | containerPortal = 832341B01AAA6A8300B99B32 /* RCTText.xcodeproj */;
237 | proxyType = 2;
238 | remoteGlobalIDString = 2D2A287B1D9B048500D4039D;
239 | remoteInfo = "RCTText-tvOS";
240 | };
241 | EA76A1CB1FC3920E003CCADC /* PBXContainerItemProxy */ = {
242 | isa = PBXContainerItemProxy;
243 | containerPortal = 00C302DF1ABCB9EE00DB3ED1 /* RCTVibration.xcodeproj */;
244 | proxyType = 2;
245 | remoteGlobalIDString = 832C81801AAF6DEF007FA2F7;
246 | remoteInfo = RCTVibration;
247 | };
248 | EA76A1D31FC3921D003CCADC /* PBXContainerItemProxy */ = {
249 | isa = PBXContainerItemProxy;
250 | containerPortal = 139FDEE61B06529A00C62182 /* RCTWebSocket.xcodeproj */;
251 | proxyType = 2;
252 | remoteGlobalIDString = 3C86DF461ADF2C930047B81A;
253 | remoteInfo = RCTWebSocket;
254 | };
255 | EA76A1D51FC3921D003CCADC /* PBXContainerItemProxy */ = {
256 | isa = PBXContainerItemProxy;
257 | containerPortal = 139FDEE61B06529A00C62182 /* RCTWebSocket.xcodeproj */;
258 | proxyType = 2;
259 | remoteGlobalIDString = 2D2A28881D9B049200D4039D;
260 | remoteInfo = "RCTWebSocket-tvOS";
261 | };
262 | EA76A1D71FC3921D003CCADC /* PBXContainerItemProxy */ = {
263 | isa = PBXContainerItemProxy;
264 | containerPortal = 139FDEE61B06529A00C62182 /* RCTWebSocket.xcodeproj */;
265 | proxyType = 2;
266 | remoteGlobalIDString = 3DBE0D001F3B181A0099AA32;
267 | remoteInfo = fishhook;
268 | };
269 | EA76A1D91FC3921D003CCADC /* PBXContainerItemProxy */ = {
270 | isa = PBXContainerItemProxy;
271 | containerPortal = 139FDEE61B06529A00C62182 /* RCTWebSocket.xcodeproj */;
272 | proxyType = 2;
273 | remoteGlobalIDString = 3DBE0D0D1F3B181C0099AA32;
274 | remoteInfo = "fishhook-tvOS";
275 | };
276 | EAF425561FC4C17800292434 /* PBXContainerItemProxy */ = {
277 | isa = PBXContainerItemProxy;
278 | containerPortal = EAF4252F1FC4C17700292434 /* RNNearbyApi.xcodeproj */;
279 | proxyType = 2;
280 | remoteGlobalIDString = 134814201AA4EA6300B7C361;
281 | remoteInfo = RNNearbyApi;
282 | };
283 | /* End PBXContainerItemProxy section */
284 |
285 | /* Begin PBXFileReference section */
286 | 008F07F21AC5B25A0029DE68 /* main.jsbundle */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = main.jsbundle; sourceTree = ""; };
287 | 00C302A71ABCB8CE00DB3ED1 /* RCTActionSheet.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTActionSheet.xcodeproj; path = "../../node_modules/react-native/Libraries/ActionSheetIOS/RCTActionSheet.xcodeproj"; sourceTree = ""; };
288 | 00C302B51ABCB90400DB3ED1 /* RCTGeolocation.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTGeolocation.xcodeproj; path = "../../node_modules/react-native/Libraries/Geolocation/RCTGeolocation.xcodeproj"; sourceTree = ""; };
289 | 00C302BB1ABCB91800DB3ED1 /* RCTImage.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTImage.xcodeproj; path = "../../node_modules/react-native/Libraries/Image/RCTImage.xcodeproj"; sourceTree = ""; };
290 | 00C302D31ABCB9D200DB3ED1 /* RCTNetwork.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTNetwork.xcodeproj; path = "../../node_modules/react-native/Libraries/Network/RCTNetwork.xcodeproj"; sourceTree = ""; };
291 | 00C302DF1ABCB9EE00DB3ED1 /* RCTVibration.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTVibration.xcodeproj; path = "../../node_modules/react-native/Libraries/Vibration/RCTVibration.xcodeproj"; sourceTree = ""; };
292 | 00E356F11AD99517003FC87E /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; };
293 | 00E356F21AD99517003FC87E /* exampleTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = exampleTests.m; sourceTree = ""; };
294 | 139105B61AF99BAD00B5F7CC /* RCTSettings.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTSettings.xcodeproj; path = "../../node_modules/react-native/Libraries/Settings/RCTSettings.xcodeproj"; sourceTree = ""; };
295 | 139FDEE61B06529A00C62182 /* RCTWebSocket.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTWebSocket.xcodeproj; path = "../../node_modules/react-native/Libraries/WebSocket/RCTWebSocket.xcodeproj"; sourceTree = ""; };
296 | 13B07F961A680F5B00A75B9A /* example.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = example.app; sourceTree = BUILT_PRODUCTS_DIR; };
297 | 13B07FAF1A68108700A75B9A /* AppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = AppDelegate.h; path = example/AppDelegate.h; sourceTree = ""; };
298 | 13B07FB01A68108700A75B9A /* AppDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = AppDelegate.m; path = example/AppDelegate.m; sourceTree = ""; };
299 | 13B07FB21A68108700A75B9A /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/LaunchScreen.xib; sourceTree = ""; };
300 | 13B07FB51A68108700A75B9A /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; name = Images.xcassets; path = example/Images.xcassets; sourceTree = ""; };
301 | 13B07FB61A68108700A75B9A /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = Info.plist; path = example/Info.plist; sourceTree = ""; };
302 | 13B07FB71A68108700A75B9A /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = main.m; path = example/main.m; sourceTree = ""; };
303 | 146833FF1AC3E56700842450 /* React.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = React.xcodeproj; path = "../../node_modules/react-native/React/React.xcodeproj"; sourceTree = ""; };
304 | 5E91572D1DD0AC6500FF2AA8 /* RCTAnimation.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTAnimation.xcodeproj; path = "../../node_modules/react-native/Libraries/NativeAnimation/RCTAnimation.xcodeproj"; sourceTree = ""; };
305 | 78C398B01ACF4ADC00677621 /* RCTLinking.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTLinking.xcodeproj; path = "../../node_modules/react-native/Libraries/LinkingIOS/RCTLinking.xcodeproj"; sourceTree = ""; };
306 | 799EA99F69EA6733AD7BBA36 /* Pods-example.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-example.debug.xcconfig"; path = "Pods/Target Support Files/Pods-example/Pods-example.debug.xcconfig"; sourceTree = ""; };
307 | 832341B01AAA6A8300B99B32 /* RCTText.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTText.xcodeproj; path = "../../node_modules/react-native/Libraries/Text/RCTText.xcodeproj"; sourceTree = ""; };
308 | 84226E0AE93BCE5A646422E7 /* Pods-example.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-example.release.xcconfig"; path = "Pods/Target Support Files/Pods-example/Pods-example.release.xcconfig"; sourceTree = ""; };
309 | 95768A43531D041F68FC5F77 /* libPods-example.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-example.a"; sourceTree = BUILT_PRODUCTS_DIR; };
310 | ADBDB91F1DFEBF0600ED6528 /* RCTBlob.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTBlob.xcodeproj; path = "../../node_modules/react-native/Libraries/Blob/RCTBlob.xcodeproj"; sourceTree = ""; };
311 | EA71BB981FC397E4008021B9 /* libPods-example.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; path = "libPods-example.a"; sourceTree = BUILT_PRODUCTS_DIR; };
312 | EAF4252F1FC4C17700292434 /* RNNearbyApi.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RNNearbyApi.xcodeproj; path = ../../ios/RNNearbyApi.xcodeproj; sourceTree = ""; };
313 | EAF4255C1FC4C38B00292434 /* libGNSMessages.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libGNSMessages.a; path = Pods/NearbyMessages/Libraries/libGNSMessages.a; sourceTree = ""; };
314 | /* End PBXFileReference section */
315 |
316 | /* Begin PBXFrameworksBuildPhase section */
317 | 13B07F8C1A680F5B00A75B9A /* Frameworks */ = {
318 | isa = PBXFrameworksBuildPhase;
319 | buildActionMask = 2147483647;
320 | files = (
321 | EAF425581FC4C18800292434 /* libRNNearbyApi.a in Frameworks */,
322 | EA76A1E61FC39242003CCADC /* libReact.a in Frameworks */,
323 | EA76A1DB1FC39242003CCADC /* libRCTActionSheet.a in Frameworks */,
324 | EA76A1DC1FC39242003CCADC /* libRCTAnimation.a in Frameworks */,
325 | EA76A1DD1FC39242003CCADC /* libRCTBlob.a in Frameworks */,
326 | EA76A1DE1FC39242003CCADC /* libRCTGeolocation.a in Frameworks */,
327 | EA76A1DF1FC39242003CCADC /* libRCTImage.a in Frameworks */,
328 | EA76A1E01FC39242003CCADC /* libRCTLinking.a in Frameworks */,
329 | EA76A1E11FC39242003CCADC /* libRCTNetwork.a in Frameworks */,
330 | EA76A1E21FC39242003CCADC /* libRCTSettings.a in Frameworks */,
331 | EA76A1E31FC39242003CCADC /* libRCTText.a in Frameworks */,
332 | EA76A1E41FC39242003CCADC /* libRCTVibration.a in Frameworks */,
333 | EA76A1E51FC39242003CCADC /* libRCTWebSocket.a in Frameworks */,
334 | EA71BB971FC397E4008021B9 /* libPods-example.a in Frameworks */,
335 | );
336 | runOnlyForDeploymentPostprocessing = 0;
337 | };
338 | /* End PBXFrameworksBuildPhase section */
339 |
340 | /* Begin PBXGroup section */
341 | 00E356EF1AD99517003FC87E /* exampleTests */ = {
342 | isa = PBXGroup;
343 | children = (
344 | 00E356F21AD99517003FC87E /* exampleTests.m */,
345 | 00E356F01AD99517003FC87E /* Supporting Files */,
346 | );
347 | path = exampleTests;
348 | sourceTree = "";
349 | };
350 | 00E356F01AD99517003FC87E /* Supporting Files */ = {
351 | isa = PBXGroup;
352 | children = (
353 | 00E356F11AD99517003FC87E /* Info.plist */,
354 | );
355 | name = "Supporting Files";
356 | sourceTree = "";
357 | };
358 | 13B07FAE1A68108700A75B9A /* example */ = {
359 | isa = PBXGroup;
360 | children = (
361 | 008F07F21AC5B25A0029DE68 /* main.jsbundle */,
362 | 13B07FAF1A68108700A75B9A /* AppDelegate.h */,
363 | 13B07FB01A68108700A75B9A /* AppDelegate.m */,
364 | 13B07FB51A68108700A75B9A /* Images.xcassets */,
365 | 13B07FB61A68108700A75B9A /* Info.plist */,
366 | 13B07FB11A68108700A75B9A /* LaunchScreen.xib */,
367 | 13B07FB71A68108700A75B9A /* main.m */,
368 | );
369 | name = example;
370 | sourceTree = "";
371 | };
372 | 3FF407845A4440CD0BA81196 /* Pods */ = {
373 | isa = PBXGroup;
374 | children = (
375 | 799EA99F69EA6733AD7BBA36 /* Pods-example.debug.xcconfig */,
376 | 84226E0AE93BCE5A646422E7 /* Pods-example.release.xcconfig */,
377 | );
378 | name = Pods;
379 | sourceTree = "";
380 | };
381 | 832341AE1AAA6A7D00B99B32 /* Libraries */ = {
382 | isa = PBXGroup;
383 | children = (
384 | 5E91572D1DD0AC6500FF2AA8 /* RCTAnimation.xcodeproj */,
385 | 146833FF1AC3E56700842450 /* React.xcodeproj */,
386 | 00C302A71ABCB8CE00DB3ED1 /* RCTActionSheet.xcodeproj */,
387 | ADBDB91F1DFEBF0600ED6528 /* RCTBlob.xcodeproj */,
388 | 00C302B51ABCB90400DB3ED1 /* RCTGeolocation.xcodeproj */,
389 | 00C302BB1ABCB91800DB3ED1 /* RCTImage.xcodeproj */,
390 | 78C398B01ACF4ADC00677621 /* RCTLinking.xcodeproj */,
391 | 00C302D31ABCB9D200DB3ED1 /* RCTNetwork.xcodeproj */,
392 | 139105B61AF99BAD00B5F7CC /* RCTSettings.xcodeproj */,
393 | 832341B01AAA6A8300B99B32 /* RCTText.xcodeproj */,
394 | 00C302DF1ABCB9EE00DB3ED1 /* RCTVibration.xcodeproj */,
395 | 139FDEE61B06529A00C62182 /* RCTWebSocket.xcodeproj */,
396 | EAF4252F1FC4C17700292434 /* RNNearbyApi.xcodeproj */,
397 | );
398 | name = Libraries;
399 | sourceTree = "";
400 | };
401 | 83CBB9F61A601CBA00E9B192 = {
402 | isa = PBXGroup;
403 | children = (
404 | 13B07FAE1A68108700A75B9A /* example */,
405 | 832341AE1AAA6A7D00B99B32 /* Libraries */,
406 | 00E356EF1AD99517003FC87E /* exampleTests */,
407 | 83CBBA001A601CBA00E9B192 /* Products */,
408 | 3FF407845A4440CD0BA81196 /* Pods */,
409 | CFFD4DAD923C23EE1EE64B9B /* Frameworks */,
410 | );
411 | indentWidth = 2;
412 | sourceTree = "";
413 | tabWidth = 2;
414 | usesTabs = 0;
415 | };
416 | 83CBBA001A601CBA00E9B192 /* Products */ = {
417 | isa = PBXGroup;
418 | children = (
419 | 13B07F961A680F5B00A75B9A /* example.app */,
420 | );
421 | name = Products;
422 | sourceTree = "";
423 | };
424 | CFFD4DAD923C23EE1EE64B9B /* Frameworks */ = {
425 | isa = PBXGroup;
426 | children = (
427 | EAF4255C1FC4C38B00292434 /* libGNSMessages.a */,
428 | EA71BB981FC397E4008021B9 /* libPods-example.a */,
429 | 95768A43531D041F68FC5F77 /* libPods-example.a */,
430 | );
431 | name = Frameworks;
432 | sourceTree = "";
433 | };
434 | EA76A15A1FC3918C003CCADC /* Products */ = {
435 | isa = PBXGroup;
436 | children = (
437 | EA76A15F1FC3918C003CCADC /* libRCTAnimation.a */,
438 | EA76A1611FC3918C003CCADC /* libRCTAnimation.a */,
439 | );
440 | name = Products;
441 | sourceTree = "";
442 | };
443 | EA76A1621FC391A1003CCADC /* Products */ = {
444 | isa = PBXGroup;
445 | children = (
446 | EA76A1731FC391A1003CCADC /* libReact.a */,
447 | EA76A1751FC391A1003CCADC /* libReact.a */,
448 | EA76A1771FC391A1003CCADC /* libyoga.a */,
449 | EA76A1791FC391A1003CCADC /* libyoga.a */,
450 | EA76A17B1FC391A1003CCADC /* libcxxreact.a */,
451 | EA76A17D1FC391A1003CCADC /* libcxxreact.a */,
452 | EA76A17F1FC391A1003CCADC /* libjschelpers.a */,
453 | EA76A1811FC391A1003CCADC /* libjschelpers.a */,
454 | EA76A1831FC391A1003CCADC /* libthird-party.a */,
455 | EA76A1851FC391A1003CCADC /* libthird-party.a */,
456 | EA76A1871FC391A1003CCADC /* libdouble-conversion.a */,
457 | EA76A1891FC391A1003CCADC /* libdouble-conversion.a */,
458 | EA76A18B1FC391A1003CCADC /* libprivatedata.a */,
459 | EA76A18D1FC391A1003CCADC /* libprivatedata-tvOS.a */,
460 | );
461 | name = Products;
462 | sourceTree = "";
463 | };
464 | EA76A18E1FC391AE003CCADC /* Products */ = {
465 | isa = PBXGroup;
466 | children = (
467 | EA76A1921FC391AE003CCADC /* libRCTActionSheet.a */,
468 | );
469 | name = Products;
470 | sourceTree = "";
471 | };
472 | EA76A1931FC391B7003CCADC /* Products */ = {
473 | isa = PBXGroup;
474 | children = (
475 | EA76A1981FC391B7003CCADC /* libRCTBlob.a */,
476 | EA76A19A1FC391B7003CCADC /* libRCTBlob-tvOS.a */,
477 | );
478 | name = Products;
479 | sourceTree = "";
480 | };
481 | EA76A19B1FC391C2003CCADC /* Products */ = {
482 | isa = PBXGroup;
483 | children = (
484 | EA76A19F1FC391C2003CCADC /* libRCTGeolocation.a */,
485 | );
486 | name = Products;
487 | sourceTree = "";
488 | };
489 | EA76A1A01FC391D0003CCADC /* Products */ = {
490 | isa = PBXGroup;
491 | children = (
492 | EA76A1A51FC391D0003CCADC /* libRCTImage.a */,
493 | EA76A1A71FC391D0003CCADC /* libRCTImage-tvOS.a */,
494 | );
495 | name = Products;
496 | sourceTree = "";
497 | };
498 | EA76A1A81FC391DF003CCADC /* Products */ = {
499 | isa = PBXGroup;
500 | children = (
501 | EA76A1AD1FC391DF003CCADC /* libRCTLinking.a */,
502 | EA76A1AF1FC391DF003CCADC /* libRCTLinking-tvOS.a */,
503 | );
504 | name = Products;
505 | sourceTree = "";
506 | };
507 | EA76A1B01FC391EB003CCADC /* Products */ = {
508 | isa = PBXGroup;
509 | children = (
510 | EA76A1B51FC391EB003CCADC /* libRCTNetwork.a */,
511 | EA76A1B71FC391EB003CCADC /* libRCTNetwork-tvOS.a */,
512 | );
513 | name = Products;
514 | sourceTree = "";
515 | };
516 | EA76A1B81FC391F7003CCADC /* Products */ = {
517 | isa = PBXGroup;
518 | children = (
519 | EA76A1BD1FC391F7003CCADC /* libRCTSettings.a */,
520 | EA76A1BF1FC391F7003CCADC /* libRCTSettings-tvOS.a */,
521 | );
522 | name = Products;
523 | sourceTree = "";
524 | };
525 | EA76A1C01FC39203003CCADC /* Products */ = {
526 | isa = PBXGroup;
527 | children = (
528 | EA76A1C51FC39203003CCADC /* libRCTText.a */,
529 | EA76A1C71FC39203003CCADC /* libRCTText-tvOS.a */,
530 | );
531 | name = Products;
532 | sourceTree = "";
533 | };
534 | EA76A1C81FC3920E003CCADC /* Products */ = {
535 | isa = PBXGroup;
536 | children = (
537 | EA76A1CC1FC3920E003CCADC /* libRCTVibration.a */,
538 | );
539 | name = Products;
540 | sourceTree = "";
541 | };
542 | EA76A1CD1FC3921D003CCADC /* Products */ = {
543 | isa = PBXGroup;
544 | children = (
545 | EA76A1D41FC3921D003CCADC /* libRCTWebSocket.a */,
546 | EA76A1D61FC3921D003CCADC /* libRCTWebSocket-tvOS.a */,
547 | EA76A1D81FC3921D003CCADC /* libfishhook.a */,
548 | EA76A1DA1FC3921D003CCADC /* libfishhook-tvOS.a */,
549 | );
550 | name = Products;
551 | sourceTree = "";
552 | };
553 | EAF425301FC4C17700292434 /* Products */ = {
554 | isa = PBXGroup;
555 | children = (
556 | EAF425571FC4C17800292434 /* libRNNearbyApi.a */,
557 | );
558 | name = Products;
559 | sourceTree = "";
560 | };
561 | /* End PBXGroup section */
562 |
563 | /* Begin PBXNativeTarget section */
564 | 13B07F861A680F5B00A75B9A /* example */ = {
565 | isa = PBXNativeTarget;
566 | buildConfigurationList = 13B07F931A680F5B00A75B9A /* Build configuration list for PBXNativeTarget "example" */;
567 | buildPhases = (
568 | 56CA548088156B7469D4D8F4 /* [CP] Check Pods Manifest.lock */,
569 | 13B07F871A680F5B00A75B9A /* Sources */,
570 | 13B07F8C1A680F5B00A75B9A /* Frameworks */,
571 | 13B07F8E1A680F5B00A75B9A /* Resources */,
572 | 00DD1BFF1BD5951E006B06BC /* Bundle React Native code and images */,
573 | CB2897125BC7E237F8494031 /* [CP] Embed Pods Frameworks */,
574 | 413717BE63344AACBBBAD366 /* [CP] Copy Pods Resources */,
575 | );
576 | buildRules = (
577 | );
578 | dependencies = (
579 | );
580 | name = example;
581 | productName = "Hello World";
582 | productReference = 13B07F961A680F5B00A75B9A /* example.app */;
583 | productType = "com.apple.product-type.application";
584 | };
585 | /* End PBXNativeTarget section */
586 |
587 | /* Begin PBXProject section */
588 | 83CBB9F71A601CBA00E9B192 /* Project object */ = {
589 | isa = PBXProject;
590 | attributes = {
591 | LastUpgradeCheck = 0610;
592 | ORGANIZATIONNAME = Facebook;
593 | TargetAttributes = {
594 | 13B07F861A680F5B00A75B9A = {
595 | DevelopmentTeam = GTPZ26SPNY;
596 | };
597 | };
598 | };
599 | buildConfigurationList = 83CBB9FA1A601CBA00E9B192 /* Build configuration list for PBXProject "example" */;
600 | compatibilityVersion = "Xcode 3.2";
601 | developmentRegion = English;
602 | hasScannedForEncodings = 0;
603 | knownRegions = (
604 | en,
605 | Base,
606 | );
607 | mainGroup = 83CBB9F61A601CBA00E9B192;
608 | productRefGroup = 83CBBA001A601CBA00E9B192 /* Products */;
609 | projectDirPath = "";
610 | projectReferences = (
611 | {
612 | ProductGroup = EA76A18E1FC391AE003CCADC /* Products */;
613 | ProjectRef = 00C302A71ABCB8CE00DB3ED1 /* RCTActionSheet.xcodeproj */;
614 | },
615 | {
616 | ProductGroup = EA76A15A1FC3918C003CCADC /* Products */;
617 | ProjectRef = 5E91572D1DD0AC6500FF2AA8 /* RCTAnimation.xcodeproj */;
618 | },
619 | {
620 | ProductGroup = EA76A1931FC391B7003CCADC /* Products */;
621 | ProjectRef = ADBDB91F1DFEBF0600ED6528 /* RCTBlob.xcodeproj */;
622 | },
623 | {
624 | ProductGroup = EA76A19B1FC391C2003CCADC /* Products */;
625 | ProjectRef = 00C302B51ABCB90400DB3ED1 /* RCTGeolocation.xcodeproj */;
626 | },
627 | {
628 | ProductGroup = EA76A1A01FC391D0003CCADC /* Products */;
629 | ProjectRef = 00C302BB1ABCB91800DB3ED1 /* RCTImage.xcodeproj */;
630 | },
631 | {
632 | ProductGroup = EA76A1A81FC391DF003CCADC /* Products */;
633 | ProjectRef = 78C398B01ACF4ADC00677621 /* RCTLinking.xcodeproj */;
634 | },
635 | {
636 | ProductGroup = EA76A1B01FC391EB003CCADC /* Products */;
637 | ProjectRef = 00C302D31ABCB9D200DB3ED1 /* RCTNetwork.xcodeproj */;
638 | },
639 | {
640 | ProductGroup = EA76A1B81FC391F7003CCADC /* Products */;
641 | ProjectRef = 139105B61AF99BAD00B5F7CC /* RCTSettings.xcodeproj */;
642 | },
643 | {
644 | ProductGroup = EA76A1C01FC39203003CCADC /* Products */;
645 | ProjectRef = 832341B01AAA6A8300B99B32 /* RCTText.xcodeproj */;
646 | },
647 | {
648 | ProductGroup = EA76A1C81FC3920E003CCADC /* Products */;
649 | ProjectRef = 00C302DF1ABCB9EE00DB3ED1 /* RCTVibration.xcodeproj */;
650 | },
651 | {
652 | ProductGroup = EA76A1CD1FC3921D003CCADC /* Products */;
653 | ProjectRef = 139FDEE61B06529A00C62182 /* RCTWebSocket.xcodeproj */;
654 | },
655 | {
656 | ProductGroup = EA76A1621FC391A1003CCADC /* Products */;
657 | ProjectRef = 146833FF1AC3E56700842450 /* React.xcodeproj */;
658 | },
659 | {
660 | ProductGroup = EAF425301FC4C17700292434 /* Products */;
661 | ProjectRef = EAF4252F1FC4C17700292434 /* RNNearbyApi.xcodeproj */;
662 | },
663 | );
664 | projectRoot = "";
665 | targets = (
666 | 13B07F861A680F5B00A75B9A /* example */,
667 | );
668 | };
669 | /* End PBXProject section */
670 |
671 | /* Begin PBXReferenceProxy section */
672 | EA76A15F1FC3918C003CCADC /* libRCTAnimation.a */ = {
673 | isa = PBXReferenceProxy;
674 | fileType = archive.ar;
675 | path = libRCTAnimation.a;
676 | remoteRef = EA76A15E1FC3918C003CCADC /* PBXContainerItemProxy */;
677 | sourceTree = BUILT_PRODUCTS_DIR;
678 | };
679 | EA76A1611FC3918C003CCADC /* libRCTAnimation.a */ = {
680 | isa = PBXReferenceProxy;
681 | fileType = archive.ar;
682 | path = libRCTAnimation.a;
683 | remoteRef = EA76A1601FC3918C003CCADC /* PBXContainerItemProxy */;
684 | sourceTree = BUILT_PRODUCTS_DIR;
685 | };
686 | EA76A1731FC391A1003CCADC /* libReact.a */ = {
687 | isa = PBXReferenceProxy;
688 | fileType = archive.ar;
689 | path = libReact.a;
690 | remoteRef = EA76A1721FC391A1003CCADC /* PBXContainerItemProxy */;
691 | sourceTree = BUILT_PRODUCTS_DIR;
692 | };
693 | EA76A1751FC391A1003CCADC /* libReact.a */ = {
694 | isa = PBXReferenceProxy;
695 | fileType = archive.ar;
696 | path = libReact.a;
697 | remoteRef = EA76A1741FC391A1003CCADC /* PBXContainerItemProxy */;
698 | sourceTree = BUILT_PRODUCTS_DIR;
699 | };
700 | EA76A1771FC391A1003CCADC /* libyoga.a */ = {
701 | isa = PBXReferenceProxy;
702 | fileType = archive.ar;
703 | path = libyoga.a;
704 | remoteRef = EA76A1761FC391A1003CCADC /* PBXContainerItemProxy */;
705 | sourceTree = BUILT_PRODUCTS_DIR;
706 | };
707 | EA76A1791FC391A1003CCADC /* libyoga.a */ = {
708 | isa = PBXReferenceProxy;
709 | fileType = archive.ar;
710 | path = libyoga.a;
711 | remoteRef = EA76A1781FC391A1003CCADC /* PBXContainerItemProxy */;
712 | sourceTree = BUILT_PRODUCTS_DIR;
713 | };
714 | EA76A17B1FC391A1003CCADC /* libcxxreact.a */ = {
715 | isa = PBXReferenceProxy;
716 | fileType = archive.ar;
717 | path = libcxxreact.a;
718 | remoteRef = EA76A17A1FC391A1003CCADC /* PBXContainerItemProxy */;
719 | sourceTree = BUILT_PRODUCTS_DIR;
720 | };
721 | EA76A17D1FC391A1003CCADC /* libcxxreact.a */ = {
722 | isa = PBXReferenceProxy;
723 | fileType = archive.ar;
724 | path = libcxxreact.a;
725 | remoteRef = EA76A17C1FC391A1003CCADC /* PBXContainerItemProxy */;
726 | sourceTree = BUILT_PRODUCTS_DIR;
727 | };
728 | EA76A17F1FC391A1003CCADC /* libjschelpers.a */ = {
729 | isa = PBXReferenceProxy;
730 | fileType = archive.ar;
731 | path = libjschelpers.a;
732 | remoteRef = EA76A17E1FC391A1003CCADC /* PBXContainerItemProxy */;
733 | sourceTree = BUILT_PRODUCTS_DIR;
734 | };
735 | EA76A1811FC391A1003CCADC /* libjschelpers.a */ = {
736 | isa = PBXReferenceProxy;
737 | fileType = archive.ar;
738 | path = libjschelpers.a;
739 | remoteRef = EA76A1801FC391A1003CCADC /* PBXContainerItemProxy */;
740 | sourceTree = BUILT_PRODUCTS_DIR;
741 | };
742 | EA76A1831FC391A1003CCADC /* libthird-party.a */ = {
743 | isa = PBXReferenceProxy;
744 | fileType = archive.ar;
745 | path = "libthird-party.a";
746 | remoteRef = EA76A1821FC391A1003CCADC /* PBXContainerItemProxy */;
747 | sourceTree = BUILT_PRODUCTS_DIR;
748 | };
749 | EA76A1851FC391A1003CCADC /* libthird-party.a */ = {
750 | isa = PBXReferenceProxy;
751 | fileType = archive.ar;
752 | path = "libthird-party.a";
753 | remoteRef = EA76A1841FC391A1003CCADC /* PBXContainerItemProxy */;
754 | sourceTree = BUILT_PRODUCTS_DIR;
755 | };
756 | EA76A1871FC391A1003CCADC /* libdouble-conversion.a */ = {
757 | isa = PBXReferenceProxy;
758 | fileType = archive.ar;
759 | path = "libdouble-conversion.a";
760 | remoteRef = EA76A1861FC391A1003CCADC /* PBXContainerItemProxy */;
761 | sourceTree = BUILT_PRODUCTS_DIR;
762 | };
763 | EA76A1891FC391A1003CCADC /* libdouble-conversion.a */ = {
764 | isa = PBXReferenceProxy;
765 | fileType = archive.ar;
766 | path = "libdouble-conversion.a";
767 | remoteRef = EA76A1881FC391A1003CCADC /* PBXContainerItemProxy */;
768 | sourceTree = BUILT_PRODUCTS_DIR;
769 | };
770 | EA76A18B1FC391A1003CCADC /* libprivatedata.a */ = {
771 | isa = PBXReferenceProxy;
772 | fileType = archive.ar;
773 | path = libprivatedata.a;
774 | remoteRef = EA76A18A1FC391A1003CCADC /* PBXContainerItemProxy */;
775 | sourceTree = BUILT_PRODUCTS_DIR;
776 | };
777 | EA76A18D1FC391A1003CCADC /* libprivatedata-tvOS.a */ = {
778 | isa = PBXReferenceProxy;
779 | fileType = archive.ar;
780 | path = "libprivatedata-tvOS.a";
781 | remoteRef = EA76A18C1FC391A1003CCADC /* PBXContainerItemProxy */;
782 | sourceTree = BUILT_PRODUCTS_DIR;
783 | };
784 | EA76A1921FC391AE003CCADC /* libRCTActionSheet.a */ = {
785 | isa = PBXReferenceProxy;
786 | fileType = archive.ar;
787 | path = libRCTActionSheet.a;
788 | remoteRef = EA76A1911FC391AE003CCADC /* PBXContainerItemProxy */;
789 | sourceTree = BUILT_PRODUCTS_DIR;
790 | };
791 | EA76A1981FC391B7003CCADC /* libRCTBlob.a */ = {
792 | isa = PBXReferenceProxy;
793 | fileType = archive.ar;
794 | path = libRCTBlob.a;
795 | remoteRef = EA76A1971FC391B7003CCADC /* PBXContainerItemProxy */;
796 | sourceTree = BUILT_PRODUCTS_DIR;
797 | };
798 | EA76A19A1FC391B7003CCADC /* libRCTBlob-tvOS.a */ = {
799 | isa = PBXReferenceProxy;
800 | fileType = archive.ar;
801 | path = "libRCTBlob-tvOS.a";
802 | remoteRef = EA76A1991FC391B7003CCADC /* PBXContainerItemProxy */;
803 | sourceTree = BUILT_PRODUCTS_DIR;
804 | };
805 | EA76A19F1FC391C2003CCADC /* libRCTGeolocation.a */ = {
806 | isa = PBXReferenceProxy;
807 | fileType = archive.ar;
808 | path = libRCTGeolocation.a;
809 | remoteRef = EA76A19E1FC391C2003CCADC /* PBXContainerItemProxy */;
810 | sourceTree = BUILT_PRODUCTS_DIR;
811 | };
812 | EA76A1A51FC391D0003CCADC /* libRCTImage.a */ = {
813 | isa = PBXReferenceProxy;
814 | fileType = archive.ar;
815 | path = libRCTImage.a;
816 | remoteRef = EA76A1A41FC391D0003CCADC /* PBXContainerItemProxy */;
817 | sourceTree = BUILT_PRODUCTS_DIR;
818 | };
819 | EA76A1A71FC391D0003CCADC /* libRCTImage-tvOS.a */ = {
820 | isa = PBXReferenceProxy;
821 | fileType = archive.ar;
822 | path = "libRCTImage-tvOS.a";
823 | remoteRef = EA76A1A61FC391D0003CCADC /* PBXContainerItemProxy */;
824 | sourceTree = BUILT_PRODUCTS_DIR;
825 | };
826 | EA76A1AD1FC391DF003CCADC /* libRCTLinking.a */ = {
827 | isa = PBXReferenceProxy;
828 | fileType = archive.ar;
829 | path = libRCTLinking.a;
830 | remoteRef = EA76A1AC1FC391DF003CCADC /* PBXContainerItemProxy */;
831 | sourceTree = BUILT_PRODUCTS_DIR;
832 | };
833 | EA76A1AF1FC391DF003CCADC /* libRCTLinking-tvOS.a */ = {
834 | isa = PBXReferenceProxy;
835 | fileType = archive.ar;
836 | path = "libRCTLinking-tvOS.a";
837 | remoteRef = EA76A1AE1FC391DF003CCADC /* PBXContainerItemProxy */;
838 | sourceTree = BUILT_PRODUCTS_DIR;
839 | };
840 | EA76A1B51FC391EB003CCADC /* libRCTNetwork.a */ = {
841 | isa = PBXReferenceProxy;
842 | fileType = archive.ar;
843 | path = libRCTNetwork.a;
844 | remoteRef = EA76A1B41FC391EB003CCADC /* PBXContainerItemProxy */;
845 | sourceTree = BUILT_PRODUCTS_DIR;
846 | };
847 | EA76A1B71FC391EB003CCADC /* libRCTNetwork-tvOS.a */ = {
848 | isa = PBXReferenceProxy;
849 | fileType = archive.ar;
850 | path = "libRCTNetwork-tvOS.a";
851 | remoteRef = EA76A1B61FC391EB003CCADC /* PBXContainerItemProxy */;
852 | sourceTree = BUILT_PRODUCTS_DIR;
853 | };
854 | EA76A1BD1FC391F7003CCADC /* libRCTSettings.a */ = {
855 | isa = PBXReferenceProxy;
856 | fileType = archive.ar;
857 | path = libRCTSettings.a;
858 | remoteRef = EA76A1BC1FC391F7003CCADC /* PBXContainerItemProxy */;
859 | sourceTree = BUILT_PRODUCTS_DIR;
860 | };
861 | EA76A1BF1FC391F7003CCADC /* libRCTSettings-tvOS.a */ = {
862 | isa = PBXReferenceProxy;
863 | fileType = archive.ar;
864 | path = "libRCTSettings-tvOS.a";
865 | remoteRef = EA76A1BE1FC391F7003CCADC /* PBXContainerItemProxy */;
866 | sourceTree = BUILT_PRODUCTS_DIR;
867 | };
868 | EA76A1C51FC39203003CCADC /* libRCTText.a */ = {
869 | isa = PBXReferenceProxy;
870 | fileType = archive.ar;
871 | path = libRCTText.a;
872 | remoteRef = EA76A1C41FC39203003CCADC /* PBXContainerItemProxy */;
873 | sourceTree = BUILT_PRODUCTS_DIR;
874 | };
875 | EA76A1C71FC39203003CCADC /* libRCTText-tvOS.a */ = {
876 | isa = PBXReferenceProxy;
877 | fileType = archive.ar;
878 | path = "libRCTText-tvOS.a";
879 | remoteRef = EA76A1C61FC39203003CCADC /* PBXContainerItemProxy */;
880 | sourceTree = BUILT_PRODUCTS_DIR;
881 | };
882 | EA76A1CC1FC3920E003CCADC /* libRCTVibration.a */ = {
883 | isa = PBXReferenceProxy;
884 | fileType = archive.ar;
885 | path = libRCTVibration.a;
886 | remoteRef = EA76A1CB1FC3920E003CCADC /* PBXContainerItemProxy */;
887 | sourceTree = BUILT_PRODUCTS_DIR;
888 | };
889 | EA76A1D41FC3921D003CCADC /* libRCTWebSocket.a */ = {
890 | isa = PBXReferenceProxy;
891 | fileType = archive.ar;
892 | path = libRCTWebSocket.a;
893 | remoteRef = EA76A1D31FC3921D003CCADC /* PBXContainerItemProxy */;
894 | sourceTree = BUILT_PRODUCTS_DIR;
895 | };
896 | EA76A1D61FC3921D003CCADC /* libRCTWebSocket-tvOS.a */ = {
897 | isa = PBXReferenceProxy;
898 | fileType = archive.ar;
899 | path = "libRCTWebSocket-tvOS.a";
900 | remoteRef = EA76A1D51FC3921D003CCADC /* PBXContainerItemProxy */;
901 | sourceTree = BUILT_PRODUCTS_DIR;
902 | };
903 | EA76A1D81FC3921D003CCADC /* libfishhook.a */ = {
904 | isa = PBXReferenceProxy;
905 | fileType = archive.ar;
906 | path = libfishhook.a;
907 | remoteRef = EA76A1D71FC3921D003CCADC /* PBXContainerItemProxy */;
908 | sourceTree = BUILT_PRODUCTS_DIR;
909 | };
910 | EA76A1DA1FC3921D003CCADC /* libfishhook-tvOS.a */ = {
911 | isa = PBXReferenceProxy;
912 | fileType = archive.ar;
913 | path = "libfishhook-tvOS.a";
914 | remoteRef = EA76A1D91FC3921D003CCADC /* PBXContainerItemProxy */;
915 | sourceTree = BUILT_PRODUCTS_DIR;
916 | };
917 | EAF425571FC4C17800292434 /* libRNNearbyApi.a */ = {
918 | isa = PBXReferenceProxy;
919 | fileType = archive.ar;
920 | path = libRNNearbyApi.a;
921 | remoteRef = EAF425561FC4C17800292434 /* PBXContainerItemProxy */;
922 | sourceTree = BUILT_PRODUCTS_DIR;
923 | };
924 | /* End PBXReferenceProxy section */
925 |
926 | /* Begin PBXResourcesBuildPhase section */
927 | 13B07F8E1A680F5B00A75B9A /* Resources */ = {
928 | isa = PBXResourcesBuildPhase;
929 | buildActionMask = 2147483647;
930 | files = (
931 | 13B07FBF1A68108700A75B9A /* Images.xcassets in Resources */,
932 | 13B07FBD1A68108700A75B9A /* LaunchScreen.xib in Resources */,
933 | );
934 | runOnlyForDeploymentPostprocessing = 0;
935 | };
936 | /* End PBXResourcesBuildPhase section */
937 |
938 | /* Begin PBXShellScriptBuildPhase section */
939 | 00DD1BFF1BD5951E006B06BC /* Bundle React Native code and images */ = {
940 | isa = PBXShellScriptBuildPhase;
941 | buildActionMask = 2147483647;
942 | files = (
943 | );
944 | inputPaths = (
945 | );
946 | name = "Bundle React Native code and images";
947 | outputPaths = (
948 | );
949 | runOnlyForDeploymentPostprocessing = 0;
950 | shellPath = /bin/sh;
951 | shellScript = "export NODE_BINARY=node\n../../node_modules/react-native/scripts/react-native-xcode.sh";
952 | };
953 | 413717BE63344AACBBBAD366 /* [CP] Copy Pods Resources */ = {
954 | isa = PBXShellScriptBuildPhase;
955 | buildActionMask = 2147483647;
956 | files = (
957 | );
958 | inputPaths = (
959 | );
960 | name = "[CP] Copy Pods Resources";
961 | outputPaths = (
962 | );
963 | runOnlyForDeploymentPostprocessing = 0;
964 | shellPath = /bin/sh;
965 | shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-example/Pods-example-resources.sh\"\n";
966 | showEnvVarsInLog = 0;
967 | };
968 | 56CA548088156B7469D4D8F4 /* [CP] Check Pods Manifest.lock */ = {
969 | isa = PBXShellScriptBuildPhase;
970 | buildActionMask = 2147483647;
971 | files = (
972 | );
973 | inputPaths = (
974 | );
975 | name = "[CP] Check Pods Manifest.lock";
976 | outputPaths = (
977 | );
978 | runOnlyForDeploymentPostprocessing = 0;
979 | shellPath = /bin/sh;
980 | shellScript = "diff \"${PODS_ROOT}/../Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n";
981 | showEnvVarsInLog = 0;
982 | };
983 | CB2897125BC7E237F8494031 /* [CP] Embed Pods Frameworks */ = {
984 | isa = PBXShellScriptBuildPhase;
985 | buildActionMask = 2147483647;
986 | files = (
987 | );
988 | inputPaths = (
989 | );
990 | name = "[CP] Embed Pods Frameworks";
991 | outputPaths = (
992 | );
993 | runOnlyForDeploymentPostprocessing = 0;
994 | shellPath = /bin/sh;
995 | shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-example/Pods-example-frameworks.sh\"\n";
996 | showEnvVarsInLog = 0;
997 | };
998 | /* End PBXShellScriptBuildPhase section */
999 |
1000 | /* Begin PBXSourcesBuildPhase section */
1001 | 13B07F871A680F5B00A75B9A /* Sources */ = {
1002 | isa = PBXSourcesBuildPhase;
1003 | buildActionMask = 2147483647;
1004 | files = (
1005 | 13B07FBC1A68108700A75B9A /* AppDelegate.m in Sources */,
1006 | 13B07FC11A68108700A75B9A /* main.m in Sources */,
1007 | );
1008 | runOnlyForDeploymentPostprocessing = 0;
1009 | };
1010 | /* End PBXSourcesBuildPhase section */
1011 |
1012 | /* Begin PBXVariantGroup section */
1013 | 13B07FB11A68108700A75B9A /* LaunchScreen.xib */ = {
1014 | isa = PBXVariantGroup;
1015 | children = (
1016 | 13B07FB21A68108700A75B9A /* Base */,
1017 | );
1018 | name = LaunchScreen.xib;
1019 | path = example;
1020 | sourceTree = "";
1021 | };
1022 | /* End PBXVariantGroup section */
1023 |
1024 | /* Begin XCBuildConfiguration section */
1025 | 13B07F941A680F5B00A75B9A /* Debug */ = {
1026 | isa = XCBuildConfiguration;
1027 | baseConfigurationReference = 799EA99F69EA6733AD7BBA36 /* Pods-example.debug.xcconfig */;
1028 | buildSettings = {
1029 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
1030 | CURRENT_PROJECT_VERSION = 1;
1031 | DEAD_CODE_STRIPPING = NO;
1032 | DEVELOPMENT_TEAM = GTPZ26SPNY;
1033 | ENABLE_BITCODE = NO;
1034 | INFOPLIST_FILE = example/Info.plist;
1035 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
1036 | LIBRARY_SEARCH_PATHS = (
1037 | "$(inherited)",
1038 | "\"${PODS_ROOT}/NearbyMessages/Libraries\"",
1039 | );
1040 | OTHER_LDFLAGS = (
1041 | "$(inherited)",
1042 | "-lc++",
1043 | );
1044 | PRODUCT_NAME = example;
1045 | VERSIONING_SYSTEM = "apple-generic";
1046 | };
1047 | name = Debug;
1048 | };
1049 | 13B07F951A680F5B00A75B9A /* Release */ = {
1050 | isa = XCBuildConfiguration;
1051 | baseConfigurationReference = 84226E0AE93BCE5A646422E7 /* Pods-example.release.xcconfig */;
1052 | buildSettings = {
1053 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
1054 | CURRENT_PROJECT_VERSION = 1;
1055 | DEVELOPMENT_TEAM = GTPZ26SPNY;
1056 | ENABLE_BITCODE = NO;
1057 | INFOPLIST_FILE = example/Info.plist;
1058 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
1059 | LIBRARY_SEARCH_PATHS = (
1060 | "$(inherited)",
1061 | "\"${PODS_ROOT}/NearbyMessages/Libraries\"",
1062 | );
1063 | OTHER_LDFLAGS = (
1064 | "$(inherited)",
1065 | "-lc++",
1066 | );
1067 | PRODUCT_NAME = example;
1068 | VERSIONING_SYSTEM = "apple-generic";
1069 | };
1070 | name = Release;
1071 | };
1072 | 83CBBA201A601CBA00E9B192 /* Debug */ = {
1073 | isa = XCBuildConfiguration;
1074 | buildSettings = {
1075 | ALWAYS_SEARCH_USER_PATHS = NO;
1076 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
1077 | CLANG_CXX_LIBRARY = "libc++";
1078 | CLANG_ENABLE_MODULES = YES;
1079 | CLANG_ENABLE_OBJC_ARC = YES;
1080 | CLANG_WARN_BOOL_CONVERSION = YES;
1081 | CLANG_WARN_CONSTANT_CONVERSION = YES;
1082 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
1083 | CLANG_WARN_EMPTY_BODY = YES;
1084 | CLANG_WARN_ENUM_CONVERSION = YES;
1085 | CLANG_WARN_INT_CONVERSION = YES;
1086 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
1087 | CLANG_WARN_UNREACHABLE_CODE = YES;
1088 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
1089 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
1090 | COPY_PHASE_STRIP = NO;
1091 | ENABLE_STRICT_OBJC_MSGSEND = YES;
1092 | GCC_C_LANGUAGE_STANDARD = gnu99;
1093 | GCC_DYNAMIC_NO_PIC = NO;
1094 | GCC_OPTIMIZATION_LEVEL = 0;
1095 | GCC_PREPROCESSOR_DEFINITIONS = (
1096 | "DEBUG=1",
1097 | "$(inherited)",
1098 | );
1099 | GCC_SYMBOLS_PRIVATE_EXTERN = NO;
1100 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
1101 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
1102 | GCC_WARN_UNDECLARED_SELECTOR = YES;
1103 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
1104 | GCC_WARN_UNUSED_FUNCTION = YES;
1105 | GCC_WARN_UNUSED_VARIABLE = YES;
1106 | IPHONEOS_DEPLOYMENT_TARGET = 9.0;
1107 | MTL_ENABLE_DEBUG_INFO = YES;
1108 | ONLY_ACTIVE_ARCH = YES;
1109 | SDKROOT = iphoneos;
1110 | };
1111 | name = Debug;
1112 | };
1113 | 83CBBA211A601CBA00E9B192 /* Release */ = {
1114 | isa = XCBuildConfiguration;
1115 | buildSettings = {
1116 | ALWAYS_SEARCH_USER_PATHS = NO;
1117 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
1118 | CLANG_CXX_LIBRARY = "libc++";
1119 | CLANG_ENABLE_MODULES = YES;
1120 | CLANG_ENABLE_OBJC_ARC = YES;
1121 | CLANG_WARN_BOOL_CONVERSION = YES;
1122 | CLANG_WARN_CONSTANT_CONVERSION = YES;
1123 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
1124 | CLANG_WARN_EMPTY_BODY = YES;
1125 | CLANG_WARN_ENUM_CONVERSION = YES;
1126 | CLANG_WARN_INT_CONVERSION = YES;
1127 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
1128 | CLANG_WARN_UNREACHABLE_CODE = YES;
1129 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
1130 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
1131 | COPY_PHASE_STRIP = YES;
1132 | ENABLE_NS_ASSERTIONS = NO;
1133 | ENABLE_STRICT_OBJC_MSGSEND = YES;
1134 | GCC_C_LANGUAGE_STANDARD = gnu99;
1135 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
1136 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
1137 | GCC_WARN_UNDECLARED_SELECTOR = YES;
1138 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
1139 | GCC_WARN_UNUSED_FUNCTION = YES;
1140 | GCC_WARN_UNUSED_VARIABLE = YES;
1141 | IPHONEOS_DEPLOYMENT_TARGET = 9.0;
1142 | MTL_ENABLE_DEBUG_INFO = NO;
1143 | SDKROOT = iphoneos;
1144 | VALIDATE_PRODUCT = YES;
1145 | };
1146 | name = Release;
1147 | };
1148 | /* End XCBuildConfiguration section */
1149 |
1150 | /* Begin XCConfigurationList section */
1151 | 13B07F931A680F5B00A75B9A /* Build configuration list for PBXNativeTarget "example" */ = {
1152 | isa = XCConfigurationList;
1153 | buildConfigurations = (
1154 | 13B07F941A680F5B00A75B9A /* Debug */,
1155 | 13B07F951A680F5B00A75B9A /* Release */,
1156 | );
1157 | defaultConfigurationIsVisible = 0;
1158 | defaultConfigurationName = Release;
1159 | };
1160 | 83CBB9FA1A601CBA00E9B192 /* Build configuration list for PBXProject "example" */ = {
1161 | isa = XCConfigurationList;
1162 | buildConfigurations = (
1163 | 83CBBA201A601CBA00E9B192 /* Debug */,
1164 | 83CBBA211A601CBA00E9B192 /* Release */,
1165 | );
1166 | defaultConfigurationIsVisible = 0;
1167 | defaultConfigurationName = Release;
1168 | };
1169 | /* End XCConfigurationList section */
1170 | };
1171 | rootObject = 83CBB9F71A601CBA00E9B192 /* Project object */;
1172 | }
1173 |
--------------------------------------------------------------------------------
/example/ios/example.xcodeproj/xcshareddata/xcschemes/example-tvOS.xcscheme:
--------------------------------------------------------------------------------
1 |
2 |
5 |
8 |
9 |
15 |
21 |
22 |
23 |
29 |
35 |
36 |
37 |
43 |
49 |
50 |
51 |
52 |
53 |
58 |
59 |
61 |
67 |
68 |
69 |
70 |
71 |
77 |
78 |
79 |
80 |
81 |
82 |
92 |
94 |
100 |
101 |
102 |
103 |
104 |
105 |
111 |
113 |
119 |
120 |
121 |
122 |
124 |
125 |
128 |
129 |
130 |
--------------------------------------------------------------------------------
/example/ios/example.xcodeproj/xcshareddata/xcschemes/example.xcscheme:
--------------------------------------------------------------------------------
1 |
2 |
5 |
8 |
9 |
15 |
21 |
22 |
23 |
29 |
35 |
36 |
37 |
43 |
49 |
50 |
51 |
52 |
53 |
59 |
60 |
62 |
68 |
69 |
70 |
71 |
72 |
78 |
79 |
80 |
81 |
82 |
83 |
94 |
96 |
102 |
103 |
104 |
105 |
106 |
107 |
113 |
115 |
121 |
122 |
123 |
124 |
126 |
127 |
130 |
131 |
132 |
--------------------------------------------------------------------------------
/example/ios/example.xcworkspace/contents.xcworkspacedata:
--------------------------------------------------------------------------------
1 |
2 |
4 |
6 |
7 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/example/ios/example/AppDelegate.h:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) 2015-present, Facebook, Inc.
3 | * All rights reserved.
4 | *
5 | * This source code is licensed under the BSD-style license found in the
6 | * LICENSE file in the root directory of this source tree. An additional grant
7 | * of patent rights can be found in the PATENTS file in the same directory.
8 | */
9 |
10 | #import
11 |
12 | @interface AppDelegate : UIResponder
13 |
14 | @property (nonatomic, strong) UIWindow *window;
15 |
16 | @end
17 |
--------------------------------------------------------------------------------
/example/ios/example/AppDelegate.m:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) 2015-present, Facebook, Inc.
3 | * All rights reserved.
4 | *
5 | * This source code is licensed under the BSD-style license found in the
6 | * LICENSE file in the root directory of this source tree. An additional grant
7 | * of patent rights can be found in the PATENTS file in the same directory.
8 | */
9 |
10 | #import "AppDelegate.h"
11 |
12 | #import
13 | #import
14 |
15 | @implementation AppDelegate
16 |
17 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
18 | {
19 | NSURL *jsCodeLocation;
20 |
21 | #ifdef DEBUG
22 | jsCodeLocation = [NSURL URLWithString:@"http://192.168.1.12:8081/example/index.bundle?platform=ios&dev=true"];
23 | #else
24 | jsCodeLocation = [[NSBundle mainBundle] URLForResource:@"main" withExtension:@"jsbundle"];
25 | #endif
26 |
27 |
28 | RCTRootView *rootView = [[RCTRootView alloc] initWithBundleURL:jsCodeLocation
29 | moduleName:@"example"
30 | initialProperties:nil
31 | launchOptions:launchOptions];
32 | rootView.backgroundColor = [[UIColor alloc] initWithRed:1.0f green:1.0f blue:1.0f alpha:1];
33 |
34 | self.window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds];
35 | UIViewController *rootViewController = [UIViewController new];
36 | rootViewController.view = rootView;
37 | self.window.rootViewController = rootViewController;
38 | [self.window makeKeyAndVisible];
39 | return YES;
40 | }
41 |
42 | @end
43 |
--------------------------------------------------------------------------------
/example/ios/example/Base.lproj/LaunchScreen.xib:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
21 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
--------------------------------------------------------------------------------
/example/ios/example/Images.xcassets/AppIcon.appiconset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "iphone",
5 | "size" : "20x20",
6 | "scale" : "2x"
7 | },
8 | {
9 | "idiom" : "iphone",
10 | "size" : "20x20",
11 | "scale" : "3x"
12 | },
13 | {
14 | "idiom" : "iphone",
15 | "size" : "29x29",
16 | "scale" : "2x"
17 | },
18 | {
19 | "idiom" : "iphone",
20 | "size" : "29x29",
21 | "scale" : "3x"
22 | },
23 | {
24 | "idiom" : "iphone",
25 | "size" : "40x40",
26 | "scale" : "2x"
27 | },
28 | {
29 | "idiom" : "iphone",
30 | "size" : "40x40",
31 | "scale" : "3x"
32 | },
33 | {
34 | "idiom" : "iphone",
35 | "size" : "60x60",
36 | "scale" : "2x"
37 | },
38 | {
39 | "idiom" : "iphone",
40 | "size" : "60x60",
41 | "scale" : "3x"
42 | },
43 | {
44 | "idiom" : "ios-marketing",
45 | "size" : "1024x1024",
46 | "scale" : "1x"
47 | }
48 | ],
49 | "info" : {
50 | "version" : 1,
51 | "author" : "xcode"
52 | }
53 | }
--------------------------------------------------------------------------------
/example/ios/example/Images.xcassets/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "info" : {
3 | "version" : 1,
4 | "author" : "xcode"
5 | }
6 | }
7 |
--------------------------------------------------------------------------------
/example/ios/example/Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | en
7 | CFBundleDisplayName
8 | example
9 | CFBundleExecutable
10 | $(EXECUTABLE_NAME)
11 | CFBundleIdentifier
12 | org.reactjs.native.example.$(PRODUCT_NAME:rfc1034identifier)
13 | CFBundleInfoDictionaryVersion
14 | 6.0
15 | CFBundleName
16 | $(PRODUCT_NAME)
17 | CFBundlePackageType
18 | APPL
19 | CFBundleShortVersionString
20 | 1.0
21 | CFBundleSignature
22 | ????
23 | CFBundleVersion
24 | 1
25 | LSRequiresIPhoneOS
26 |
27 | UILaunchStoryboardName
28 | LaunchScreen
29 | UIRequiredDeviceCapabilities
30 |
31 | armv7
32 |
33 | UISupportedInterfaceOrientations
34 |
35 | UIInterfaceOrientationPortrait
36 | UIInterfaceOrientationLandscapeLeft
37 | UIInterfaceOrientationLandscapeRight
38 |
39 | UIViewControllerBasedStatusBarAppearance
40 |
41 | NSLocationWhenInUseUsageDescription
42 |
43 | NSAppTransportSecurity
44 |
45 | NSExceptionDomains
46 |
47 | localhost
48 |
49 | NSExceptionAllowsInsecureHTTPLoads
50 |
51 |
52 |
53 |
54 | NSMicrophoneUsageDescription
55 | Nearby API Usage
56 | NSBluetoothPeripheralUsageDescription
57 | Nearby API Usage
58 |
59 |
60 |
--------------------------------------------------------------------------------
/example/ios/example/main.m:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) 2015-present, Facebook, Inc.
3 | * All rights reserved.
4 | *
5 | * This source code is licensed under the BSD-style license found in the
6 | * LICENSE file in the root directory of this source tree. An additional grant
7 | * of patent rights can be found in the PATENTS file in the same directory.
8 | */
9 |
10 | #import
11 |
12 | #import "AppDelegate.h"
13 |
14 | int main(int argc, char * argv[]) {
15 | @autoreleasepool {
16 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class]));
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/example/ios/exampleTests/Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | en
7 | CFBundleExecutable
8 | $(EXECUTABLE_NAME)
9 | CFBundleIdentifier
10 | org.reactjs.native.example.$(PRODUCT_NAME:rfc1034identifier)
11 | CFBundleInfoDictionaryVersion
12 | 6.0
13 | CFBundleName
14 | $(PRODUCT_NAME)
15 | CFBundlePackageType
16 | BNDL
17 | CFBundleShortVersionString
18 | 1.0
19 | CFBundleSignature
20 | ????
21 | CFBundleVersion
22 | 1
23 |
24 |
25 |
--------------------------------------------------------------------------------
/example/ios/exampleTests/exampleTests.m:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) 2015-present, Facebook, Inc.
3 | * All rights reserved.
4 | *
5 | * This source code is licensed under the BSD-style license found in the
6 | * LICENSE file in the root directory of this source tree. An additional grant
7 | * of patent rights can be found in the PATENTS file in the same directory.
8 | */
9 |
10 | #import
11 | #import
12 |
13 | #import
14 | #import
15 |
16 | #define TIMEOUT_SECONDS 600
17 | #define TEXT_TO_LOOK_FOR @"Welcome to React Native!"
18 |
19 | @interface exampleTests : XCTestCase
20 |
21 | @end
22 |
23 | @implementation exampleTests
24 |
25 | - (BOOL)findSubviewInView:(UIView *)view matching:(BOOL(^)(UIView *view))test
26 | {
27 | if (test(view)) {
28 | return YES;
29 | }
30 | for (UIView *subview in [view subviews]) {
31 | if ([self findSubviewInView:subview matching:test]) {
32 | return YES;
33 | }
34 | }
35 | return NO;
36 | }
37 |
38 | - (void)testRendersWelcomeScreen
39 | {
40 | UIViewController *vc = [[[RCTSharedApplication() delegate] window] rootViewController];
41 | NSDate *date = [NSDate dateWithTimeIntervalSinceNow:TIMEOUT_SECONDS];
42 | BOOL foundElement = NO;
43 |
44 | __block NSString *redboxError = nil;
45 | RCTSetLogFunction(^(RCTLogLevel level, RCTLogSource source, NSString *fileName, NSNumber *lineNumber, NSString *message) {
46 | if (level >= RCTLogLevelError) {
47 | redboxError = message;
48 | }
49 | });
50 |
51 | while ([date timeIntervalSinceNow] > 0 && !foundElement && !redboxError) {
52 | [[NSRunLoop mainRunLoop] runMode:NSDefaultRunLoopMode beforeDate:[NSDate dateWithTimeIntervalSinceNow:0.1]];
53 | [[NSRunLoop mainRunLoop] runMode:NSRunLoopCommonModes beforeDate:[NSDate dateWithTimeIntervalSinceNow:0.1]];
54 |
55 | foundElement = [self findSubviewInView:vc.view matching:^BOOL(UIView *view) {
56 | if ([view.accessibilityLabel isEqualToString:TEXT_TO_LOOK_FOR]) {
57 | return YES;
58 | }
59 | return NO;
60 | }];
61 | }
62 |
63 | RCTSetLogFunction(RCTDefaultLogFunction);
64 |
65 | XCTAssertNil(redboxError, @"RedBox error: %@", redboxError);
66 | XCTAssertTrue(foundElement, @"Couldn't find element with text '%@' in %d seconds", TEXT_TO_LOOK_FOR, TIMEOUT_SECONDS);
67 | }
68 |
69 |
70 | @end
71 |
--------------------------------------------------------------------------------
/gradle.properties:
--------------------------------------------------------------------------------
1 | # Project-wide Gradle settings.
2 |
3 | # IDE (e.g. Android Studio) users:
4 | # Gradle settings configured through the IDE *will override*
5 | # any settings specified in this file.
6 |
7 | # For more details on how to configure your build environment visit
8 | # http://www.gradle.org/docs/current/userguide/build_environment.html
9 |
10 | # Specifies the JVM arguments used for the daemon process.
11 | # The setting is particularly useful for tweaking memory settings.
12 | # Default value: -Xmx10248m -XX:MaxPermSize=256m
13 | # org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8
14 |
15 | # When configured, Gradle will run in incubating parallel mode.
16 | # This option should only be used with decoupled projects. More details, visit
17 | # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
18 | # org.gradle.parallel=true
19 |
20 | android.useDeprecatedNdk=true
21 |
--------------------------------------------------------------------------------
/gradle/wrapper/gradle-wrapper.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/badfeatures/react-native-nearby-api/7a916d859712e1a66005a256db18be8120442e0e/gradle/wrapper/gradle-wrapper.jar
--------------------------------------------------------------------------------
/gradle/wrapper/gradle-wrapper.properties:
--------------------------------------------------------------------------------
1 | #Tue Nov 21 10:51:58 PST 2017
2 | distributionBase=GRADLE_USER_HOME
3 | distributionPath=wrapper/dists
4 | zipStoreBase=GRADLE_USER_HOME
5 | zipStorePath=wrapper/dists
6 | distributionUrl=https\://services.gradle.org/distributions/gradle-3.3-all.zip
7 |
--------------------------------------------------------------------------------
/gradlew:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env bash
2 |
3 | ##############################################################################
4 | ##
5 | ## Gradle start up script for UN*X
6 | ##
7 | ##############################################################################
8 |
9 | # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
10 | DEFAULT_JVM_OPTS=""
11 |
12 | APP_NAME="Gradle"
13 | APP_BASE_NAME=`basename "$0"`
14 |
15 | # Use the maximum available, or set MAX_FD != -1 to use that value.
16 | MAX_FD="maximum"
17 |
18 | warn ( ) {
19 | echo "$*"
20 | }
21 |
22 | die ( ) {
23 | echo
24 | echo "$*"
25 | echo
26 | exit 1
27 | }
28 |
29 | # OS specific support (must be 'true' or 'false').
30 | cygwin=false
31 | msys=false
32 | darwin=false
33 | case "`uname`" in
34 | CYGWIN* )
35 | cygwin=true
36 | ;;
37 | Darwin* )
38 | darwin=true
39 | ;;
40 | MINGW* )
41 | msys=true
42 | ;;
43 | esac
44 |
45 | # Attempt to set APP_HOME
46 | # Resolve links: $0 may be a link
47 | PRG="$0"
48 | # Need this for relative symlinks.
49 | while [ -h "$PRG" ] ; do
50 | ls=`ls -ld "$PRG"`
51 | link=`expr "$ls" : '.*-> \(.*\)$'`
52 | if expr "$link" : '/.*' > /dev/null; then
53 | PRG="$link"
54 | else
55 | PRG=`dirname "$PRG"`"/$link"
56 | fi
57 | done
58 | SAVED="`pwd`"
59 | cd "`dirname \"$PRG\"`/" >/dev/null
60 | APP_HOME="`pwd -P`"
61 | cd "$SAVED" >/dev/null
62 |
63 | CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
64 |
65 | # Determine the Java command to use to start the JVM.
66 | if [ -n "$JAVA_HOME" ] ; then
67 | if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
68 | # IBM's JDK on AIX uses strange locations for the executables
69 | JAVACMD="$JAVA_HOME/jre/sh/java"
70 | else
71 | JAVACMD="$JAVA_HOME/bin/java"
72 | fi
73 | if [ ! -x "$JAVACMD" ] ; then
74 | die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
75 |
76 | Please set the JAVA_HOME variable in your environment to match the
77 | location of your Java installation."
78 | fi
79 | else
80 | JAVACMD="java"
81 | which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
82 |
83 | Please set the JAVA_HOME variable in your environment to match the
84 | location of your Java installation."
85 | fi
86 |
87 | # Increase the maximum file descriptors if we can.
88 | if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then
89 | MAX_FD_LIMIT=`ulimit -H -n`
90 | if [ $? -eq 0 ] ; then
91 | if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
92 | MAX_FD="$MAX_FD_LIMIT"
93 | fi
94 | ulimit -n $MAX_FD
95 | if [ $? -ne 0 ] ; then
96 | warn "Could not set maximum file descriptor limit: $MAX_FD"
97 | fi
98 | else
99 | warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
100 | fi
101 | fi
102 |
103 | # For Darwin, add options to specify how the application appears in the dock
104 | if $darwin; then
105 | GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
106 | fi
107 |
108 | # For Cygwin, switch paths to Windows format before running java
109 | if $cygwin ; then
110 | APP_HOME=`cygpath --path --mixed "$APP_HOME"`
111 | CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
112 | JAVACMD=`cygpath --unix "$JAVACMD"`
113 |
114 | # We build the pattern for arguments to be converted via cygpath
115 | ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
116 | SEP=""
117 | for dir in $ROOTDIRSRAW ; do
118 | ROOTDIRS="$ROOTDIRS$SEP$dir"
119 | SEP="|"
120 | done
121 | OURCYGPATTERN="(^($ROOTDIRS))"
122 | # Add a user-defined pattern to the cygpath arguments
123 | if [ "$GRADLE_CYGPATTERN" != "" ] ; then
124 | OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
125 | fi
126 | # Now convert the arguments - kludge to limit ourselves to /bin/sh
127 | i=0
128 | for arg in "$@" ; do
129 | CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
130 | CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
131 |
132 | if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
133 | eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
134 | else
135 | eval `echo args$i`="\"$arg\""
136 | fi
137 | i=$((i+1))
138 | done
139 | case $i in
140 | (0) set -- ;;
141 | (1) set -- "$args0" ;;
142 | (2) set -- "$args0" "$args1" ;;
143 | (3) set -- "$args0" "$args1" "$args2" ;;
144 | (4) set -- "$args0" "$args1" "$args2" "$args3" ;;
145 | (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
146 | (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
147 | (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
148 | (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
149 | (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
150 | esac
151 | fi
152 |
153 | # Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules
154 | function splitJvmOpts() {
155 | JVM_OPTS=("$@")
156 | }
157 | eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS
158 | JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME"
159 |
160 | exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@"
161 |
--------------------------------------------------------------------------------
/gradlew.bat:
--------------------------------------------------------------------------------
1 | @if "%DEBUG%" == "" @echo off
2 | @rem ##########################################################################
3 | @rem
4 | @rem Gradle startup script for Windows
5 | @rem
6 | @rem ##########################################################################
7 |
8 | @rem Set local scope for the variables with windows NT shell
9 | if "%OS%"=="Windows_NT" setlocal
10 |
11 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
12 | set DEFAULT_JVM_OPTS=
13 |
14 | set DIRNAME=%~dp0
15 | if "%DIRNAME%" == "" set DIRNAME=.
16 | set APP_BASE_NAME=%~n0
17 | set APP_HOME=%DIRNAME%
18 |
19 | @rem Find java.exe
20 | if defined JAVA_HOME goto findJavaFromJavaHome
21 |
22 | set JAVA_EXE=java.exe
23 | %JAVA_EXE% -version >NUL 2>&1
24 | if "%ERRORLEVEL%" == "0" goto init
25 |
26 | echo.
27 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
28 | echo.
29 | echo Please set the JAVA_HOME variable in your environment to match the
30 | echo location of your Java installation.
31 |
32 | goto fail
33 |
34 | :findJavaFromJavaHome
35 | set JAVA_HOME=%JAVA_HOME:"=%
36 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe
37 |
38 | if exist "%JAVA_EXE%" goto init
39 |
40 | echo.
41 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
42 | echo.
43 | echo Please set the JAVA_HOME variable in your environment to match the
44 | echo location of your Java installation.
45 |
46 | goto fail
47 |
48 | :init
49 | @rem Get command-line arguments, handling Windowz variants
50 |
51 | if not "%OS%" == "Windows_NT" goto win9xME_args
52 | if "%@eval[2+2]" == "4" goto 4NT_args
53 |
54 | :win9xME_args
55 | @rem Slurp the command line arguments.
56 | set CMD_LINE_ARGS=
57 | set _SKIP=2
58 |
59 | :win9xME_args_slurp
60 | if "x%~1" == "x" goto execute
61 |
62 | set CMD_LINE_ARGS=%*
63 | goto execute
64 |
65 | :4NT_args
66 | @rem Get arguments from the 4NT Shell from JP Software
67 | set CMD_LINE_ARGS=%$
68 |
69 | :execute
70 | @rem Setup the command line
71 |
72 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
73 |
74 | @rem Execute Gradle
75 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
76 |
77 | :end
78 | @rem End local scope for the variables with windows NT shell
79 | if "%ERRORLEVEL%"=="0" goto mainEnd
80 |
81 | :fail
82 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
83 | rem the _cmd.exe /c_ return code!
84 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
85 | exit /b 1
86 |
87 | :mainEnd
88 | if "%OS%"=="Windows_NT" endlocal
89 |
90 | :omega
91 |
--------------------------------------------------------------------------------
/index.js:
--------------------------------------------------------------------------------
1 | "use strict";
2 | import {
3 | Platform,
4 | NativeModules,
5 | DeviceEventEmitter,
6 | NativeEventEmitter
7 | } from "react-native";
8 |
9 | const { RNNearbyApi } = NativeModules;
10 |
11 | /**
12 | * Event Constants
13 | */
14 | export const CONNECTED = "CONNECTED";
15 | export const CONNECTION_SUSPENDED = "CONNECTION_SUSPENDED";
16 | export const CONNECTION_FAILED = "CONNECTION_FAILED";
17 | export const DISCONNECTED = "DISCONNECTED";
18 | export const MESSAGE_FOUND = "MESSAGE_FOUND";
19 | export const MESSAGE_LOST = "MESSAGE_LOST";
20 | export const DISTANCE_CHANGED = "DISTANCE_CHANGED";
21 | export const BLE_SIGNAL_CHANGED = "BLE_SIGNAL_CHANGED";
22 | export const PUBLISH_SUCCESS = "PUBLISH_SUCCESS";
23 | export const PUBLISH_FAILED = "PUBLISH_FAILED";
24 | export const SUBSCRIBE_SUCCESS = "SUBSCRIBE_SUCCESS";
25 | export const SUBSCRIBE_FAILED = "SUBSCRIBE_FAILED";
26 |
27 | export class NearbyAPI {
28 | /**
29 | * Initializer for the RNNearbyApi wrapper.
30 | * @param {Boolean} bleOnly Only utilizes bluetooth through the Google Nearby SDK. Defaults to `true`.
31 | */
32 | constructor(bleOnly) {
33 | this._nearbyAPI = RNNearbyApi;
34 | this._eventEmitter =
35 | Platform.OS === "android"
36 | ? DeviceEventEmitter
37 | : new NativeEventEmitter(this._nearbyAPI);
38 | this._handlers = {};
39 | this._deviceEventSubscription = this._eventEmitter.addListener(
40 | "subscribe",
41 | this._eventHandler.bind(this)
42 | );
43 | this._isBLEOnly = !!bleOnly;
44 | }
45 |
46 | connect = apiKey => {
47 | this._nearbyAPI.connect(apiKey, this._isBLEOnly);
48 | };
49 |
50 | disconnect = () => {
51 | this._nearbyAPI.disconnect();
52 | };
53 |
54 | isConnected = cb => {
55 | this._nearbyAPI.isConnected(cb);
56 | };
57 |
58 | publish = message => {
59 | if (message !== null) {
60 | this._nearbyAPI.publish(message);
61 | } else {
62 | throw "Unable to publish a null message.";
63 | }
64 | };
65 |
66 | isPublishing = cb => {
67 | this._nearbyAPI.isPublishing(cb);
68 | };
69 |
70 | subscribe = () => {
71 | this._nearbyAPI.subscribe();
72 | };
73 |
74 | isSubscribing = cb => {
75 | this._nearbyAPI.isSubscribing(cb);
76 | };
77 |
78 | unpublish = () => {
79 | this._nearbyAPI.unpublish();
80 | };
81 |
82 | unsubscribe = () => {
83 | this._nearbyAPI.unsubscribe();
84 | };
85 |
86 | /**
87 | * Handler Helper Functions.
88 | */
89 |
90 | onConnected = handler => {
91 | this._setHandler(CONNECTED, handler);
92 | };
93 |
94 | onConnectionFailure = handler => {
95 | this._setHandler(CONNECTION_FAILED, handler);
96 | };
97 |
98 | onConnectionSuspended = handler => {
99 | this._setHandler(CONNECTION_SUSPENDED, handler);
100 | };
101 |
102 | onDisconnected = handler => {
103 | this._setHandler(DISCONNECTED, handler);
104 | };
105 |
106 | onFound = handler => {
107 | this._setHandler(MESSAGE_FOUND, handler);
108 | };
109 |
110 | onLost = handler => {
111 | this._setHandler(MESSAGE_LOST, handler);
112 | };
113 |
114 | onDistanceChanged = handler => {
115 | this._setHandler(DISTANCE_CHANGED, handler);
116 | };
117 |
118 | onBLESignalChanged = handler => {
119 | this._setHandler(BLE_SIGNAL_CHANGED, handler);
120 | };
121 |
122 | onPublishSuccess = handler => {
123 | this._setHandler(PUBLISH_SUCCESS, handler);
124 | };
125 |
126 | onPublishFailed = handler => {
127 | this._setHandler(PUBLISH_FAILED, handler);
128 | };
129 |
130 | onSubscribeSuccess = handler => {
131 | this._setHandler(SUBSCRIBE_SUCCESS, handler);
132 | };
133 |
134 | onSubscribeFailed = handler => {
135 | this._setHandler(SUBSCRIBE_FAILED, handler);
136 | };
137 |
138 | _setHandler = (event, handler) => {
139 | this._handlers[event] = handler;
140 | };
141 |
142 | _eventHandler = event => {
143 | if (this._handlers.hasOwnProperty(event.event)) {
144 | this._handlers[event.event](
145 | event.hasOwnProperty("message") ? event.message : null,
146 | event.hasOwnProperty("value") ? event.value : null
147 | );
148 | }
149 | };
150 | }
151 |
--------------------------------------------------------------------------------
/ios/Classes/RNNearbyApi.h:
--------------------------------------------------------------------------------
1 | #import
2 | #import
3 | #import
4 |
5 | @interface RNNearbyApi : RCTEventEmitter
6 |
7 | /// GNSPublication to keep track of the currently published message.
8 | @property(nonatomic, strong) id publication;
9 |
10 | /// GNSSubscription to keep track of the current subscription.
11 | @property(nonatomic, strong) id subscription;
12 |
13 | @end
14 |
15 |
16 |
--------------------------------------------------------------------------------
/ios/Classes/RNNearbyApi.m:
--------------------------------------------------------------------------------
1 |
2 | #import "RNNearbyApi.h"
3 |
4 | /*
5 | * @brief Events broadcasted through the RCTEventEmitter. Handles all stages of connections through the NearbyMessages SDK.
6 | * @constant CONNECTED The GNSMessageManager instance has been initialized with an API key.
7 | * @constant CONNECTION_SUSPENDED The connection was cancelled by the GNSMessageManager (iOS unused).
8 | * @constant CONNECTION_FAILED The connection has failed.
9 | * @constant DISCONNECTED The GNSMessageManager has disconnected or deallocated.
10 | * @constant MESSAGE_FOUND A GNSMessage has been found through the GNSSubscription.
11 | * @constant MESSAGE_LOST A GNSMessage has been lost through the GNSSubscription.
12 | * @constant DISTANCE_CHANGED: A GNSMessage distance changed (iOS unused).
13 | * @constant BLE_SIGNAL_CHANGED A GNSMessage signal strength changed (iOS unused).
14 | * @constant PUBLISH_SUCCESS The GNSPublication has successfully started publishing.
15 | * @constant PUBLISH_FAILED The GNSPublication has failed to start publishing.
16 | * @constant SUBSCRIBE_SUCCESS The GNSSubscription has successfully started subscribing.
17 | * @constant SUBSCRIBE_FAILED The GNSSubscription has failed start subscribing.
18 | */
19 | typedef NS_ENUM(NSInteger, RNNearbyApiEvent) {
20 | CONNECTED,
21 | CONNECTION_SUSPENDED,
22 | CONNECTION_FAILED,
23 | DISCONNECTED,
24 | MESSAGE_FOUND,
25 | MESSAGE_LOST,
26 | DISTANCE_CHANGED,
27 | BLE_SIGNAL_CHANGED,
28 | PUBLISH_SUCCESS,
29 | PUBLISH_FAILED,
30 | SUBSCRIBE_SUCCESS,
31 | SUBSCRIBE_FAILED,
32 | };
33 |
34 | /// The main message manager to handle connection, publications, and subscriptions.
35 | static GNSMessageManager *_messageManager = nil;
36 |
37 | /// The Google Play Service API key supplied.
38 | static NSString *_apiKey = nil;
39 | static BOOL _isBLEOnly = false;
40 |
41 | @implementation RNNearbyApi
42 |
43 | @synthesize publication;
44 | @synthesize subscription;
45 |
46 | - (dispatch_queue_t)methodQueue
47 | {
48 | return dispatch_get_main_queue();
49 | }
50 |
51 | RCT_EXPORT_MODULE()
52 |
53 | /**
54 | * @brief Converts a valid RNNearbyApiEvent enum to a NSString equivalent.
55 | * @param event The RNNearbyApiEvent to convert.
56 | * @return NSString conversion of the event type.
57 | */
58 | - (nonnull NSString *)stringForAPIEvent:(RNNearbyApiEvent)event {
59 | switch(event) {
60 | case CONNECTED: return @"CONNECTED";
61 | case CONNECTION_SUSPENDED: return @"CONNECTION_SUSPENDED";
62 | case CONNECTION_FAILED: return @"CONNECTION_FAILED";
63 | case DISCONNECTED: return @"DISCONNECTED";
64 | case MESSAGE_FOUND: return @"MESSAGE_FOUND";
65 | case MESSAGE_LOST: return @"MESSAGE_LOST";
66 | case DISTANCE_CHANGED: return @"DISTANCE_CHANGED";
67 | case BLE_SIGNAL_CHANGED: return @"BLE_SIGNAL_CHANGED";
68 | case PUBLISH_SUCCESS: return @"PUBLISH_SUCCESS";
69 | case PUBLISH_FAILED: return @"PUBLISH_FAILED";
70 | case SUBSCRIBE_SUCCESS: return @"SUBSCRIBE_SUCCESS";
71 | case SUBSCRIBE_FAILED: return @"SUBSCRIBE_FAILED";
72 | default: return @"CONNECTED";
73 | }
74 | }
75 |
76 | /// Events are supplied through the 'subscribe` event through the RCTEventEmitter.
77 | - (NSArray *)supportedEvents {
78 | return @[@"subscribe"];
79 | }
80 |
81 | - (void)sendEvent:(RNNearbyApiEvent)event withMessage:(GNSMessage *)message {
82 | NSString *eventString = [self stringForAPIEvent:event];
83 | NSString *messageString = [[NSString alloc] initWithData:message.content encoding: NSUTF8StringEncoding];
84 | NSDictionary *body = @{
85 | @"event": eventString,
86 | @"message": messageString
87 | };
88 | [self sendEventWithName:@"subscribe" body:body];
89 | }
90 |
91 | - (void)sendEvent:(RNNearbyApiEvent)event withString:(NSString *)string {
92 | NSString *eventString = [self stringForAPIEvent:event];
93 | NSDictionary *body = @{
94 | @"event": eventString,
95 | @"message": string
96 | };
97 | [self sendEventWithName:@"subscribe" body:body];
98 | }
99 |
100 | - (id)createMessageManagerWithApiKey:(nonnull NSString*) apiKey {
101 | if(apiKey == nil) {
102 | @throw [NSException
103 | exceptionWithName:@"ApiKeyNotGiven"
104 | reason:@"No Api Key was given."
105 | userInfo:nil];
106 | }
107 | _apiKey = apiKey;
108 | return [self sharedMessageManager];
109 | }
110 |
111 | - (id)sharedMessageManager {
112 | @synchronized(self) {
113 | if(_messageManager == nil) {
114 | if(_apiKey == nil) {
115 | @throw [NSException
116 | exceptionWithName:@"ApiKeyNil"
117 | reason:@"Api Key was nil."
118 | userInfo:nil];
119 | }
120 | _messageManager = [[GNSMessageManager alloc] initWithAPIKey: _apiKey];
121 | }
122 | }
123 | return _messageManager;
124 | }
125 |
126 | - (NSNumber *) isConnected {
127 | @synchronized(self) {
128 | if(_messageManager == nil) {
129 | return [NSNumber numberWithBool:0];
130 | } else {
131 | return [NSNumber numberWithBool:1];
132 | }
133 | }
134 | }
135 |
136 | RCT_EXPORT_METHOD(isConnected:(RCTResponseSenderBlock) callback)
137 | {
138 | NSNumber *connected = [self isConnected];
139 | callback(@[connected, [NSNull null]]);
140 | }
141 |
142 | RCT_EXPORT_METHOD(connect: (nonnull NSString *)apiKey isBLEOnly:(BOOL)bleOnly) {
143 | // iOS Doesn't have a connect: method
144 | @try {
145 | _isBLEOnly = bleOnly;
146 | [self createMessageManagerWithApiKey: apiKey];
147 | [self sendEvent:CONNECTED withString:@"Successfully connected."];
148 | } @catch(NSException *exception) {
149 | if(exception.reason != nil) {
150 | [self sendEvent:CONNECTION_FAILED withString: exception.reason];
151 | } else {
152 | [self sendEvent:CONNECTION_FAILED withString: @"Connection failed."];
153 | }
154 | }
155 | }
156 |
157 | RCT_EXPORT_METHOD(disconnect) {
158 | // iOS Doesn't have a disconnect: method
159 | // Try setting messageManager to nil & save _apiKey
160 | @synchronized(self) {
161 | _messageManager = nil;
162 | }
163 | [self sendEvent:DISCONNECTED withString:@"Successfully disconnected."];
164 | }
165 |
166 | RCT_EXPORT_METHOD(isPublishing:(RCTResponseSenderBlock) callback)
167 | {
168 | if(publication != nil) {
169 | callback(@[@true, [NSNull null]]);
170 | } else {
171 | callback(@[@false, [NSNull null]]);
172 | }
173 | }
174 |
175 | RCT_EXPORT_METHOD(publish:(nonnull NSString *)messageString) {
176 | @try {
177 | if(![self isConnected]) {
178 | @throw [NSException
179 | exceptionWithName:@"NotConnected"
180 | reason:@"Messenger not connected. Call connect: before publshing."
181 | userInfo:nil];
182 | }
183 | if(messageString == nil) {
184 | [self sendEvent:PUBLISH_FAILED withString:@"Cannot publish an empty message"];
185 | return;
186 | }
187 | // Release old publication
188 | [self unpublish];
189 | // Create new message
190 | GNSMessage *message = [GNSMessage messageWithContent: [messageString dataUsingEncoding: NSUTF8StringEncoding]];
191 | publication = [[self sharedMessageManager] publicationWithMessage: message paramsBlock:^(GNSPublicationParams *params) {
192 | params.strategy = [GNSStrategy strategyWithParamsBlock:^(GNSStrategyParams *params) {
193 | params.discoveryMediums = _isBLEOnly ? kGNSDiscoveryMediumsBLE : kGNSDiscoveryModeDefault;
194 | }];
195 | }];
196 | [self sendEvent:PUBLISH_SUCCESS withString:[NSString stringWithFormat:@"Successfully published: %@", messageString]];
197 | } @catch(NSException *exception) {
198 | if(exception.reason != nil) {
199 | [self sendEvent:PUBLISH_FAILED withString: exception.reason];
200 | }
201 | }
202 | }
203 |
204 | RCT_EXPORT_METHOD(unpublish) {
205 | publication = nil;
206 | }
207 |
208 | RCT_EXPORT_METHOD(isSubscribing:(RCTResponseSenderBlock) callback)
209 | {
210 | if(subscription != nil) {
211 | callback(@[@true, [NSNull null]]);
212 | } else {
213 | callback(@[@false, [NSNull null]]);
214 | }
215 | }
216 |
217 | RCT_EXPORT_METHOD(subscribe) {
218 | @try {
219 | if(![self isConnected]) {
220 | @throw [NSException
221 | exceptionWithName:@"NotConnected"
222 | reason:@"Messenger not connected. Call connect: before subscribing."
223 | userInfo:nil];
224 | }
225 | // Release old subscription
226 | [self unsubscribe];
227 | // Create subscription object
228 | __weak RNNearbyApi *welf = self;
229 | subscription = [[self sharedMessageManager] subscriptionWithMessageFoundHandler:^(GNSMessage *message) {
230 | [welf sendEvent:MESSAGE_FOUND withMessage:message];
231 | } messageLostHandler:^(GNSMessage *message) {
232 | [welf sendEvent:MESSAGE_LOST withMessage:message];
233 | } paramsBlock:^(GNSSubscriptionParams *params) {
234 | params.strategy = [GNSStrategy strategyWithParamsBlock:^(GNSStrategyParams *params) {
235 | params.allowInBackground = false; //TODO: Make this configurable
236 | params.discoveryMediums = _isBLEOnly ? kGNSDiscoveryMediumsBLE : kGNSDiscoveryModeDefault;
237 | }];
238 | }];
239 | [self sendEvent:SUBSCRIBE_SUCCESS withString:@"Successfully Subscribed."];
240 | } @catch(NSException *exception) {
241 | if(exception.reason != nil) {
242 | [self sendEvent:SUBSCRIBE_FAILED withString: exception.reason];
243 | }
244 | }
245 | }
246 |
247 | RCT_EXPORT_METHOD(unsubscribe) {
248 | subscription = nil;
249 | }
250 |
251 | @end
252 |
253 |
--------------------------------------------------------------------------------
/ios/RNNearbyApi.xcodeproj/project.pbxproj:
--------------------------------------------------------------------------------
1 | // !$*UTF8*$!
2 | {
3 | archiveVersion = 1;
4 | classes = {
5 | };
6 | objectVersion = 46;
7 | objects = {
8 |
9 | /* Begin PBXBuildFile section */
10 | B3E7B58A1CC2AC0600A0062D /* RNNearbyApi.m in Sources */ = {isa = PBXBuildFile; fileRef = B3E7B5891CC2AC0600A0062D /* RNNearbyApi.m */; };
11 | /* End PBXBuildFile section */
12 |
13 | /* Begin PBXCopyFilesBuildPhase section */
14 | 58B511D91A9E6C8500147676 /* CopyFiles */ = {
15 | isa = PBXCopyFilesBuildPhase;
16 | buildActionMask = 2147483647;
17 | dstPath = "include/$(PRODUCT_NAME)";
18 | dstSubfolderSpec = 16;
19 | files = (
20 | );
21 | runOnlyForDeploymentPostprocessing = 0;
22 | };
23 | /* End PBXCopyFilesBuildPhase section */
24 |
25 | /* Begin PBXFileReference section */
26 | 134814201AA4EA6300B7C361 /* libRNNearbyApi.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libRNNearbyApi.a; sourceTree = BUILT_PRODUCTS_DIR; };
27 | B3E7B5881CC2AC0600A0062D /* RNNearbyApi.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = RNNearbyApi.h; path = Classes/RNNearbyApi.h; sourceTree = ""; };
28 | B3E7B5891CC2AC0600A0062D /* RNNearbyApi.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = RNNearbyApi.m; path = Classes/RNNearbyApi.m; sourceTree = ""; };
29 | C57FC74FAB45030F7D82A351 /* libPods-RNNearbyApi.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-RNNearbyApi.a"; sourceTree = BUILT_PRODUCTS_DIR; };
30 | /* End PBXFileReference section */
31 |
32 | /* Begin PBXFrameworksBuildPhase section */
33 | 58B511D81A9E6C8500147676 /* Frameworks */ = {
34 | isa = PBXFrameworksBuildPhase;
35 | buildActionMask = 2147483647;
36 | files = (
37 | );
38 | runOnlyForDeploymentPostprocessing = 0;
39 | };
40 | /* End PBXFrameworksBuildPhase section */
41 |
42 | /* Begin PBXGroup section */
43 | 134814211AA4EA7D00B7C361 /* Products */ = {
44 | isa = PBXGroup;
45 | children = (
46 | 134814201AA4EA6300B7C361 /* libRNNearbyApi.a */,
47 | );
48 | name = Products;
49 | sourceTree = "";
50 | };
51 | 33A5EBA8266C5140AB6EBED7 /* Frameworks */ = {
52 | isa = PBXGroup;
53 | children = (
54 | C57FC74FAB45030F7D82A351 /* libPods-RNNearbyApi.a */,
55 | );
56 | name = Frameworks;
57 | sourceTree = "";
58 | };
59 | 58B511D21A9E6C8500147676 = {
60 | isa = PBXGroup;
61 | children = (
62 | B3E7B5881CC2AC0600A0062D /* RNNearbyApi.h */,
63 | B3E7B5891CC2AC0600A0062D /* RNNearbyApi.m */,
64 | 134814211AA4EA7D00B7C361 /* Products */,
65 | 33A5EBA8266C5140AB6EBED7 /* Frameworks */,
66 | );
67 | sourceTree = "";
68 | };
69 | /* End PBXGroup section */
70 |
71 | /* Begin PBXNativeTarget section */
72 | 58B511DA1A9E6C8500147676 /* RNNearbyApi */ = {
73 | isa = PBXNativeTarget;
74 | buildConfigurationList = 58B511EF1A9E6C8500147676 /* Build configuration list for PBXNativeTarget "RNNearbyApi" */;
75 | buildPhases = (
76 | 58B511D71A9E6C8500147676 /* Sources */,
77 | 58B511D81A9E6C8500147676 /* Frameworks */,
78 | 58B511D91A9E6C8500147676 /* CopyFiles */,
79 | );
80 | buildRules = (
81 | );
82 | dependencies = (
83 | );
84 | name = RNNearbyApi;
85 | productName = RCTDataManager;
86 | productReference = 134814201AA4EA6300B7C361 /* libRNNearbyApi.a */;
87 | productType = "com.apple.product-type.library.static";
88 | };
89 | /* End PBXNativeTarget section */
90 |
91 | /* Begin PBXProject section */
92 | 58B511D31A9E6C8500147676 /* Project object */ = {
93 | isa = PBXProject;
94 | attributes = {
95 | LastUpgradeCheck = 0900;
96 | ORGANIZATIONNAME = Facebook;
97 | TargetAttributes = {
98 | 58B511DA1A9E6C8500147676 = {
99 | CreatedOnToolsVersion = 6.1.1;
100 | };
101 | };
102 | };
103 | buildConfigurationList = 58B511D61A9E6C8500147676 /* Build configuration list for PBXProject "RNNearbyApi" */;
104 | compatibilityVersion = "Xcode 3.2";
105 | developmentRegion = English;
106 | hasScannedForEncodings = 0;
107 | knownRegions = (
108 | en,
109 | );
110 | mainGroup = 58B511D21A9E6C8500147676;
111 | productRefGroup = 58B511D21A9E6C8500147676;
112 | projectDirPath = "";
113 | projectRoot = "";
114 | targets = (
115 | 58B511DA1A9E6C8500147676 /* RNNearbyApi */,
116 | );
117 | };
118 | /* End PBXProject section */
119 |
120 | /* Begin PBXSourcesBuildPhase section */
121 | 58B511D71A9E6C8500147676 /* Sources */ = {
122 | isa = PBXSourcesBuildPhase;
123 | buildActionMask = 2147483647;
124 | files = (
125 | B3E7B58A1CC2AC0600A0062D /* RNNearbyApi.m in Sources */,
126 | );
127 | runOnlyForDeploymentPostprocessing = 0;
128 | };
129 | /* End PBXSourcesBuildPhase section */
130 |
131 | /* Begin XCBuildConfiguration section */
132 | 58B511ED1A9E6C8500147676 /* Debug */ = {
133 | isa = XCBuildConfiguration;
134 | buildSettings = {
135 | ALWAYS_SEARCH_USER_PATHS = NO;
136 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
137 | CLANG_CXX_LIBRARY = "libc++";
138 | CLANG_ENABLE_MODULES = YES;
139 | CLANG_ENABLE_OBJC_ARC = YES;
140 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
141 | CLANG_WARN_BOOL_CONVERSION = YES;
142 | CLANG_WARN_COMMA = YES;
143 | CLANG_WARN_CONSTANT_CONVERSION = YES;
144 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
145 | CLANG_WARN_EMPTY_BODY = YES;
146 | CLANG_WARN_ENUM_CONVERSION = YES;
147 | CLANG_WARN_INFINITE_RECURSION = YES;
148 | CLANG_WARN_INT_CONVERSION = YES;
149 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
150 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
151 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
152 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
153 | CLANG_WARN_STRICT_PROTOTYPES = YES;
154 | CLANG_WARN_SUSPICIOUS_MOVE = YES;
155 | CLANG_WARN_UNREACHABLE_CODE = YES;
156 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
157 | COPY_PHASE_STRIP = NO;
158 | ENABLE_STRICT_OBJC_MSGSEND = YES;
159 | ENABLE_TESTABILITY = YES;
160 | GCC_C_LANGUAGE_STANDARD = gnu99;
161 | GCC_DYNAMIC_NO_PIC = NO;
162 | GCC_NO_COMMON_BLOCKS = YES;
163 | GCC_OPTIMIZATION_LEVEL = 0;
164 | GCC_PREPROCESSOR_DEFINITIONS = (
165 | "DEBUG=1",
166 | "$(inherited)",
167 | );
168 | GCC_SYMBOLS_PRIVATE_EXTERN = NO;
169 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
170 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
171 | GCC_WARN_UNDECLARED_SELECTOR = YES;
172 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
173 | GCC_WARN_UNUSED_FUNCTION = YES;
174 | GCC_WARN_UNUSED_VARIABLE = YES;
175 | IPHONEOS_DEPLOYMENT_TARGET = 9.0;
176 | MTL_ENABLE_DEBUG_INFO = YES;
177 | ONLY_ACTIVE_ARCH = YES;
178 | SDKROOT = iphoneos;
179 | };
180 | name = Debug;
181 | };
182 | 58B511EE1A9E6C8500147676 /* Release */ = {
183 | isa = XCBuildConfiguration;
184 | buildSettings = {
185 | ALWAYS_SEARCH_USER_PATHS = NO;
186 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
187 | CLANG_CXX_LIBRARY = "libc++";
188 | CLANG_ENABLE_MODULES = YES;
189 | CLANG_ENABLE_OBJC_ARC = YES;
190 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
191 | CLANG_WARN_BOOL_CONVERSION = YES;
192 | CLANG_WARN_COMMA = YES;
193 | CLANG_WARN_CONSTANT_CONVERSION = YES;
194 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
195 | CLANG_WARN_EMPTY_BODY = YES;
196 | CLANG_WARN_ENUM_CONVERSION = YES;
197 | CLANG_WARN_INFINITE_RECURSION = YES;
198 | CLANG_WARN_INT_CONVERSION = YES;
199 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
200 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
201 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
202 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
203 | CLANG_WARN_STRICT_PROTOTYPES = YES;
204 | CLANG_WARN_SUSPICIOUS_MOVE = YES;
205 | CLANG_WARN_UNREACHABLE_CODE = YES;
206 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
207 | COPY_PHASE_STRIP = YES;
208 | ENABLE_NS_ASSERTIONS = NO;
209 | ENABLE_STRICT_OBJC_MSGSEND = YES;
210 | GCC_C_LANGUAGE_STANDARD = gnu99;
211 | GCC_NO_COMMON_BLOCKS = YES;
212 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
213 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
214 | GCC_WARN_UNDECLARED_SELECTOR = YES;
215 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
216 | GCC_WARN_UNUSED_FUNCTION = YES;
217 | GCC_WARN_UNUSED_VARIABLE = YES;
218 | IPHONEOS_DEPLOYMENT_TARGET = 9.0;
219 | MTL_ENABLE_DEBUG_INFO = NO;
220 | SDKROOT = iphoneos;
221 | VALIDATE_PRODUCT = YES;
222 | };
223 | name = Release;
224 | };
225 | 58B511F01A9E6C8500147676 /* Debug */ = {
226 | isa = XCBuildConfiguration;
227 | buildSettings = {
228 | FRAMEWORK_SEARCH_PATHS = (
229 | "$(inherited)",
230 | "$(PROJECT_DIR)/../../../ios/Pods/**",
231 | "$(PROJECT_DIR)/../../../ios/Frameworks/**",
232 | );
233 | HEADER_SEARCH_PATHS = (
234 | "$(inherited)",
235 | /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include,
236 | "$(SRCROOT)/../../../React/**",
237 | "$(SRCROOT)/../../react-native/React/**",
238 | "$(PROJECT_DIR)/../../../ios/Frameworks/**",
239 | "$(PROJECT_DIR)/../../../ios/Pods/**",
240 | "$(SRCROOT)/Pods/**",
241 | "$(SRCROOT)/../example/ios/Pods/Headers/Public/NearbyMessages",
242 | );
243 | LIBRARY_SEARCH_PATHS = "$(inherited)";
244 | OTHER_LDFLAGS = "-ObjC";
245 | PRODUCT_NAME = RNNearbyApi;
246 | SKIP_INSTALL = YES;
247 | };
248 | name = Debug;
249 | };
250 | 58B511F11A9E6C8500147676 /* Release */ = {
251 | isa = XCBuildConfiguration;
252 | buildSettings = {
253 | FRAMEWORK_SEARCH_PATHS = (
254 | "$(inherited)",
255 | "$(PROJECT_DIR)/../../../ios/Pods/**",
256 | "$(PROJECT_DIR)/../../../ios/Frameworks/**",
257 | );
258 | HEADER_SEARCH_PATHS = (
259 | "$(inherited)",
260 | /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include,
261 | "$(SRCROOT)/../../../React/**",
262 | "$(SRCROOT)/../../react-native/React/**",
263 | "$(PROJECT_DIR)/../../../ios/Frameworks/**",
264 | "$(PROJECT_DIR)/../../../ios/Pods/**",
265 | "$(SRCROOT)/Pods/**",
266 | "$(SRCROOT)/../example/ios/Pods/Headers/Public/NearbyMessages",
267 | );
268 | LIBRARY_SEARCH_PATHS = "$(inherited)";
269 | OTHER_LDFLAGS = "-ObjC";
270 | PRODUCT_NAME = RNNearbyApi;
271 | SKIP_INSTALL = YES;
272 | };
273 | name = Release;
274 | };
275 | /* End XCBuildConfiguration section */
276 |
277 | /* Begin XCConfigurationList section */
278 | 58B511D61A9E6C8500147676 /* Build configuration list for PBXProject "RNNearbyApi" */ = {
279 | isa = XCConfigurationList;
280 | buildConfigurations = (
281 | 58B511ED1A9E6C8500147676 /* Debug */,
282 | 58B511EE1A9E6C8500147676 /* Release */,
283 | );
284 | defaultConfigurationIsVisible = 0;
285 | defaultConfigurationName = Release;
286 | };
287 | 58B511EF1A9E6C8500147676 /* Build configuration list for PBXNativeTarget "RNNearbyApi" */ = {
288 | isa = XCConfigurationList;
289 | buildConfigurations = (
290 | 58B511F01A9E6C8500147676 /* Debug */,
291 | 58B511F11A9E6C8500147676 /* Release */,
292 | );
293 | defaultConfigurationIsVisible = 0;
294 | defaultConfigurationName = Release;
295 | };
296 | /* End XCConfigurationList section */
297 | };
298 | rootObject = 58B511D31A9E6C8500147676 /* Project object */;
299 | }
300 |
--------------------------------------------------------------------------------
/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "react-native-nearby-api",
3 | "version": "0.0.5",
4 | "description": "React Native wrapper around Google's Nearby API SDK",
5 | "main": "index.js",
6 | "scripts": {
7 | "preversion": "",
8 | "version": "git add CHANGELOG.md",
9 | "postversion": "git push && git push --tags",
10 | "postinstall": "scripts/install.js",
11 | "start": "node node_modules/react-native/local-cli/cli.js start",
12 | "run:packager": "./node_modules/react-native/packager/packager.sh",
13 | "run:ios": "react-native run-ios --project-path ./example/ios",
14 | "build:ios": "bundle install --binstubs ./example/ios && bundle exec pod install --project-directory=./example/ios/ && yarn bundle:ios",
15 | "bundle:ios": "node node_modules/react-native/local-cli/cli.js bundle --entry-file='./example/index.js' --bundle-output='./example/ios/example/main.jsbundle' --dev=false --platform='ios'",
16 | "build:android": "./gradlew :react-native-nearby-api:assembleDebug",
17 | "start:android": "adb shell am start -n com.example/.MainActivity",
18 | "run:android": "./gradlew installDebug && yarn start:android",
19 | "renameLogger": "./renameLogger.sh"
20 | },
21 | "keywords": [
22 | "react-native",
23 | "google",
24 | "nearby",
25 | "messages",
26 | "android",
27 | "ios"
28 | ],
29 | "author": "Bad Features, Inc",
30 | "license": "ISC",
31 | "peerDependencies": {
32 | "react": ">=15.4.0 || ^16.0.0-alpha",
33 | "react-native": "^0.41.2"
34 | },
35 | "devDependencies": {
36 | "babel-plugin-module-resolver": "^3.0.0",
37 | "escape-string-regexp": "^1.0.5",
38 | "metro-bundler": "^0.20.3",
39 | "react": "16.0.0-alpha.12",
40 | "react-native": "^0.50.1"
41 | },
42 | "rnpm": {
43 | "android": {
44 | "sourceDir": "./android"
45 | }
46 | },
47 | "repository": {
48 | "type": "git",
49 | "url": "git+https://github.com/badfeatures/react-native-nearby-api.git"
50 | },
51 | "bugs": {
52 | "url": "https://github.com/badfeatures/react-native-nearby-api/issues"
53 | },
54 | "homepage": "https://github.com/badfeatures/react-native-nearby-api#readme"
55 | }
56 |
--------------------------------------------------------------------------------
/renameLogger.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | grep -rl --include \*.h --include \*.cpp --include \*.cc --include \*.in AddLogSink ./node_modules/react-native/third-party/ | xargs sed -i '' 's/AddLogSink/ReactAddLogSink/g'
3 | grep -rl --include \*.h --include \*.cpp --include \*.cc --include \*.in RemoveLogSink ./node_modules/react-native/third-party/ | xargs sed -i '' 's/RemoveLogSink/ReactRemoveLogSink/g'
--------------------------------------------------------------------------------
/rn-cli.config.js:
--------------------------------------------------------------------------------
1 | // const blacklist = require("metro-bundler/src/blacklist");
2 | // const path = require("path");
3 | module.exports = {
4 | // getProjectRoots() {
5 | // return [__dirname, path.resolve(__dirname, "./example")];
6 | // }
7 | // getProvidesModuleNodeModules() {
8 | // return ["react-native", "react"];
9 | // },
10 | // getBlacklistRE() {
11 | // return blacklist([
12 | // new RegExp(`^${escape(path.resolve(__dirname, "node_modules"))}\\/.*$`)
13 | // ]);
14 | // }
15 | };
16 |
--------------------------------------------------------------------------------
/scripts/install.js:
--------------------------------------------------------------------------------
1 | #! /usr/bin/env node
2 | const { exec } = require("child_process");
3 |
4 | function doExec(cmdString) {
5 | return new Promise((resolve, reject) => {
6 | exec(cmdString, (err, stdout) => {
7 | if (err) {
8 | reject(err);
9 | return;
10 | }
11 | resolve(stdout);
12 | });
13 | });
14 | }
15 |
16 | function run() {
17 | doExec(
18 | "grep -rl --include \\*.h --include \\*.cpp --include \\*.cc --include \\*.in AddLogSink ../node_modules/react-native/third-party/ | xargs sed -i '' 's/AddLogSink/ReactAddLogSink/g'"
19 | ).then(() =>
20 | doExec(
21 | "grep -rl --include \\*.h --include \\*.cpp --include \\*.cc --include \\*.in RemoveLogSink ../node_modules/react-native/third-party/ | xargs sed -i '' 's/RemoveLogSink/ReactRemoveLogSink/g'"
22 | )
23 | );
24 | }
25 |
26 | run();
27 |
--------------------------------------------------------------------------------
/settings.gradle:
--------------------------------------------------------------------------------
1 | rootProject.name = 'react-native-nearby-api'
2 |
3 | include ":example-android"
4 | project(":example-android").projectDir = file("./example/android/app")
5 |
6 | include ":react-native-nearby-api-lib"
7 | project(":react-native-nearby-api-lib").projectDir = file("./android")
--------------------------------------------------------------------------------