iphone - iOS : Programmatically control the volume of Notification alert and sound theme -


i have requirement like, through app want set notification sound , volume. because of our requirement. there 3 different states - happy, sad , normal. when user gain points send congratulation message, when lost points send message also. promotion related other message too. these state want set different notification sound , volume too. appreciate inputs. ty

for local notification

func schedulenotifications(inseconds: timeinterval, completion: @escaping (_ success: bool) ->()){         ...         notif.sound = unnotificationsound.init(named: "customsound.mp3")          ... } 

for push notification

aps data should have sound key in , server need send file name should play,

{   aps =   {     alert = "message";     sound = "sound file name.extension";     badge = 1;   }; } 

Comments

Popular posts from this blog

javascript - Confirm a form & display message if form is valid with JQuery -

Retrieving ETA (estimated time of arrival) with Google Distance Matrix API and public transit as transport mode -

ionic framework - Meteor - Error: Failed to execute 'insertBefore' on 'Node' -