Fix saving notification data
This commit is contained in:
parent
85dc440fe8
commit
ad990ca528
5 changed files with 43 additions and 28 deletions
|
@ -35,17 +35,17 @@ export default function HomeScreen() {
|
|||
OneSignal.initialize("6ef15aa7-9dc0-4d8b-b6b1-e2005bcd3dc6");
|
||||
|
||||
// Request permission
|
||||
OneSignal.Notifications.requestPermission(true)
|
||||
|
||||
// Retrieve one signal user token
|
||||
OneSignal.User.pushSubscription.getIdAsync().then((notificationsToken) => {
|
||||
if (notificationsToken) {
|
||||
Request.post( 'sessions/update', { token: token, notifications_token: notificationsToken } ).then( (response) => {
|
||||
if (!response.success) {
|
||||
Message.error( 'Notificaties zijn uitgeschakeld door een onbekende error' );
|
||||
}
|
||||
} );
|
||||
}
|
||||
OneSignal.Notifications.requestPermission(true).then(() => {
|
||||
// Retrieve one signal user token
|
||||
OneSignal.User.pushSubscription.getIdAsync().then((notificationsToken) => {
|
||||
if (notificationsToken) {
|
||||
Request.post( 'sessions/update', { token: token, notifications_token: notificationsToken } ).then( (response) => {
|
||||
if (!response.success) {
|
||||
Message.error( 'Notificaties zijn uitgeschakeld door een onbekende error' );
|
||||
}
|
||||
} );
|
||||
}
|
||||
})
|
||||
})
|
||||
|
||||
// Disable loading again
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue