gpt4 book ai didi

iphone - 经过苹果的批准,iAd不会在iPhone中加载,但会在iPad中加载

转载 作者:行者123 更新时间:2023-12-01 19:20:22 25 4
gpt4 key购买 nike

我已经开发了一个最近获得苹果批准的应用程序。但是问题是iAd无法在iphone中显示,而ipad却无法完美显示iAd。在开发时,iAd已在iPhone和iPad上加载并与测试广告一起使用。但是在获得苹果公司的批准后,我从商店下载了应用程序,发现iAd并未加载到iphone中,而是加载到了ipad中。我已经在iphone的其他应用程序中检查了iphone的其他应用程序,但iAd可以正常工作,但是在我的应用程序中,iAd没有加载。所以,现在我应该怎么做才能在iphone中加载iAd。

我在应用程序中使用的代码是

-(void)showiAdInView
{
if (!appDelegate.isUpgraded) {
bannerView = [[ADBannerView alloc] init];
bannerView.delegate = self;
bannerView.backgroundColor = [UIColor colorWithWhite:1.0f alpha:0.005f];
bannerView.hidden = TRUE;
bannerIsVisible = FALSE;
[self.view addSubview:bannerView];
}
}
-(void)bannerViewDidLoadAd:(ADBannerView *)banner
{
bannerIsVisible = YES;
bannerView.hidden = FALSE;
NSLog(@"ADBanner is Showing");
[self bannerViewShow];
}
-(void)bannerView:(ADBannerView *)banner didFailToReceiveAdWithError:(NSError *)error
{
bannerIsVisible = FALSE;
bannerView.hidden = TRUE;
NSLog(@"ADBanner is Hidding");
NSLog(@"%@",[error description]);
[self bannerViewHide];
}

