iPhone push notification without alert
Asked Answered
V

2

1

Is it possible to send a text push notification to an iPhone app without it popping up a modal dialog? I want it to go straight to the tray, like an Android notification. I know the notification tray can present notifications on iPhone very similarly to Android, but my research tells me the only way to get one there is to first have it pop up as a modal!

I'm creating a chat app, and a modal dialog popping up every time other people send messages (which could be every second) would be extremely annoying, but I need to have some way of letting the user know there are new messages. I don't think just incrementing the badge number is enough, since the app might not be on the home screen where they'll see it, and that provides no indication if the phone is locked (as far as I know). I don't actually have an iPhone and I've never used one, so maybe I'm way off base about what iPhone users expect.

Vacancy answered 19/9, 2014 at 17:46 Comment(0)
F
0

If you use APNS JSON, you can simply send null as body, and nothing will be presented to user. You can send "hidden" field, for your app purposes.

Or just set most preferred UIRemoteNotificationType (iOS 7) or UIUserNotificationSettings (iOS 8) for your notifications.

Fronnia answered 19/9, 2014 at 19:8 Comment(0)
C
0

If you send null as body and null as sound it will be unnnoticable. For example you can update the badge without notifing the user

In php using the following package https://github.com/davibennun/laravel-push-notification it would work this way

PushNotification::app(APP_ID)
->to(TARGET_DEVICE_ID)
->send(PushNotification::Message(null, ['badge'  => 90, 'sound'  => null]));
Carinacarinate answered 5/8, 2016 at 7:0 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.