edamov / pushok

PHP client for Apple Push Notification Service (APNs) - Send push notifications to iOS using the new APNs HTTP/2 protocol with token-based (JWT with p8 private key)
MIT License
368 stars 119 forks source link

Sending `Alert` as `Background` due to `content-available` set #170

Closed alnp closed 10 months ago

alnp commented 10 months ago

Hello,

I hope this message finds you well. I am currently experiencing an issue, specifically regarding the configuration of notification types when using the isContentAvailable parameter. The problem is that when I set isContentAvailable, the code automatically changes the notification type to Background, which makes it challenging to send an alert type notification with content-available using the Apple Push Notification service.

I would like to propose an improvement to the code that allows users to specify both the content-available flag and the notification type, particularly the alert type. This would provide greater flexibility and alignment with the Apple Push Notification service's capabilities.

Thank you for your attention to this matter, and I look forward to your guidance on how to proceed or any updates regarding this issue.

Best regards!

alnp commented 10 months ago

Actually, marciodeaquino just found a solution to set this property $payload->setPushType('alert');.