if (dispatch_get_current_queue() == dispatch_get_main_queue()) {
[self doUIWebKitRelatedThings];
}
else {
dispatch_sync(dispatch_get_main_queue(), ^{
[self doUIWebKitRelatedThings];
});
}
if (dispatch_get_current_queue() == dispatch_get_main_queue()) {
[bannerView loadRequest:request];
}
else {
dispatch_sync(dispatch_get_main_queue(), ^{
[bannerView loadRequest:request];
});
}
--
---
You received this message because you are subscribed to a topic in the Google Groups "Google AdMob Ads Developers" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/google-admob-ads-sdk/lD74dug6HZs/unsubscribe.
To unsubscribe from this group and all its topics, send an email to google-admob-ads...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Thanks for answering Eric. Yes, I could do that. I was asking if it could be done inside the loadRequest method for the a reason though. I've had a few main thread freezes caused generally by the first call to loadRequest. And I know that it is something wrong with loadRequest, because calling it on a background thread would prevent the app from freezing (of course, after a few seconds the app would crash, for trying to use UIWebView on a background thread).
On Mon, Apr 7, 2014 at 8:25 PM, Eric Leichtenschlag wrote:
Maybe I'm misunderstanding you, but if that were possible then couldn't you do this in your own code? E.g.
if (dispatch_get_current_queue() == dispatch_get_main_queue()) {
[bannerView loadRequest:request];
}
else {
dispatch_sync(dispatch_get_main_queue(), ^{
[bannerView loadRequest:request];
});
}
Thanks,
Eric
On Monday, April 7, 2014 1:04:06 PM UTC-7, Pol Mum wrote:Would it be possible to modify the iOS AdMob sdk to be able to call GADBannerView's loadRequest: method on a background thread?I am aware that currently doing this fails because loadRequest uses the UIWebKit class, which has to be used from the main thread. But this could be easily solved by doing something like the following:if (dispatch_get_current_queue() == dispatch_get_main_queue()) {
[self doUIWebKitRelatedThings];
}
else {
dispatch_sync(dispatch_get_main_queue(), ^{
[self doUIWebKitRelatedThings];
});
}
Thanks!
--
---
You received this message because you are subscribed to a topic in the Google Groups "Google AdMob Ads Developers" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/google-admob-ads-sdk/lD74dug6HZs/unsubscribe.
To unsubscribe from this group and all its topics, send an email to google-admob-ads-sdk+unsub...@googlegroups.com.
To unsubscribe from this group and all its topics, send an email to google-admob-ads...@googlegroups.com.