Post

Replies

Boosts

Views

Activity

Swift iOS notification sound problems
I'm currently working on a Swift project for an iOS app that involves receiving notifications. The app is designed to play different sounds based on a specific parameter when a notification arrives. The correct behavior to follow is as follows. There are two types of notifications in the project: start notifications and stop notifications. Once the app receives a start notification it starts an audio player, the audio lasts X seconds but is looped by the player so it potentially lasts forever. When the app receives the stop notification, the player stops and the sound stops. This works great when the app is in the foreground. When the phone is locked and therefore the app is closed, the sound that is heard is X seconds without the sound being repeated as it happens in the foreground. Furthermore, it often happens that when the stop notification arrives, the player does not stop and continues until the end of X s time. Does anyone have an idea of ​​how to put the loop to the sound of the notification with the phone locked and be sure that when the stop notification arrives the player stops? The sound stop works well on some devices while on others it doesn't even with the same iOS versions.
0
0
524
Aug ’23
Strange bug - Some element are visible when I run app from XCode, but not if I start running the app from device - Swift
Context: Native iOS app developed with Swift which manages external control units via bluetooth. I use XCode Version 14.2, but it used to happen with older versions as well. Tested on devices with iOS 15 and 16. In a specific section what the app has to do is: take the data through the bluetooth input and output go to the outputs screen and present the outputs from the outputs screen go to the inputs screen and show them The problem is as follows. If I take a physical iphone and connect it to the mac, I start the app from xcode everything works fine. If, with the same iphone, I start the app not from xcode but with a tap from the iphone screen, the app starts correctly, connects via bluetooth, shows all the outputs correct, while for the inputs they are all correct except the 'last. The last one is never displayed, all the others are. The main problem is that I don't know how to debug since it only happens when the app starts unlinked from xcode. Does anyone know of other ways to troubleshoot the problem or have had similar problems and know of possible solutions?
0
0
254
Jan ’23