2016-05-05 12 views
0

In meiner Anwendung verwende ich Anzeigen für tvOS. Ich habe versucht, das AppLovin SDK für die Anzeigenimplementierung zu verwenden, es wird jedoch eine Vollbildanzeige geschaltet.Wie Banneranzeigen in tvOS integrieren?

Ich möchte eine Banneransicht wie Scrolldatenaktualisierung in meiner tvOS App anzeigen. Kann ich dies mit iAd oder AdMob auf tVOS erreichen?

Ich verwende

ALSdk.shared()!.adService.loadNextAd(ALAdSize.sizeInterstitial(), andNotify: self) 

Anzeigen zu laden.

Dann, sobald eine Anzeige zur Verfügung Ich zeige die Anzeige mit:

ALInterstitialAd.shared().adDisplayDelegate = self 
ALInterstitialAd.shared().adVideoPlaybackDelegate = self 

if let ad = self.ad 
{    
    ALInterstitialAd.shared().showOver(UIApplication.sharedApplication().keyWindow!, andRender: ad) 
} 
+0

geklickt Sie sollten Code bereitstellen und anderen Hilfen – TommyBs

Antwort

0

iAd nicht tvOS und is being discontinued nicht unterstützt, wird von AdMob nicht tvOS unterstützt auch und AppLovin unterstützt nur Vollbild auf Interstitial-Anzeigen TVOS. Ab sofort sind Werbebanner auf tvOS nicht möglich. Ich würde nicht erwarten, dass sie in absehbarer Zeit verfügbar sein werden, da Werbebanner auf einem Fernsehgerät keinen Sinn ergeben würden.

1

Wie Daniel Storm sagte, machen Werbebanner auf einem Fernseher keinen Sinn. Aber wenn Sie darauf bestehen, können Sie Ihre eigenen Banner natively erstellen.

Zum Beispiel in Ihrem View-Controller:

@interface ALDemoNativeAdProgrammaticViewController()<ALNativeAdLoadDelegate, ALNativeAdPrecacheDelegate, ALPostbackDelegate> 
@property (nonatomic, strong) ALNativeAd *nativeAd; 
@end 

- (void)viewDidLoad 
{ 
    [super viewDidLoad]; 
    [[ALSdk shared].nativeAdService loadNativeAdGroupOfCount: 1 andNotify: self]; 
} 

#pragma mark - Native Ad Load Delegate 

- (void)nativeAdService:(nonnull ALNativeAdService *)service didLoadAds:(nonnull NSArray *)ads 
{ 
    // At this point, the native ad is loaded, but assets not retrieved yet. 
    self.nativeAd = [ads firstObject]; 

    // You can use AppLovin's pre-caching to retrieve assets (app icon, ad image, ad video) locally. OR you can do it with your preferred caching framework. 
    // iconURL, imageURL, videoURL needs to be retrieved manually before you can render them. For our example, we'll use AppLovin's caching framework. 
    [[ALSdk shared].nativeAdService precacheResourcesForNativeAd: self.nativeAd andNotify: self]; 
} 

- (void)nativeAdService:(nonnull ALNativeAdService *)service didFailToLoadAdsWithError:(NSInteger)code 
{ 
    // Handle error 
} 

#pragma mark - Native Ad Precache Delegate 

- (void)nativeAdService:(nonnull ALNativeAdService *)service didPrecacheImagesForAd:(nonnull ALNativeAd *)ad { } 

- (void)nativeAdService:(nonnull ALNativeAdService *)service didPrecacheVideoForAd:(nonnull ALNativeAd *)ad 
{ 
    // This delegate method will get called whether an ad actually has a video to precache or not 
    // 
    // FINALLY, perform whatever view logic you want with the assets provided in your ALNativeAd property, and show the ad. 
} 

- (void)nativeAdService:(nonnull ALNativeAdService *)service didFailToPrecacheImagesForAd:(nonnull ALNativeAd *)ad withError:(NSInteger)errorCode 
{ 
    // Handle error 
} 

- (void)nativeAdService:(nonnull ALNativeAdService *)service didFailToPrecacheVideoForAd:(nonnull ALNativeAd *)ad withError:(NSInteger)errorCode 
{ 
    // Handle error 
} 

Beachten Sie, dass AppLovin der Rückrufe werden nicht guanranteed zu auf der Haupt Warteschlange aufgerufen werden.

Es ist auch in Ihrer Verantwortung

Ihre eigene Eindrücke zu verfolgen
[[ALSdk shared].postbackService dispatchPostbackAsync: ad.impressionTrackingURL andNotify: self]; 

und starten Sie den Store App, wenn

[self.nativeAd launchClickTarget]; 
+0

@armatita zu helfen: Ich aktualisiert Meine Antwort entsprechend. –

+0

Danke @ThomasTang, ich werde den Review Kommentar entfernen. – armatita