Quantcast
Channel: Questions in topic: "ios"
Viewing all articles
Browse latest Browse all 4709

iOS Local Notification doesn't make a sound

$
0
0
I've been able to get the basic iOS Local Notifications working, but for some reason the default alert sound will not play when the notification is received. I'm not customizing the sound so I should hear the default sound, but currently hear nothing. I double checked that my App's settings have Notifications enabled and Sound enabled. Am I missing a step in the process or am I not registering for sound notifications properly? void Start () { // Unity Local Notifications are only support on iOS if (Application.platform == RuntimePlatform.IPhonePlayer) { NotificationServices.RegisterForLocalNotificationTypes (LocalNotificationType.Alert | LocalNotificationType.Badge | LocalNotificationType.Sound); // Test notification LocalNotification notification = new LocalNotification (); notification.alertBody = "Hello World"; notification.alertAction = "Alert Action"; notification.hasAction = true; notification.applicationIconBadgeNumber = -1; notification.fireDate = DateTime.Now.AddSeconds (10); Dictionary customData = new Dictionary (); customData.Add ("gem_bonus", "2"); customData.Add ("coin_bonus", "3"); notification.userInfo = customData; NotificationServices.ScheduleLocalNotification (notification); StartCoroutine (ReceiveLocalNotifications ()); } }

Viewing all articles
Browse latest Browse all 4709

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>