AppLovin integration using delegates in ios 8/swift

584 views Asked by At

I am trying to add the Applovin delegates in my SKScene. And when i add AlAdLoadDelegate as delegate, the xcode shows me this error

Type 'GameScene' does not conform to protocol 'ALAdLoadDelegate'

So i think i have to add a protocol manually. But i don't know how to convert this in swift

@protocol ALAdLoadDelegate <NSObject>
-(void)adService:(ALAdService *)adService didLoadAd:(ALAd *)ad;
-(void)adService:(ALAdService *)adService didFailToLoadAdWithError:(int)code;
@end

This is how I am adding AlAdLoadDelegate in my SKScene...

class GameScene: SKScene, GKGameCenterControllerDelegate,SKPhysicsContactDelegate, ALAdLoadDelegate {

.... My code

}

Can anyone help me in integrating Applovin in ios8 or tell me how can i fix these issues?

1

There are 1 answers

0
Jérémy Marchand On BEST ANSWER

You GameScene does not conform to the protocol since it needs to implement this two methods (they are not optionals).

If you start typing "adService" in your class implementation, you should see code completion (alt+esc) for this method converted in Swift.

The first method looks like this in Swift.

func adService(adService: ALAdService, didLoadAd ad: ALAd) {


}