-
-
Notifications
You must be signed in to change notification settings - Fork 45
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
55 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 6 additions & 0 deletions
6
example/android/app/src/main/res/xml/network_security_config.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
<network-security-config> | ||
<domain-config cleartextTrafficPermitted="true"> | ||
<domain includeSubdomains="true">10.0.2.2</domain> | ||
<domain includeSubdomains="true">127.0.0.1</domain> | ||
</domain-config> | ||
</network-security-config> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
import {BridgeServer} from 'react-native-http-bridge-refurbished'; | ||
let results: any[] = []; | ||
|
||
const server = new BridgeServer('http_service', true); | ||
|
||
server.get('/ping', async (_req, _res) => { | ||
console.log("🟦 🟦🟦🟦🟦🟦🟦 🟦 Received request for '/ping'"); | ||
return {message: 'pong'}; | ||
}); | ||
|
||
server.get('/results', async (req, _res) => { | ||
// console.log("🟦 🟦🟦🟦🟦🟦🟦 🟦 Received request for '/test_results'"); | ||
// console.log(req.type); | ||
// console.log(req.data); | ||
// console.log(req.url); | ||
// if (results.length > 0) { | ||
// return {results}; | ||
// } else { | ||
// return {}; | ||
// } | ||
return {results}; | ||
}); | ||
|
||
server.listen(9000); | ||
|
||
export function startServer() { | ||
return server; | ||
} | ||
|
||
export function stopServer() { | ||
server.stop(); | ||
} | ||
|
||
export function setServerResults(r: any[]) { | ||
results = r; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,8 @@ | ||
JAVA_OPTS=-XX:MaxHeapSize=6g yarn turbo run run:android:release --cache-dir=.turbo/android | ||
adb reverse tcp:10424 tcp:10424 | ||
echo "🟦 Android device address:" | ||
adb forward tcp:9000 tcp:9000 | ||
# echo "🟦 Android device address:" | ||
adb shell ip addr show | ||
# echo "📱 Android Emulator IP Address:" | ||
# adb shell ifconfig | grep "inet addr" | awk '{print $2}' | awk -F: '{print $2}' | ||
echo "Polling in-app server..." | ||
node ./scripts/poll-in-app-server.js |