Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions demo/MapAndLocation/.bundle/config
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
BUNDLE_PATH: "vendor/bundle"
BUNDLE_FORCE_RUBY_PLATFORM: 1
13 changes: 13 additions & 0 deletions demo/MapAndLocation/.env
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
API_URL=
APP_ENV=dev
CODEPUSH_KEY_IOS=
CODEPUSH_KEY_ANDROID=
APP_ID=saigontech.demo.app.map
APP_NAME=Demo-Map

#Config for codepush and build
APPCENTER_TOKEN_UPLOAD_APP=
APPCENTER_APP_NAME=
APPCENTER_APP_DISPLAY_NAME=
APPCENTER_RELEASE_NOTE=
APPCENTER_DISTRIBUTE_DESTINATIONS=
13 changes: 13 additions & 0 deletions demo/MapAndLocation/.env.development
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
API_URL=
APP_ENV=dev
CODEPUSH_KEY_IOS=
CODEPUSH_KEY_ANDROID=
APP_ID=saigontech.demo.app.map
APP_NAME=Demo-Map

#Config for codepush and build
APPCENTER_TOKEN_UPLOAD_APP=
APPCENTER_APP_NAME=
APPCENTER_APP_DISPLAY_NAME=
APPCENTER_RELEASE_NOTE=
APPCENTER_DISTRIBUTE_DESTINATIONS=
13 changes: 13 additions & 0 deletions demo/MapAndLocation/.env.production
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
API_URL=
APP_ENV=production
CODEPUSH_KEY_IOS=
CODEPUSH_KEY_ANDROID=
APP_ID=saigontech.demo.app.map
APP_NAME=Demo-Map

#Config for codepush and build
APPCENTER_TOKEN_UPLOAD_APP=
APPCENTER_APP_NAME=
APPCENTER_APP_DISPLAY_NAME=
APPCENTER_RELEASE_NOTE=
APPCENTER_DISTRIBUTE_DESTINATIONS=
13 changes: 13 additions & 0 deletions demo/MapAndLocation/.env.staging
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
API_URL=
APP_ENV=staging
CODEPUSH_KEY_IOS=
CODEPUSH_KEY_ANDROID=
APP_ID=saigontech.demo.app.map
APP_NAME=Demo-Map

#Config for codepush and build
APPCENTER_TOKEN_UPLOAD_APP=
APPCENTER_APP_NAME=
APPCENTER_APP_DISPLAY_NAME=
APPCENTER_RELEASE_NOTE=
APPCENTER_DISTRIBUTE_DESTINATIONS=
67 changes: 67 additions & 0 deletions demo/MapAndLocation/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
# OSX
#
.DS_Store

# Xcode
#
build/
*.pbxuser
!default.pbxuser
*.mode1v3
!default.mode1v3
*.mode2v3
!default.mode2v3
*.perspectivev3
!default.perspectivev3
xcuserdata
*.xccheckout
*.moved-aside
DerivedData
*.hmap
*.ipa
*.xcuserstate

# Android/IntelliJ
#
.idea
.gradle
local.properties
*.iml

.eslintrc.js

# node.js
#
node_modules/
npm-debug.log
yarn-error.log

# BUCK
buck-out/
\.buckd/
*.keystore
!debug.keystore

# fastlane
#
# It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the
# screenshots whenever they are needed.
# For more information about the recommended setup visit:
# https://docs.fastlane.tools/best-practices/source-control/

*/fastlane/report.xml
*/fastlane/Preview.html
*/fastlane/screenshots

# Bundle artifact
*.jsbundle

# CocoaPods
/ios/Pods/
*.zip

# react-native-config codegen
ios/tmp.xcconfig
ios/prebuild.log

src/constants/codePushVersion.js
4 changes: 4 additions & 0 deletions demo/MapAndLocation/.husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"

