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

Command prompt result in label. Python 2.7 -

javascript - How do I use URL parameters to change link href on page? -

amazon web services - AWS Route53 Trying To Get Site To Resolve To www -