Notification sound playing on loop in iOS 16 and above - ios

I have added the support to play a custom notification sound in my application whenever a notification of a certain type is received. The notification sound being used in this case is 9 seconds long.
Till iOS version 15 (including all the incremental release), it is being played just once, i.e. for 9 seconds if it is not intercepted by the user or by another notification (silent/normal) but for iOS 16 and above the sound it being played on loop for 30 seconds if there is no interception.
Any suggestions or ideas as to why this is happening and how can this be solved.
TIA.
It should ideally be played once only for 9 seconds if there is no interception.

Related

Broadcast upload extension randomly fails, not starting and killing

So the main idea is: my broadcast upload extension making video of phone screen and when it finishes it saves video into directory.
When I am starting extension it works well and saving video. It can make video during 30 minutes and longer. But for some reason it can be randomly killed after few seconds of work even few minutes without any error being displayed. I don't know what what is the problem?. Maybe somebody can help me with that?
It happens on iOS 13 and iOS 12.

AVPlayer takes long time to start playing

After the update to Swift 3 I´ve realised that my App takes long time to start playing an audio file from a remote server. In Swift 2.3 this didn't´t happen. I´ve been trying to debug it all day long but I couldn't´t find anything. I´ve been printing the states of the AVPlayer at each moment and I found that it changes from Loading to Playing within seconds but then it takes around 20 seconds to really start playing the song.
I am using Jukebox by TeodorPatras
I finally fixed it myself with the next line of code:
player?.playImmediately(atRate: 1.0)
What that line does is, it starts playing immediately without ensuring that the buffer it´s enough to not suffer interruptions. But in my case I prefer that over having to wait for several seconds.
I had the same issues with the devices with iOS 10 only. The solution to support iOS 10 and the old iOS versions is this:
if #available(iOS 10.0, *) {
player?.playImmediately(atRate: 1.0)
} else {
player?.play()
}

Core Bluetooth Restoration Timing Issue

I thought I had the whole bluetooth restoration thing working (acting as a central), then I tried the following:
1 - Peripheral sends single bluetooth packet every 1 second
2 - At random time, I kill app (either using the debugger stop, or another app to eat all the memory)
3 - Check if restoration took place
This worked about 80% of the time and the errors were seemingly random.
After two days I was able to reliably reproduce the problem:
1 - Peripheral sends two packets 1000 ms apart
2 - Kill the app programatically (kill(getpid(),SIGKILL) some delta after the first packet (100ms,200ms...) which is some delta before the next packet (900ms, 800ms)
|--PKT-------850ms------KILL--150ms--PKT--|
3 - Second packet arrives and wakes the app up
What I found is that if the time between app termination and the next packet arriving is greater than about 150ms, restoration takes place as it should 100% of the time.
If the time between app termination and the next packet arriving is less than about 150ms, if I open the app manually within 10 seconds, restoration takes place 100% of the time. If I open the app manually after more than 10 seconds, it's as though no restoration took place. Also, once the app is killed, I watch the bluetooth symbol in the status bar and after exactly 10 seconds the connection is dropped.
Testing took place on an iPhone 4s running 8.1 and then 8.2.
This seems like a bug... I can provide my code if that helps however I've stripped it back to the bare minimum delegate implementations. I've tried putting the central manager on a different queue to no avail. This is real issue for my product as it relies upon session-based, background bluetooth tracking. Any thoughts?
This seems to be resolve in iOS 9+

Scheduling 300 UILocalNotifications for iOS resulting app failure

From the ios developer doc, I found that an iOS app could support maximum of 64 local notifications.
( somewhere in stackoverflow I found it's maximum limit is 128 ).
So, I made an app scheduling 300 UILocalNotifications.
Xcode 5.1 compiled my code scheduling all 300 notifications.
I used NSLog() to verify this.
NSLog(#"\nLocal notifications count is::%d",[[UIApplication sharedApplication] scheduledLocalNotifications].count);
And then I began testing.
I observed notifications over 150.
So, how's this possible?
But I had an issue. When I clicked on my app, it displayed an alert : "NotificationTestingApp" is No Longer Available
Can somebody explain this?
Thanks.

Background mode phonegap in ios8

We are working on an ios phonegap app where we would like to add an alarm clock. We know that we have to activate the background mode options in the info.plist file and that the background service is restricted to 10 minutes life time in ios 8. We tried to extend the 10 minute range with several plugins but could not get it working. Our app is requesting data asynchronously from a web server and checks them against the data on the mobile device. If the the data is equal a radio stream should start. Do you have any idea how we could get this running?
Greetings
Alex

Resources