简体   繁体   中英

Laravel Push notifications: Send silent push notification

I am using this to send push notification to iOS and it is working fine except the fact that I don't know how to send a silent push using this package. I have tried to send it like this:

$payload = PushNotification::Message('', array(
                    'aps' => array(
                        'content_available' => 1,
                    ),
                    'data' => array(
                        'actionType' => $actionType
                    )
                ));

Sending empty string in the first param of ::Message , it does not show anything on mobile screen but it does produces the sound. Secondly, I tried it without the presence of this param. But if this param is not present, it throws exception. How to send silent push? Any ideas?

My Laravel version is 5.4.

我在上面问题中显示的代码中犯的一个小错误是使用content_available而不是content-available

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM