Im trying to implement Vungle Video Ads in my little game but every time i try to implement it in sprite kit it crashes or is not calling any Videos does someone of you has an answer to this problem? I first tried just to call a method on the ViewController the sprite kit is running on to play the ad not working. then i tried to call another view controller to play the video still not Working:/
it would be great if someone has an answer or at least a hint or just something :)
thanks :)
thats in tgMyScene.m:
-(void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event {
/* Called when a touch begins */
// here im calling the VungleAd method in my viewController
tgViewController* Ad = [[tgViewController alloc] init]; // Create an instance of SomeClass
[Ad VungleAd];
for (UITouch *touch in touches) {
CGPoint location = [touch locationInNode:self];
SKSpriteNode *sprite = [SKSpriteNode spriteNodeWithImageNamed:@"Spaceship"];
sprite.position = location;
SKAction *action = [SKAction rotateByAngle:M_PI duration:1];
[sprite runAction:[SKAction repeatActionForever:action]];
//[self addChild:sprite];
}
}
and thats the method in my tgViewController.m:
-(void) VungleAd {
NSLog(@"vunglead");
//and here im playing the ad
VungleSDK* sdk = [VungleSDK sharedSDK];
[sdk playAd:self];
}
its showing the nslog vunglead in the console but is not playing the ad and some times its crashing. I think it crashes when i have a video in the cache but im not sure.