喜 我曾在简单的应用程序中工作,我实现了iad功能,但我不知道如何激活iad功能到iphone应用程序 请参阅代码片段以激活iad网络及其功能。 提前谢谢
答案 0 :(得分:1)
您必须加入iOS开发者计划才能加入iAd网络。成员需要执行以下操作:
* Agree to the Developer Advertising Services Agreement in iTunes Connect.
* Set up your banking and tax information if you don’t have a paid app on the App Store.
* Enable your app for iAd ads in the Manage Your Applications module within iTunes Connect.
* Set up your iAd preferences in the iAd Network module within iTunes Connect.
答案 1 :(得分:0)
您需要导入iAD Framework并在iTunes Connect上为您的应用启用它。
然后尝试以下......
iAdBanner = [[ADBannerView alloc] initWithFrame:CGRectMake(0.0, 245.0, 768.0, 66.0)];
if(&ADBannerContentSizeIdentifierPortrait != nil)
portrait = ADBannerContentSizeIdentifierPortrait;
else
portrait = ADBannerContentSizeIdentifier320x50;
if(&ADBannerContentSizeIdentifierLandscape != nil)
landscape = ADBannerContentSizeIdentifierLandscape;
else
landscape = ADBannerContentSizeIdentifier480x32;
iAdBanner.requiredContentSizeIdentifiers = [NSSet setWithObjects:landscape, nil];
iAdBanner.autoresizesSubviews = YES;
iAdBanner.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleBottomMargin;
iAdBanner.delegate = self;
[self.view addSubview:iAdBanner];
iAdBanner.hidden = NO;