Skip to content

Instantly share code, notes, and snippets.

-(void) registerAdmob
{
NSLog(@"-> registerAdmob initializing Admob start");
UnityViewController* controller = (UnityViewController*)UnityGetGLViewController();
EAGLView* view = (EAGLView*)[controller view];
NSLog(@"EAGLView frame size:(%f, %f)", view.frame.size.width, view.frame.size.height);
CGFloat scaleSize = [UIScreen mainScreen].scale;
NSLog(@"UIScreen scale:%f", scaleSize);
CGFloat screenWidth = view.frame.size.height * scaleSize;
CGFloat bannerWidth = GAD_SIZE_320x50.width;