Hello.
I have developed the audio streaming app from watchOS6 to current.
Now I have a critical bug in watchOS7.
Our business process is like that.
But now, I face the problem fetching the address in background not working perfectly.
I made URLSession with background configuration(Making Background Requests)
Also, sometimes even if there was a correct URL, but cannot play next track.
Please give me any help... thanks.
I have developed the audio streaming app from watchOS6 to current.
Now I have a critical bug in watchOS7.
Our business process is like that.
fetch the address of audio-content from server.
make the URLAsset with the address.
Play with AVPlayer and URLAsset what I have made.
But now, I face the problem fetching the address in background not working perfectly.
I made URLSession with background configuration(Making Background Requests)
Also, sometimes even if there was a correct URL, but cannot play next track.
Please give me any help... thanks.
Hi @jungsufromgwanak-gu,
If I understand you correctly, you are doing the following:
1 - Getting the URL address of your audio asset in the background. This URL address is the content you wish to get via a background URLSession
2 - Using that URL address to then load the audio content into the player in the background as well
3 - Play the audio content.
You are having trouble with 1, 2 or 3? If you're having trouble with 1 that brings up a lot of questions, because you said the URL address is only available for 10 minutes. You cannot schedule a background refresh for less than 15 minutes, so I don't understand how it was working in the first place. Also, even if you could make the scheduling every 10 minutes, how would you synchronize the start of the 10 minutes on the watch with the 10 minutes on the server? As polyphonic pointed out WatchOS could schedule the next background refresh at 10 minutes + n, where n could be several minutes.
Typically I schedule background refresh for the smallest time interval (15 minutes) and then at that point I create a background URL session which then downloads my content. So the best that I can do is get my content approximately every 15 minutes. There's no way to make that time interval 10 minutes. Are you certain that in WatchO 6.x.x the address was being obtained via background URLSession every 10 minutes?
If I understand you correctly, you are doing the following:
1 - Getting the URL address of your audio asset in the background. This URL address is the content you wish to get via a background URLSession
2 - Using that URL address to then load the audio content into the player in the background as well
3 - Play the audio content.
You are having trouble with 1, 2 or 3? If you're having trouble with 1 that brings up a lot of questions, because you said the URL address is only available for 10 minutes. You cannot schedule a background refresh for less than 15 minutes, so I don't understand how it was working in the first place. Also, even if you could make the scheduling every 10 minutes, how would you synchronize the start of the 10 minutes on the watch with the 10 minutes on the server? As polyphonic pointed out WatchOS could schedule the next background refresh at 10 minutes + n, where n could be several minutes.
Typically I schedule background refresh for the smallest time interval (15 minutes) and then at that point I create a background URL session which then downloads my content. So the best that I can do is get my content approximately every 15 minutes. There's no way to make that time interval 10 minutes. Are you certain that in WatchO 6.x.x the address was being obtained via background URLSession every 10 minutes?