-(BOOL)bannerViewActionShouldBegin:(ADBannerView *)banner willLeaveApplication: (BOOL)willLeave
{
if ([self.captureSession isRunning]) {
[self.captureSession stopRunning];
iAdLoaded = TRUE;
}
return YES;
}
-(void)bannerViewActionDidFinish:(ADBannerView *)banner
{
UIInterfaceOrientation interfaceOrientation = [[UIApplication sharedApplication] statusBarOrientation];
[self willRotateToInterfaceOrientation:interfaceOrientation duration:0.2f];
if (![self.captureSession isRunning] && iAdLoaded) {
[self.captureSession startRunning];
iAdLoaded = FALSE;
}
}
-(void)bannerViewShow
{
[bannerView setBackgroundColor:[UIColor colorWithWhite:1.0f alpha:0.005f]];
UIInterfaceOrientation interfaceOrientation = [[UIApplication sharedApplication] statusBarOrientation];
if ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPhone)
{
if (UIInterfaceOrientationIsPortrait(interfaceOrientation)) {
[UIView beginAnimations:nil context:nil];
[UIView setAnimationDelegate:self];
[UIView setAnimationDuration:0.5];
[MsgtextView setFrame:MsgTextVwAdBannerFrame];
[UIView commitAnimations];
adBannerFrame = CGRectMake(0, 190, 320, 50);
clearButton.frame = CGRectMake(ClearButtonFramePotrait.origin.x, ClearButtonFramePotrait.origin.y, ClearButtonFramePotrait.size.width, ClearButtonFramePotrait.size.height);
[self.view bringSubviewToFront:bannerView];
[bannerView setFrame:adBannerFrame];
[bannerView setCurrentContentSizeIdentifier:ADBannerContentSizeIdentifierPortrait];

}
else if (UIInterfaceOrientationIsLandscape(interfaceOrientation)) {
[UIView beginAnimations:nil context:nil];
[UIView setAnimationDelegate:self];
[UIView setAnimationDuration:0.5];
[MsgtextView setFrame:CGRectMake(MsgTextVwAdBannerFrame.origin.x, MsgTextVwAdBannerFrame.origin.y, MsgTextVwAdBannerFrame.size.width, MsgTextVwAdBannerFrame.size.height+8)];
[UIView commitAnimations];
adBannerFrame = CGRectMake(0, 105, 470, 32);
clearButton.frame = CGRectMake(ClearButtonFrameLandscape.origin.x, ClearButtonFrameLandscape.origin.y, ClearButtonFrameLandscape.size.width, ClearButtonFrameLandscape.size.height);
[bannerView setCurrentContentSizeIdentifier:ADBannerContentSizeIdentifierLandscape];
[self.view bringSubviewToFront:bannerView];
[bannerView setFrame:adBannerFrame];

}
}
else if ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPad) {
if (UIInterfaceOrientationIsPortrait(interfaceOrientation)) {
[UIView beginAnimations:nil context:nil];
[UIView setAnimationDelegate:self];
[UIView setAnimationDuration:0.5];
[MsgtextView setFrame:MsgTextVwAdBannerFrame];
[UIView commitAnimations];
adBannerFrame = CGRectMake(0, 640, 768, 50);
[bannerView setCurrentContentSizeIdentifier:ADBannerContentSizeIdentifierPortrait];
clearButton.frame = CGRectMake(ClearButtonFrame_iPadPotrait.origin.x, ClearButtonFrame_iPadPotrait.origin.y, ClearButtonFrame_iPadPotrait.size.width, ClearButtonFrame_iPadPotrait.size.height);
[self.view bringSubviewToFront:bannerView];
[bannerView setFrame:adBannerFrame];
}
else if (UIInterfaceOrientationIsLandscape(interfaceOrientation)) {
[UIView beginAnimations:nil context:nil];
[UIView setAnimationDelegate:self];
[UIView setAnimationDuration:0.5];
[MsgtextView setFrame:CGRectMake(MsgTextVwAdBannerFrame.origin.x, MsgTextVwAdBannerFrame.origin.y, MsgTextVwAdBannerFrame.size.width, MsgTextVwAdBannerFrame.size.height+8)];
[UIView commitAnimations];
adBannerFrame = CGRectMake(0, 325, 1024, 32);
[bannerView setCurrentContentSizeIdentifier:ADBannerContentSizeIdentifierLandscape];
clearButton.frame = CGRectMake(ClearButtonFrame_iPadPotrait.origin.x, ClearButtonFrame_iPadPotrait.origin.y, ClearButtonFrame_iPadPotrait.size.width, ClearButtonFrame_iPadPotrait.size.height);
[self.view bringSubviewToFront:bannerView];
[bannerView setFrame:adBannerFrame];
}
}
}
-(void)bannerViewHide
{
[bannerView setBackgroundColor:[UIColor clearColor]];
UIInterfaceOrientation interfaceOrientation = [[UIApplication sharedApplication] statusBarOrientation];
if ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPhone)
{
if (UIInterfaceOrientationIsPortrait(interfaceOrientation)) {
[UIView beginAnimations:nil context:nil];
[UIView setAnimationDelegate:self];
[UIView setAnimationDuration:0.5];
[MsgtextView setFrame:MsgTextVwFrame];
clearButton.frame = ClearButtonFramePotrait;
[bannerView setHidden:YES];
[UIView commitAnimations];
}
else if (UIInterfaceOrientationIsLandscape(interfaceOrientation)) {
[UIView beginAnimations:nil context:nil];
[UIView setAnimationDelegate:self];
[UIView setAnimationDuration:0.5];
[MsgtextView setFrame:MsgTextVwFrame];
clearButton.frame = ClearButtonFrameLandscape;
[bannerView setHidden:YES];
[UIView commitAnimations];
}
}
else if ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPad) {
if (UIInterfaceOrientationIsPortrait(interfaceOrientation)) {
[UIView beginAnimations:nil context:nil];
[UIView setAnimationDelegate:self];
[UIView setAnimationDuration:0.5];
[MsgtextView setFrame:MsgTextVwFrame];
clearButton.frame = ClearButtonFrame_iPadPotrait;
[bannerView setHidden:YES];
[UIView commitAnimations];
}
else if (UIInterfaceOrientationIsLandscape(interfaceOrientation)) {
[UIView beginAnimations:nil context:nil];
[UIView setAnimationDelegate:self];
[UIView setAnimationDuration:0.5];
[MsgtextView setFrame:MsgTextVwFrame];
clearButton.frame = ClearButtonFrame_iPadPotrait;
[bannerView setHidden:YES];
[UIView commitAnimations];
}
}
}

最佳答案

总体而言,iAd的填充率很低。广告网络(包括iAd)向您发送的广告越多,点击率就越高;也就是说,点击您应用中广告的用户比例:您在应用中展示的广告。如果您确定测试广告能够正常工作并且刚刚发布了该应用程序,那么苹果很可能只需要花一点时间就可以在iPhone版本上向您发送广告文件。给它几天,看看进展如何。

或者,我注意到您的“isUpgraded”代码,是否有可能,在您正在测试的iPhone上,您购买了升级并忘记了,现在不再返回广告了?

关于iphone - 经过苹果的批准,iAd不会在iPhone中加载,但会在iPad中加载,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10647919/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com