Преглед изворни кода

fix para so as 3 notifications q precisam de som emitirem som

Gustavo Zanatta пре 2 дана
родитељ
комит
930b227dc5

+ 13 - 0
app/Notifications/Push/BasePushNotification.php

@@ -40,4 +40,17 @@ abstract class BasePushNotification
     {
         return 7;
     }
+
+    /**
+     * Canal de notificação do Android usado por esta push.
+     *
+     * 'diaria' toca o som chamativo (diaria.wav); 'padrao' usa o som de
+     * notificação do sistema. Só sobrescreva para 'diaria' nas pushes que
+     * exigem atenção imediata — o canal precisa existir no app de destino
+     * (ver MainActivity.java dos apps de cliente e prestador).
+     */
+    public function androidChannelId(): string
+    {
+        return 'padrao';
+    }
 }

+ 5 - 0
app/Notifications/Push/Cliente/Agendamento/PrestadorAceitouPush.php

@@ -61,4 +61,9 @@ class PrestadorAceitouPush extends BasePushNotification
     {
         return 0;
     }
+
+    public function androidChannelId(): string
+    {
+        return 'diaria';
+    }
 }

+ 5 - 0
app/Notifications/Push/Prestador/Agendamento/NewPushRequest.php

@@ -57,4 +57,9 @@ class NewPushRequest extends BasePushNotification
     {
         return 0;
     }
+
+    public function androidChannelId(): string
+    {
+        return 'diaria';
+    }
 }

+ 1 - 1
app/Services/PushNotificationService.php

@@ -48,7 +48,7 @@ class PushNotificationService
                 )
             )
             ->withAndroidConfig(AndroidConfig::fromArray([
-                'notification' => ['channel_id' => 'diaria'],
+                'notification' => ['channel_id' => $notification->androidChannelId()],
                 'priority' => 'high',
             ]));