Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
N
new_excelso
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Prasetya Saputra
new_excelso
Commits
4e40f5e7
Commit
4e40f5e7
authored
Oct 14, 2020
by
Wahyu Adjie Prasetyo
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
alert permission
parent
19de3b69
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
25 additions
and
6 deletions
+25
-6
en.json
lib/en.json
+3
-1
id.json
lib/id.json
+3
-1
Home.js
view/Home.js
+19
-4
No files found.
lib/en.json
View file @
4e40f5e7
...
...
@@ -154,7 +154,9 @@
"sendtoken"
:
"Send Token"
,
"itemnotfound"
:
"There are no menu for this category"
,
"copyToClipboard"
:
"Copied To Clipboard"
,
"accessNotPermitted"
:
"Access Not Permitted!"
,
"accessNotPermitted"
:
"Click grant permission> allow all the time to grant location access"
,
"selectOpenSetting"
:
"Allow"
,
"titleAlertLocationNotPermitted"
:
"Location access is not permitted"
,
"tryItRealDevice"
:
"Please use real device instead of emulator"
,
"makeSureClaimCredit"
:
"Claiming your old balance. Are you sure?"
,
"notPremiumYet"
:
"Your account is not yet a Premium Account"
,
...
...
lib/id.json
View file @
4e40f5e7
...
...
@@ -154,7 +154,9 @@
"sendtoken"
:
"Kirim Token"
,
"itemnotfound"
:
"Tidak ada menu untuk kategori ini !"
,
"copyToClipboard"
:
"Disalin ke clipboard"
,
"accessNotPermitted"
:
"Akses tidak dizinkan!"
,
"accessNotPermitted"
:
"Klik Berikan izin > izinkan sepanjang waktu untuk memberikan akses lokasi"
,
"titleAlertLocationNotPermitted"
:
"Permintaan izin lokasi tidak diberikan"
,
"selectOpenSetting"
:
"Berikan izin"
,
"tryItRealDevice"
:
"Mohon menggunakan device, bukan emulator"
,
"makeSureClaimCredit"
:
"Yakin akan mengambil saldo lama Anda?"
,
"notPremiumYet"
:
"Akun Anda belum menjadi Akun Premium"
,
...
...
view/Home.js
View file @
4e40f5e7
...
...
@@ -5,7 +5,7 @@ import * as Location from 'expo-location';
import
*
as
Permissions
from
'expo-permissions'
;
import
i18n
from
'i18n-js'
;
import
*
as
React
from
'react'
;
import
{
ActivityIndicator
,
Alert
,
Dimensions
,
Platform
,
ScrollView
,
StatusBar
,
StyleSheet
,
Text
,
TouchableOpacity
,
View
}
from
'react-native'
;
import
{
ActivityIndicator
,
Alert
,
Dimensions
,
Platform
,
ScrollView
,
StatusBar
,
StyleSheet
,
Text
,
TouchableOpacity
,
View
,
PermissionStatus
}
from
'react-native'
;
import
{
Badge
}
from
'react-native-elements'
;
import
{
SliderBox
}
from
"react-native-image-slider-box"
;
import
{
Card
}
from
'react-native-shadow-cards'
;
...
...
@@ -19,6 +19,7 @@ import CustomIosStatusBar from './CustomIosStatusBar';
import
Spinner
from
'react-native-loading-spinner-overlay'
;
class
Home
extends
React
.
Component
{
...
...
@@ -126,19 +127,33 @@ class Home extends React.Component {
this
.
_unsubscribe
();
}
settings
()
{
this
.
_getPermissions
()
}
_getPermissions
=
async
()
=>
{
let
{
status
}
=
await
Permissions
.
askAsync
(
Permissions
.
LOCATION
);
if
(
status
!==
'granted'
)
{
// Alert.alert('Akses tidak dizinkan!')
Toast
.
show
(
i18n
.
t
(
'accessNotPermitted'
))
Alert
.
alert
(
i18n
.
t
(
'titleAlertLocationNotPermitted'
),
i18n
.
t
(
'accessNotPermitted'
),
[
{
text
:
i18n
.
t
(
'selectOpenSetting'
),
onPress
:
()
=>
this
.
settings
()
}
],
{
cancelable
:
false
}
)
}
else
if
(
Platform
.
OS
===
'android'
&&
!
Device
.
isDevice
)
{
// Alert.alert('Silahkan anda coba di real Device')
Toast
.
show
(
i18n
.
t
(
'tryItRealDevice'
))
}
else
{
this
.
_getCurrentPosisition
()
}
}
_getCurrentPosisition
=
async
()
=>
{
let
location
=
await
Location
.
getCurrentPositionAsync
({
accuracy
:
Location
.
Accuracy
.
Highest
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment