I just tried it out, and it worked without an SPOverlayView for me.
I used the Scaffold project and the latest Sparrow head revision:
- I added the MoPubSDK to the Scaffold project, and did all that set-up stuff that's explained on the MoPubSDK (adding about a million frameworks along the way *g*).
- Then I created a new class called "ViewController" that extends "SPViewController":
// ######## ViewController.h ########
#import <Sparrow/Sparrow.h>
#import "MPAdView.h"
@interface ViewController : SPViewController<MPAdViewDelegate>
@property (nonatomic, retain) MPAdView *adView;
@end
// ######## ViewController.m ########
#import "ViewController.h"
@implementation ViewController
- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
{
self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
if (self)
{
// Custom initialization
}
return self;
}
- (void)viewDidLoad
{
self.adView = [[MPAdView alloc] initWithAdUnitId:@"3a5d847b861b49cb8c7e27a8da2a88fb"
size:MOPUB_BANNER_SIZE];
self.adView.delegate = self;
CGRect frame = self.adView.frame;
CGSize size = [self.adView adContentViewSize];
frame.origin.y = [[UIScreen mainScreen] applicationFrame].size.height - size.height;
self.adView.frame = frame;
[self.view addSubview:self.adView];
[self.adView loadAd];
[super viewDidLoad];
}
#pragma mark - <MPAdViewDelegate>
- (UIViewController *)viewControllerForPresentingModalView
{
return self;
}
@end
This controller has to be used from "AppDelegate.m" instead of using "SPViewController" directly:
// AppDelegate.m
@implementation AppDelegate
{
ViewController *_viewController;
UIWindow *_window;
}
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
NSSetUncaughtExceptionHandler(&onUncaughtException);
CGRect screenBounds = [UIScreen mainScreen].bounds;
_window = [[UIWindow alloc] initWithFrame:screenBounds];
_viewController = [[ViewController alloc] init];
// Enable some common settings here:
//
// _viewController.showStats = YES;
// _viewController.multitouchEnabled = YES;
// _viewController.preferredFramesPerSecond = 60;
[_viewController startWithRoot:[Game class] supportHighResolutions:YES doubleOnPad:YES];
[_window setRootViewController:_viewController];
[_window makeKeyAndVisible];
return YES;
}
@end
After that, everything seemed to be working fine! There was an ad displayed and I could click on it. Furthermore, I could still click on the animated Sparrow and hear the sound. So clicks on the Sparrow content were still working.
Let me know if that helps!