I have a few questions about using chartboost in my app with Swift. I do not find their documentation much help as it mostly references Objective-C and when I emailed their support they just sent me back links to the Objective-C code. I need the answers in Swift.
1) How do I detect if the video has been watched or cancelled? Their docs say this is called a reward video and this is the what they provide for code
// Called after a rewarded video has been viewed completely and user is eligible for reward.
- (void)didCompleteRewardedVideo:(CBLocation)location
withReward:(int)reward;
2) Where do I put the above function? I have read that it is to be used in the app delegate in the didFinishLaunchingWithOptions section but have also read that I need to create it as an extension so I am slightly confused.
3) Again, what is the swift equivalent for this and where do I implement it:
[Chartboost cacheInterstitial:CBLocationHomeScreen];
[Chartboost cacheRewardedVideo:CBLocationHomeScreen];
4) Once that is implemented, is there a way to see if ads have been cached, if not then cache it.
Apologies for the many questions guys. I do love the fact that I can always reply and turn to stack overflow when I hit a wall.
Thanks in advance.
For 1) and 2) This method is good place to be called in app delegate.But with swift extension is a much better option. Use below syntax to call any app delegate method
3) You can use this syntax for swift
4) Similarly to delegate method, you can find method to check if the ads have been cached
Hope it answer all your question
Don't forget to add Delegate like this in your appdelegate
and then