TapJoy実装(iOS)

TapJoyの組み込み(iOS)


基本的に、下記のページの流れで問題なし。

>iPhoneアプリにTapjoyのリワード広告を導入する方法
http://trackback.blogsys.jp/livedoor/abars/51950019


getTapPoints したらすぐ、spendTapPointsしたいとき、

下記の2つは別のスレッドから呼び出す。
[TapjoyConnect getTapPoints];
[TapjoyConnect spendTapPoints];


Spendの方のNotificationCenterは、

[TapjoyConnect spendTapPoints];
[[NSNotificationCenter defaultCenter] addObserver:self
                                             selector:@selector(getSpendPointsResponse:)
                                                 name:TJC_SPEND_TAP_POINTS_RESPONSE_NOTIFICATION
                                               object:nil];


呼び出されるのは、

-(void)getSpendPointsResponse:(NSNotification*)notifyObj{
// ここで、TapPoints使いましたよーとかアラート出したり、出さなかったり。
}

AdMobの実装(iOS)

AdMobは

No Ad to show.

のエラーがでてさえいれば、実装は間違ってない。

管理ツールで、
自社広告を表示回数指定して、テストモードオンにして、
他の広告枠でテストして、また元の広告枠に戻ったら表示された(なぜか自社広告は表示されない。)
ので、根本的なところは、AdMob側のバグ(仕様)としか思えない。


コードは、公式ドキュメントまんまでOK.
テストモードは、
rq.testDevices
これを忘れないこと。

 // Create a view of the standard size at the bottom of the screen.
    bannerView_ = [[GADBannerView alloc]
                   initWithFrame:CGRectMake(0.0,
                                            self.view.frame.size.height-GAD_SIZE_320x50.height,
                                            GAD_SIZE_320x50.width,
                                            GAD_SIZE_320x50.height)];
    
    // Specify the ad's "unit identifier." This is your AdMob Publisher ID.
    bannerView_.adUnitID = @"a14e8887aa497ff";
    bannerView_.delegate = self;
   // bannerView_.backgroundColor = [UIColor blackColor];
    // Let the runtime know which UIViewController to restore after taking
    // the user wherever the ad goes and add it to the view hierarchy.
    bannerView_.rootViewController = self;
	

	 GADRequest *rq = [GADRequest request];
	 
    rq.testDevices = [NSArray arrayWithObjects: GAD_SIMULATOR_ID,[[UIDevice currentDevice] uniqueIdentifier], nil];
  
    [bannerView_ loadRequest:rq];

エラーは下記でとる。bannerView_.delegate = self;がもちろん必要。

- (void)adView:(GADBannerView *)view
didFailToReceiveAdWithError:(GADRequestError *)error{
 NSLog(@"error %@",error);

}