开发者

APNS Sending Frequent Notifications to Device

I'm trying to mimic a pager with my app by sending push notifications to the user until he or she responds. My thought was to send a push every few seconds and play the default sound on arrival. Not perfect, but better than nothing.

It's working all right. However, I am finding that the sound starts to stutter/interrupt a bit after a few notifications have been sent -- as if it's trying to play the sound more than once. This happens even if I only send the push every 10 seconds. I just tested it at 20 second intervals and even then it starts to sound inter开发者_运维知识库rupted after about 10 times.

Any idea how to resolve this so each message plays the sound crisply?

p.s. Testing performed on an iPad.


This is an answer, in the sense I'm going to advise you don't do this. I'm pretty sure sending push notifications every few seconds until the user responds violates section 2 of the Apple Push Notification guidelines (it's appendix A of you Apple developer agreement). You probably won't find a satisfactory answer here for two reasons:

  1. Nobody will have done it before, because it probably breaks the developer agreement
  2. Apple don't guarantee order or delivery of push notifications, and the speed at which they are delivered depends upon the device's network and connection speed.


I got it working. Turns out in my attempt to keep the connection open per Apple's guideline I was mistakenly reusing my MemoryStream object.

The retry interval will be user definable so I hope this won't break any of Apple's rules.

Thanks for your input!

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