[iOS] iOS 12.2 AVPlayer failed to play next track and missing in Control Center

246 views
Skip to first unread message

Candy Leung

unread,
Jun 18, 2019, 11:52:33 PM6/18/19
to Google Mobile Ads SDK Developers
Our app's main feature is to play a list of audio tracks (local or progressively downloaded file-based audio files).

When a user selects a program, there will be an array of track objects (track id, description, url, etc). To start playback, we instantiate a new AVPlayer and set the track url to the player; when that track finishes (observe AVPlayerItemDidPlayToEndTimeNotification), we release the existing player, and then instantiate a new AVPlayer for the next track.

We have set AVAudioSessionCategoryPlayback when app launches.
We have set AVAudioSession active = YES when a new track is played.
We are using MPRemoteCommandCenter instead of the old beginReceivingRemoteControlEvents().

The implementation worked fine for many years. But starting from iOS 12.2, our users started experiencing some playback problems such as:
1. Failed to play the next track automatically.
-- from our logs, we can see that the player has started loading the next track, but then it was stopped (KVO, rate = 0)
2. The controls in Control Center were missing; it only showed "Music". It also seemed to affect AirPlay and Bluetooth (car).

We cannot always reproduce the problems so it is difficult for us to debug.

After googling iOS 12.2 AVPlayer / Control Center related topics, we came across this SO post: https://stackoverflow.com/questions/55725591/ios-12-2-lockscreen-controlos-missing, and started to suspect if the issue was related to the DFPBannerView (kGADAdSizeSmartBannerPortrait) at the bottom of each page. (Google-Mobile-Ads-SDK v7.42.2)

Then we commented out the lines of codes that load the banner request, and distributed a test version through TestFlight. Nearly 90% of the testers reported that they did not experience the problems again with the no-banner version.

Does a particular type of ad banner affect the behaviour of the Control Center? Do we need to set anything to prevent this?

Thanks.

Mobile Ads SDK Forum Advisor Prod

unread,
Jun 19, 2019, 4:12:57 AM6/19/19
to candy.l...@gmail.com, google-adm...@googlegroups.com
Hi Candy,

Thank you for contacting us.

Could you please provide us the following details for us to investigate the issue further? Please use "Reply Privately to Author" option to share the details privately. Regards,
Teejay Pimentel
Mobile Ads SDK Team

 



ref:_00D1U1174p._5001UBo7iF:ref

Candy Leung

unread,
Jun 25, 2019, 11:41:18 PM6/25/19
to Google Mobile Ads SDK Developers
Hi Teejay,

Have you received my Charles logs?

Mobile Ads SDK Forum Advisor Prod

unread,
Jun 26, 2019, 1:28:52 AM6/26/19
to candy.l...@gmail.com, google-adm...@googlegroups.com
Hi Candy,

It seems that my email didn't went through. I can't access the drive that you have shared. With that said, could you please provide us the sharable link instead? In addition, please provide us your project (or at least a test project) where the issue is reproducible as this will be a big help on investigation and to identify the issue. Please share the details privately using the "Reply Privately to Author" option.

Mobile Ads SDK Forum Advisor Prod

unread,
Jun 26, 2019, 5:16:01 AM6/26/19
to candy.l...@gmail.com, google-adm...@googlegroups.com
Hi Candy,

Thank you for providing the sharable link privately. I also check the links that you provided and I need to verify this to our Engineering team. I'll raise this information to them and get back to you for any feedback.

Mobile Ads SDK Forum Advisor Prod

unread,
Jun 27, 2019, 1:44:13 AM6/27/19
to candy.l...@gmail.com, google-adm...@googlegroups.com
Hi Candy,

Thank you for giving an effort on documenting the issue. This will help us to narrow down and identify the issue. I already relayed this to our Engineering team. I'll update this thread for any feedback.

Candy Leung

unread,
Jul 1, 2019, 10:11:26 PM7/1/19
to Google Mobile Ads SDK Developers
Hi Teejay,

Does the Engineering team have any idea on the issue?

Mobile Ads SDK Forum Advisor Prod

unread,
Jul 2, 2019, 1:15:45 AM7/2/19
to candy.l...@gmail.com, google-adm...@googlegroups.com
Hi Candy,

I'm afraid the issue is still under investigation. Rest assured that the team is actively working on this. I'll update this thread for any feedback available.

Candy Leung

unread,
Jul 10, 2019, 10:34:49 PM7/10/19
to Google Mobile Ads SDK Developers
Hi Teejay,

Do the sample project and Charles logs help investigate the issue?

Mobile Ads SDK Forum Advisor Prod

unread,
Jul 11, 2019, 2:01:20 AM7/11/19
to candy.l...@gmail.com, google-adm...@googlegroups.com
Hi Candy,

The sample project and Charles logs was very helpful. With regard to the investigation, I'm afraid there still no update on this. I'll make a follow up to our Engineering team and get back to you once they provide their feedback.

Candy Leung

unread,
Jul 21, 2019, 10:33:01 PM7/21/19
to Google Mobile Ads SDK Developers
Hi, any updates?

Mobile Ads SDK Forum Advisor Prod

unread,
Jul 22, 2019, 1:24:25 AM7/22/19
to candy.l...@gmail.com, google-adm...@googlegroups.com

Hi Candy,

This is Mark, Teejay's colleague. I have already sent a follow up to our Engineering Team. We'll let you know once we receive any response from them.

Regards,
Mark Albios
Mobile Ads SDK Team



ref:_00D1U1174p._5001UBo7iF:ref

Candy Leung

unread,
Jul 29, 2019, 3:58:46 AM7/29/19
to Google Mobile Ads SDK Developers
Hi, any updates on the progress?

Mobile Ads SDK Forum Advisor Prod

unread,
Jul 29, 2019, 6:21:25 AM7/29/19
to candy.l...@gmail.com, google-adm...@googlegroups.com
Hi Candy,

Could you add 'gad_preferred_webview' key with value 'wkwebview' in to your Info.plist and let us know if you still encounter the issue?

Regards,
Teejay Pimentel

Nadir Alaoui

unread,
Dec 9, 2019, 5:14:00 PM12/9/19
to Google Mobile Ads SDK Developers
Hi, our team was also encountering this exact issue whenever a video ad was being served. The user didn't have to interact with or even see the ad for the behavior to occur, they just had to load a video ad.

I tried setting the preferred webview key to wkwebview, and that did work, however I now get an error message in the console, approximately 3 times a second. Here's the message:

2019-12-09 17:07:47.769350-0500 news[44198:7865091] [Process] kill() returned unexpected error 1


After removing the key and rebuilding the app, the log message no longer occurs. So this workaround does seem to solve the issue, but is not adequate, because:
1. It seems to occur forever, leading me to fear that it may cause an app crash
2. It makes debugger output useless without turning off potentially important logging info.

Using Xcode 11.2.1, the device used to test is on iOS 13.2.3. Please let me know if there are any updates on this issue.

Mobile Ads SDK Forum Advisor Prod

unread,
Dec 9, 2019, 10:34:28 PM12/9/19
to nal...@npr.org, google-adm...@googlegroups.com
Hi there,

Thank you for the detailed write up of the issue.

As per checking with other publishers, they've confirmed that the issue has been fixed on their end by enabling WKWebview. Is the behavior you've mentioned locally reproducible on your end? If so, could you please provide a project (or at least a test project) and its steps to trigger the behavior? Once provided, I'll discuss this to the rest of the team to get a better insight regarding this.
Reply all
Reply to author
Forward
0 new messages