yarn pretty && yarn lint:fix
1 change: 1 addition & 0 deletions demo/MapAndLocation/.node-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
18
9 changes: 9 additions & 0 deletions demo/MapAndLocation/.prettierrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
module.exports = {
arrowParens: 'avoid',
bracketSameLine: true,
bracketSpacing: false,
singleQuote: true,
trailingComma: 'all',
semi: false,
printWidth: 110,
}
1 change: 1 addition & 0 deletions demo/MapAndLocation/.watchmanconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{}
40 changes: 40 additions & 0 deletions demo/MapAndLocation/App.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
import React from 'react'
import {LogBox, Text} from 'react-native'
import {SafeAreaProvider} from 'react-native-safe-area-context'
import {Provider} from 'react-redux'
import {configureLocalization} from './src/locale/I18nConfig'
import MainLayout from './src/MainLayout'
import {injectStore} from './src/services/networking/axios'
import {store, persistor} from './src/store/store'
import {PersistGate} from 'redux-persist/integration/react'

interface TextWithDefaultProps extends Text {
defaultProps?: {
allowFontScaling?: boolean
underlineColorAndroid?: 'transparent'
}
}
/* eslint-disable @typescript-eslint/no-extra-semi */
;(Text as unknown as TextWithDefaultProps).defaultProps = {
...(Text as unknown as TextWithDefaultProps).defaultProps,
allowFontScaling: false,
underlineColorAndroid: 'transparent',
}
LogBox.ignoreAllLogs(true)

injectStore(store)
configureLocalization('en')

function App() {
return (
<Provider store={store}>
<PersistGate loading={null} persistor={persistor}>
<SafeAreaProvider>
<MainLayout />
</SafeAreaProvider>
</PersistGate>
</Provider>
)
}

export default App
6 changes: 6 additions & 0 deletions demo/MapAndLocation/Gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
source 'https://rubygems.org'

# You may use http://rbenv.org/ or https://rvm.io/ to install and use this version
ruby '>= 2.6.10'

gem 'cocoapods', '>= 1.11.3'
100 changes: 100 additions & 0 deletions demo/MapAndLocation/Gemfile.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
GEM
remote: https://rubygems.org/
specs:
CFPropertyList (3.0.5)
rexml
activesupport (6.1.7)
concurrent-ruby (~> 1.0, >= 1.0.2)
i18n (>= 1.6, < 2)
minitest (>= 5.1)
tzinfo (~> 2.0)
zeitwerk (~> 2.3)
addressable (2.8.1)
public_suffix (>= 2.0.2, < 6.0)
algoliasearch (1.27.5)
httpclient (~> 2.8, >= 2.8.3)
json (>= 1.5.1)
atomos (0.1.3)
claide (1.1.0)
cocoapods (1.11.3)
addressable (~> 2.8)
claide (>= 1.0.2, < 2.0)
cocoapods-core (= 1.11.3)
cocoapods-deintegrate (>= 1.0.3, < 2.0)
cocoapods-downloader (>= 1.4.0, < 2.0)
cocoapods-plugins (>= 1.0.0, < 2.0)
cocoapods-search (>= 1.0.0, < 2.0)
cocoapods-trunk (>= 1.4.0, < 2.0)
cocoapods-try (>= 1.1.0, < 2.0)
colored2 (~> 3.1)
escape (~> 0.0.4)
fourflusher (>= 2.3.0, < 3.0)
gh_inspector (~> 1.0)
molinillo (~> 0.8.0)
nap (~> 1.0)
ruby-macho (>= 1.0, < 3.0)
xcodeproj (>= 1.21.0, < 2.0)
cocoapods-core (1.11.3)
activesupport (>= 5.0, < 7)
addressable (~> 2.8)
algoliasearch (~> 1.0)
concurrent-ruby (~> 1.1)
fuzzy_match (~> 2.0.4)
nap (~> 1.0)
netrc (~> 0.11)
public_suffix (~> 4.0)
typhoeus (~> 1.0)
cocoapods-deintegrate (1.0.5)
cocoapods-downloader (1.6.3)
cocoapods-plugins (1.0.0)
nap
cocoapods-search (1.0.1)
cocoapods-trunk (1.6.0)
nap (>= 0.8, < 2.0)
netrc (~> 0.11)
cocoapods-try (1.2.0)
colored2 (3.1.2)
concurrent-ruby (1.1.10)
escape (0.0.4)
ethon (0.16.0)
ffi (>= 1.15.0)
ffi (1.15.5)
fourflusher (2.3.1)
fuzzy_match (2.0.4)
gh_inspector (1.1.3)
httpclient (2.8.3)
i18n (1.12.0)
concurrent-ruby (~> 1.0)
json (2.6.3)
minitest (5.16.3)
molinillo (0.8.0)
nanaimo (0.3.0)
nap (1.1.0)
netrc (0.11.0)
public_suffix (4.0.7)
rexml (3.2.5)
ruby-macho (2.5.1)
typhoeus (1.4.0)
ethon (>= 0.9.0)
tzinfo (2.0.5)
concurrent-ruby (~> 1.0)
xcodeproj (1.22.0)
CFPropertyList (>= 2.3.3, < 4.0)
atomos (~> 0.1.3)
claide (>= 1.0.2, < 2.0)
colored2 (~> 3.1)
nanaimo (~> 0.3.0)
rexml (~> 3.2.4)
zeitwerk (2.6.6)

