问题
I have a small but tricky question over apple push notification payload on iOS.
From what I know the push notification payload can have sound (length <= 30 seconds), text and badge. Now what I want with my iphone app is that the push notification sent by my provider (server) to this app on iPhone screen to constantly buzz at regular interval (say every 1 min) until user taps on the notification on screen (i.e. checks the message). Hence, the notification would play the sound constantly and stops when user taps and launch the app.
Is it feasible? How?
PS: Its an enterprise application and would not be deployed on App Store.
Thanks in advance.
回答1:
Yes, it is. This is how you could implement that:
- Register device for push notification
- Send out a push message with ref to a sound every 30-60 seconds
- Invalidate each message after 30-60 seconds, making room for the new one
- When user re-opens the app, register the app as re-opened to the server and stop sending out push notifications
I do not know how this would look in the notification center, but you can test and have a look :)
来源:https://stackoverflow.com/questions/10532684/apple-push-notification-with-sound-buzzing-at-regular-interval