iOS Ads SDK Using Questions

178 views
Skip to first unread message

程双双

unread,
Jun 18, 2021, 8:27:07 AM6/18/21
to Google Mobile Ads SDK Developers
Hello,
Our Google Mobile Ads SDK version is 8.5.0, When we used GADBannerView to loadRequest ads, our App page didn't respond.The type of ads we loaded were pure video types.
The following is the page lag information we captured:

{

  "content" : "Backtrace of Thread 771:\nlibsystem_kernel.dylib          0x1d977e404 kevent_id + 8\nlibdispatch.dylib               0x10506dee0 _dispatch_kq_poll + 228\nlibdispatch.dylib               0x10506e988 _dispatch_event_loop_wait_for_ownership + 436\nlibdispatch.dylib               0x10505ca74 __DISPATCH_WAIT_FOR_QUEUE__ + 308\nlibdispatch.dylib               0x10505c4c0 _dispatch_sync_f_slow + 176\nAVFCore                         0x1b4e3e638 <redacted> + 80\nAVFCore                         0x1b4e3ecc4 <redacted> + 564\nAVFCore                         0x1b4eb80c0 <redacted> + 428\nAVFCore                         0x1b4e3e838 <redacted> + 324\nAVFCore                         0x1b4e431ac <redacted> + 200\nStory ones                      0x102dd8210 GAD_GADVideoPlayer_arm64_8_5_0 + 2080\nStory ones                      0x102e90adc GADPostNotification + 4144\nFoundation                      0x1aead84d8 <redacted> + 316\nCoreFoundation                  0x1ad880370 <redacted> + 20\nCoreFoundation                  0x1ad880330 <redacted> + 48\nCoreFoundation                  0x1ad87f928 <redacted> + 400\nCoreFoundation                  0x1ad87f320 _CFXNotificationPost + 696\nFoundation                      0x1aeab50a0 <redacted> + 60\nStory ones                      0x102e904d4 GADPostNotification + 2600\nStory ones                      0x102e8fb28 GADPostNotification + 124\nStory ones                      0x102e5f358 __destroy_helper_block_e8_32s40s48r56w + 2428\nStory ones                      0x102e5ec50 __destroy_helper_block_e8_32s40s48r56w + 628\nStory ones                      0x102e90adc GADPostNotification + 4144\nFoundation                      0x1aead84d8 <redacted> + 316\nCoreFoundation                  0x1ad880370 <redacted> + 20\nCoreFoundation                  0x1ad880330 <redacted> + 48\nCoreFoundation                  0x1ad87f928 <redacted> + 400\nCoreFoundation                  0x1ad87f320 _CFXNotificationPost + 696\nFoundation                      0x1aeab50a0 <redacted> + 60\nStory ones                      0x102e904d4 GADPostNotification + 2600\nStory ones                      0x102e8fb28 GADPostNotification + 124\nStory ones                      0x102e5de7c GAD_GADView_arm64_8_5_0 + 476\nUIKitCore                       0x1b0687c70 <redacted> + 2016\nUIKitCore                       0x1b067bb78 <redacted> + 136\nCoreAutoLayout                  0x1c1f09934 <redacted> + 80\nUIKitCore                       0x1b067ba80 <redacted> + 776\nUIKitCore                       0x1b068a0d8 <redacted> + 2132\nStory ones                      0x102e86ed4 GAD_GADInternalBannerView_arm64_8_5_0 + 8032\nStory ones                      0x102e865a4 GAD_GADInternalBannerView_arm64_8_5_0 + 5680\nStory ones                      0x102e86c68 GAD_GADInternalBannerView_arm64_8_5_0 + 7412\nlibdispatch.dylib               0x10504bce4 _dispatch_call_block_and_release + 24\nlibdispatch.dylib               0x10504d528 _dispatch_client_callout + 16\nlibdispatch.dylib               0x10505b994 _dispatch_main_queue_callback_4CF + 972\nCoreFoundation                  0x1ad89d5e0 <redacted> + 12\nCoreFoundation                  0x1ad897a88 <redacted> + 2480\nCoreFoundation                  0x1ad896ba0 CFRunLoopRunSpecific + 572\nGraphicsServices                0x1c45d4598 GSEventRunModal + 160\nUIKitCore                       0x1b01863d8 <redacted> + 1052\nUIKitCore                       0x1b018b958 UIApplicationMain + 164\nStory ones                      0x102089424 main + 140\n\n",

  "duration" : "5264",

  "title" : "2021-06-18 18:58:11.233"

}

