2016-10-03 41 views
0
  • 我已將Kiip廣告整合到我的應用中。
  • 當用戶在應用中完成任務時,Kiip ad成功顯示 。
  • 但是,Kiip廣告僅在首次調用廣告時展示。
  • 當用戶完成第二項任務時,沒有廣告顯示,但加載了廣告 。

這個有趣的部分是,廣告肯定是加載。
我的應用程序是基於storyboard的,我使用了橫向模式(屏幕翻轉顯示另一個視圖控制器)。
當用戶點擊一個按鈕以模式化到不同的屏幕時,您可以看到在視圖翻轉時加載的kiip廣告(通常當屏幕翻轉時背景僅爲黑色,但當有第二個吉卜利時廣告被調用)。Kiip廣告加載但不顯示

第二個廣告在哪裏被加載?
如何製作廣告加載,以便用戶可以看到第二個廣告,第三個廣告等?

編輯:潛水進一步調查此之後,Kiip廣告加載多次就好IF我不模態和模態回到原來的視圖控制器。
例如,如果我顯示的是kiip廣告,模式爲不同的屏幕,然後返回模式,並嘗試顯示另一個kiip廣告,則廣告會顯示(但仍會加載)。

// Show Kiip Reward and reset task 
-(IBAction)resetTasks:(id)sender{ 

    [[Kiip sharedInstance] saveMoment:@"my_moment_id" withCompletionHandler:^(KPPoptart *poptart, NSError *error) { 
     if (error) { 
      NSLog(@"something's wrong"); 
      // handle with an Alert dialog. 
     } 
     if (poptart) { 
      [poptart show]; 
     } 
     if (!poptart) { 
      // handle logic when there is no reward to give. 
     } 
    }]; 

    //hide the button that allows shows user kiip ad for their accomplishment 
    resetButton.hidden = YES; 

    //reset other game logic after 4 seconds so there is time for the ad to load 
    [self performSelector:@selector(resetGame) withObject:nil afterDelay:4]; 
} 



- (void) kiip:(Kiip *)kiip didReceiveContent:(NSString *)contentId quantity:(int)quantity transactionId:(NSString *)transactionId signature:(NSString *)signature { 
    // Give the currency to the user by using your in-app currency management. 
    totalCoins = totalCoins + quantity; 
    [[NSUserDefaults standardUserDefaults] setInteger:totalCoins forKey:@"totalCoins"]; 
} 

回答

0

於是我找到了一種方法來解決這個問題,如果你使用情態動詞很多故事板和kiip廣告將不會加載。

我將此代碼添加到viewDidLoad,現在kiip廣告不止一次顯示。

-(void) viewDidLoad { 
Kiip *kiip = [[Kiip alloc] initWithAppKey:@"YOUR KEY" andSecret:@"YOUR SECRET"]; 
    kiip.delegate = self; 
    [Kiip setSharedInstance:kiip]; 
} 
相關問題