Admob 奖励视频 GADRewardBasedVideoAdDelegate 未定义符号

Admob Reward Video GADRewardBasedVideoAdDelegate Undefined symbols

我最近根据这个教程实现了admob(ver 7.9.1)奖励视频: https://firebase.google.com/docs/admob/ios/rewarded-video

但我无法使用此功能编译我的应用程序。 我收到此错误:

Undefined symbols for architecture x86_64:
  "l_OBJC_PROTOCOL_$_GADRewardBasedVideoAdDelegate", referenced from:
      l_OBJC_CLASS_PROTOCOLS_$_ViewController in libFramework.a(ViewController.o)
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see     invocation)

我之前实施了横幅广告和插页式广告,效果很好。

有什么建议吗?

该错误告诉您您没有导入所需的 header。你 import GADRewardBasedVideoAd header 了吗?

#import "GADRewardBasedVideoAd.h"

或者,您可以只导入整个 AdMob 框架。例如:

@import GoogleMobileAds;

Google 还在 GitHub 上提供了完整的 GADRewardBasedVideoAd 示例:RewardedVideoExample/ViewController.m

正在导入 GoogleMobileAds/GADRewardBasedVideoAdDelegate.h,一切正常。

#import <GoogleMobileAds/GADRewardBasedVideoAdDelegate.h>