The current situation is that we have entered the page with banner ads, and the APP cannot be used normally on all iOS devices. But when we only load image type ads, we can use the App normally. I hope you can help us to guide the reason for this phenomenon. Is it related to the loading of video-type ads? Thank you very much!

Best wishes!

Cheng ShuangShuang

Mobile Ads SDK Forum Advisor

unread,
Jun 21, 2021, 12:06:21 AM6/21/21
to csss...@sina.com, google-adm...@googlegroups.com

Hi Cheng,

Thank you for reaching out to us.

Could you please provide the following details via Reply privately to author option or send it directly to mobileads...@gmail.com? Kindly inform us on this thread if you sent it directly to the email provided.

  • Sample app(if any)
  • Steps to replicate the app page didn't respond

Regards,

Google Logo
Princess Pamela Pineda
Mobile Ads SDK Team
 


ref:_00D1U1174p._5004Q2Iwnoe:ref

Shuang

unread,
Jun 23, 2021, 2:14:39 AM6/23/21
to Google Mobile Ads SDK Developers
Hello,
Thank you for your help and guidance!
We tried to load video Ads with Google ADS Demo, which can load normally. However, when loading video Ads in our own project, we kept dealing with the deadlocked state, but the App did not respond. Is there any way to locate the reason why the main thread was blocked? Thank you very much!
Best regards!

Mobile Ads SDK Forum Advisor

unread,
Jun 23, 2021, 6:32:44 AM6/23/21
to csss...@sina.com, google-adm...@googlegroups.com
Hi there,

Thank you for getting back to us. 

With regard to your concern, we always recommend our publishers to try our sample app, and see if the reported behavior occurs. To check the thread stalling/block, you could use StrictMode to detect expensive calls that are being done on the Thread.

Regards,
Google Logo
Teejay Wennie Pimentel
Mobile Ads SDK Team
 


ref:_00D1U1174p._5004Q2Iwnoe:ref

Shuang

unread,
Jun 24, 2021, 3:32:48 AM6/24/21
to Google Mobile Ads SDK Developers
Hello,
Thank you for your help.
After comparing and analyzing with the Demo, we found that our code conflicted with the Google advertisement. Here is our code fragment:

+ (void)load

{

    // UIApplicationDidFinishLaunchingNotification

    [NSNotificationCenter.defaultCenter addObserver:self selector:@selector(appFinishLaunchingNoti:) name:UIApplicationDidFinishLaunchingNotification object:nil];

    

    // Customer Notification

    id<AccountServiceProtocol> provider = [ModuleServiceCenter.shareCenter getProviderByService:@protocol(AccountServiceProtocol)];

    [NSNotificationCenter.defaultCenter addObserverForName:provider.userStatusRefresh object:nil queue:[NSOperationQueue mainQueue] usingBlock:^(NSNotification *note) {

        // when receive the userStatusRefresh notification, need to update user information

        [self updateUser];

    }];

}

So, We registered a custom notification with MainQueue in +load(). When we delete the custom notification or put this code in appFinishLaunchingNoti:() , Our Google Ads is normally loaded. We want to know if Google Ads loading, is there a thread queue conflict with the custom notification in MainQueue?Thank you very much!

Yours Sincerely,

Cheng


Mobile Ads SDK Forum Advisor

unread,
Jun 24, 2021, 5:58:06 AM6/24/21
to csss...@sina.com, google-adm...@googlegroups.com

Hi Shuang,

Thank you for your response.

Would it be possible for you to provide a sample app showing the behavior? Once provided, I can raise this to the rest of the team for further investigation and to get their context as well. You can send it via Reply privately to author option or send it directly to mobileads...@gmail.com? Kindly inform us on this thread if you sent it directly to the email provided.

Regards,

Google Logo
Princess Pamela Pineda
Mobile Ads SDK Team
 


ref:_00D1U1174p._5004Q2Iwnoe:ref

Shuang

unread,
Jun 24, 2021, 8:24:58 AM6/24/21
to Google Mobile Ads SDK Developers
Hello,
Thanks for your help, I found the reason why Google ads isn't loading normally.
Here is our code fragment:

+ (void)load

