خرید بک لینک

Vote count: 0

I have a Swift iOS8+ app that receives remote push notifications from a 3rd party server over which I have no control.

That server sends push notifications as JSONs with the usual "alert" and "badge", but does not send the "sound". Consequently, my app plays the default alert sound for push notifications.

Is there any way to programmatically override the sound, so that I can play my own, custom remote push notification alert sound? Or even programmatically mute the sound? Remember, I caot force the sending server to change the push notification payload to include a different sound.

I began by placing the sound file (ding.aiff) in my main bundle, but there seems to be no way of using that file in my app to play it instead of the default alert sound.

Does anyone know of a way using Swift 2+ on iOS8+ that can override or mute the remote push notification alert sound?

(If this is not possible - perhaps Apple is paranoid over music copyright - is there a way to mute the sound programmatically?)

asked 38 secs ago

برچسب: نویسنده: استخدام کار تاريخ: جمعه 27 فروردين 1395 ساعت: 8:27

صفحه بندی