Added OneSignal
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
import {defineStore} from 'pinia'
|
||||
|
||||
import OneSignal from "onesignal-cordova-plugin";
|
||||
import {Capacitor} from "@capacitor/core";
|
||||
// @ts-ignore
|
||||
export const useProfileStore = defineStore('profile', () => {
|
||||
|
||||
@@ -44,6 +45,14 @@ export const useProfileStore = defineStore('profile', () => {
|
||||
activeProfile.value = profiles.find(i => i.id === activeProfileConnection.profile_id)
|
||||
currentTenant.value = activeProfile.value.tenant
|
||||
|
||||
if(Capacitor.getPlatform() === "ios") {
|
||||
OneSignal.initialize("1295d5ff-28f8-46a6-9c62-fe5d090016d7");
|
||||
OneSignal.Location.setShared(false)
|
||||
OneSignal.Notifications.requestPermission();
|
||||
OneSignal.login(activeProfileConnection.user_id)
|
||||
}
|
||||
|
||||
|
||||
await fetchData()
|
||||
await dataStore.fetchData()
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user