{

    [NSNotificationCenter.defaultCenter addObserver:self selector:@selector(appFinishLaunchingNoti:) name:UIApplicationDidFinishLaunchingNotification object:nil];

    

    id<TestServiceProtocol> provider = [ModuleServiceCenter.shareCenter getProviderByService:@protocol(TestServiceProtocol)];

    NSString *noti = provider.customerNotification;

    // noti isn't nil is normally loading ads

    noti = @"Noti";

    // but setting noti is nil will unnormally loading ads

    noti = nil;

    [NSNotificationCenter.defaultCenter addObserverForName:noti object:nil queue:[NSOperationQueue mainQueue] usingBlock:^(NSNotification * _Nonnull note) {

        [self updateInformation];

    }];

}

I added a notification that get name is nil, so when anywhere post a nitification, the method will be run in mainQueue. When user open the app or open a UIViewController, the method also will be run, the app will be no response.

If you register a notification with no name in the main queue thread, it may be executed at any time during the process of using the App, but why will it affect the loading of the advertisement with video type?The picture type ads can be loading normally. Thank you very much!

Best wishes!
Cheng

Mobile Ads SDK Forum Advisor

unread,
Jun 24, 2021, 11:24:09 AM6/24/21
to csss...@sina.com, google-adm...@googlegroups.com
Hi Shuang,

I work with Pamela and will assist you. For us to investigate further, could you reproduce this behavior reliably in one of our sample apps with minimum  modification to present your use case and send the project privately to us? Alternatively, you may send this to our testing alias mobileads...@gmail.com with a post on this thread once you have done so.

Regards,

Google Logo
Aryeh Baker
Mobile Ads SDK Team
 


ref:_00D1U1174p._5004Q2Iwnoe:ref

Shuang

unread,
Jun 24, 2021, 11:27:39 PM6/24/21
to Google Mobile Ads SDK Developers
Hello,
I have sent an email entitled "Google Mobile Ads IOS Question" to this email account, please check it. The repeating steps have been explained. Thank you very much for your help and guidance.

Replication steps:
1. Create an AD unit ID that contains only the video type, instead of using a test unit ID, to ensure that the video type ads can be loaded properly
2. Run Demo, and you can see that the console will have relevant printing
3. When you operate the screen of the phone, the APP will get stuck and no response will occur

Preliminary judgment is registered in the home side column threads a notification name is nil notification, will lead to receive any form of notification of all sorts of types, so the console will have corresponding print, but don't know why will affect the type of video advertisement of load, load types of advertising picture is not affected, thanks for your help and guidance, thank you very much!

Best wishes!
Cheng

Mobile Ads SDK Forum Advisor

unread,
Jun 25, 2021, 5:20:49 AM6/25/21
to csss...@gmail.com, google-adm...@googlegroups.com

Hi Shuang,

Thank you for getting back to us.

I’ve checked our banner sample app, and it doesn't have the code snippet that you provided here which causes conflict to your code. With this, could you please point it out to us on our sample app, so we could proceed with our investigation?

Regards,

Google Logo
Princess Pamela Pineda
Mobile Ads SDK Team
 


ref:_00D1U1174p._5004Q2Iwnoe:ref

Shuang

unread,
Jun 25, 2021, 6:20:15 AM6/25/21
to Google Mobile Ads SDK Developers
Hello,
I have sent an email entitled "Google Mobile Ads IOS Question" to this email account mobileads...@gmail.com, please check it. The repeating steps have been explained. Thank you very much for your help and guidance.
Best Regards,
Shuang

Mobile Ads SDK Forum Advisor

unread,
Jun 25, 2021, 2:02:53 PM6/25/21
to csss...@gmail.com, google-adm...@googlegroups.com
Hi Shaung,

Thank you for responding back to us. In looking over the case the issue that we are seeing is that your code does not match up with what we have shown in the sample that my teammate sent out to you previously. Which could be a possible cause of the issue. We would suggest to start by looking at the same and seeing if this issue keeps happening with minimal modifications done to it.

Regards,
Google Logo
William Pescherine
Mobile Ads SDK Team
 


ref:_00D1U1174p._5004Q2Iwnoe:ref

Shuang

unread,
Jun 27, 2021, 10:29:37 PM6/27/21
to Google Mobile Ads SDK Developers
OK,Thank you so much!
Best wishes!
Shuang

Reply all
Reply to author
Forward
0 new messages