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
7e20a7a1
Commit
7e20a7a1
authored
Jun 16, 2020
by
Fred
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix permission notification ios
parent
5a64c156
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
10 deletions
+14
-10
Login.js
view/Login.js
+14
-10
No files found.
view/Login.js
View file @
7e20a7a1
...
...
@@ -39,15 +39,18 @@ class Login extends React.Component {
}
_getDeviceInfo
=
async
()
=>
{
let
{
status
}
=
await
Permissions
.
getAsync
(
Permissions
.
NOTIFICATIONS
);
if
(
status
!==
'granted'
)
{
// Alert.alert('Akses tidak dizinkan!')
Toast
.
show
(
"Failed to get push token for push notification!"
,
ToastAndroid
.
SHORT
)
}
else
if
(
Device
.
osName
==
'Android'
&&
!
Device
.
isDevice
)
{
// Alert.alert('Silahkan anda coba di real Device')
Toast
.
show
(
"Silahkan anda coba di real Device"
,
ToastAndroid
.
SHORT
)
d
}
else
{
if
(
Constants
.
isDevice
)
{
const
{
status
:
existingStatus
}
=
await
Permissions
.
getAsync
(
Permissions
.
NOTIFICATIONS
);
let
finalStatus
=
existingStatus
;
if
(
existingStatus
!==
'granted'
)
{
const
{
status
}
=
await
Permissions
.
askAsync
(
Permissions
.
NOTIFICATIONS
);
finalStatus
=
status
;
}
if
(
finalStatus
!==
'granted'
)
{
Toast
.
show
(
'Failed to get push token for push notification!'
);
return
;
}
let
fb_token
=
await
Notifications
.
getExpoPushTokenAsync
();
let
device_id
=
Constants
.
deviceId
let
os_name
=
Device
.
osName
...
...
@@ -63,7 +66,8 @@ d } else {
}
// console.log(deviceInfoProps);
this
.
props
.
setDeviceInfo
(
deviceInfoProps
)
}
else
{
Toast
.
show
(
'Must use physical device for Push Notifications'
);
}
}
...
...
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