PLATFORMS
ruby

DEPENDENCIES
cocoapods (~> 1.11, >= 1.11.2)

RUBY VERSION
ruby 2.7.5p203

BUNDLED WITH
2.1.4
39 changes: 39 additions & 0 deletions demo/MapAndLocation/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
## React Native Map And Location

This is a straightforward cross-platform mobile application built with React Native, compatible with both iOS and Android devices. This example use [react-native-maps](https://github.com/react-native-maps/react-native-maps) library

**Video Demo**

https://github.com/saigontechnology/React-Native/assets/114563576/76a0ad5e-17ed-447b-9244-bbd8b8a522cc

## 📡 Features:

### 1. **Map and Location**
Showing Map and current Location of the phone on the Map. With simulated location changes, you can witness the seamless transition as you move from one point to another.

### 2. **Drawing Zone or Line**
Allows you to unleash your creativity by drawing zones or lines directly onto the map. Whether you're marking out boundaries or planning routes, the intuitive interface makes it simple and intuitive.

### 3. **Route**
Showcases the ability to generate routes between two predefined locations, providing you with guidance from one destination to another.

## 🚀 Getting Started:

### Pre-actions:
Check out the Installation process for [react-native-maps](https://github.com/react-native-maps/react-native-maps/blob/master/docs/installation.md#installation) first and acquire the API keys, and update them into:
- android/app/src/main/AndroidManifest.xml
- android/app/src/main/res/values/google_maps_api.xml
- ios/DemoMap/AppDelegate.mm

Then running the project as follow:
1. Clone this repository to your local machine.
2. Install dependencies using your preferred package manager (e.g., `npm install` or `yarn install`).
3. Run the application on your preferred platform (iOS/Android) using `yarn android` or `yarn ios`.

Explore the codebase, experiment with configurations, and use this demo as a starting point for incorporating beacon technology into your own React Native applications.

## 📚 Resources:

- [React Native Maps](https://github.com/react-native-maps/react-native-maps)

Feel free to reach out to the community for any questions or share your enhancements to this demo. Happy coding! 📡
14 changes: 14 additions & 0 deletions demo/MapAndLocation/__tests__/App-test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
/**
* @format
*/

import 'react-native'
import React from 'react'
import App from '../App'

// Note: test renderer must be required after react-native.
import renderer from 'react-test-renderer'

it('renders correctly', () => {
renderer.create(<App />)
})
14 changes: 14 additions & 0 deletions demo/MapAndLocation/__tests__/App-test.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
/**
* @format
*/

import 'react-native'
import React from 'react'
import App from '../App'

// Note: test renderer must be required after react-native.
import renderer from 'react-test-renderer'

it('renders correctly', () => {
renderer.create(<App />)
})
6 changes: 6 additions & 0 deletions demo/MapAndLocation/android/Gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
source "https://rubygems.org"

gem "fastlane"

plugins_path = File.join(File.dirname(__FILE__), 'fastlane', 'Pluginfile')
eval_gemfile(plugins_path) if File.exist?(plugins_path)
Loading