import{r as a,b as r,u as n,C as c,P as d,c as u}from"./index.cf09daef.js";const e=a("PushNotifications",{});var p=r(async({redirect:s})=>{const o=n();c.isNativePlatform()&&(console.log("Initializing Push Notification...."),e.requestPermissions().then(i=>{i.receive==="granted"&&e.register()}),e.addListener("registration",i=>{const t=i.value;console.log("boot/push-notification.registration()",t),o.isAuthenticated?o.addDeviceToken(t):d.set("device_token",t)}),e.addListener("registrationError",i=>{u.error(i)}),e.addListener("pushNotificationReceived",i=>{}),e.addListener("pushNotificationActionPerformed",({notification:i})=>{const{data:t}=i;t.route&&s({path:t.route})}))});export{p as default};
