IOS接入AppLovinSDK 纯小白

前言

做游戏开发的我,零经验,公司要求接入applovin广告,好久都没找到适合新手的详细参考资料,只能硬啃英文文档了。

官方文档:MAX Mediation Documentation

正文

1、打开文档,直接翻到苹果接入部分。

9c1cee8690764ae7a5e1670311474e93.png

拷贝到项目中,再在xcode中添加引用。

6d3c4425661d46c8959378d73f763794.png

2、注意这个部分,要你在你的项目中的info.plist添加AppLovinSdkKey字段,值填广告后台账户的SDK Key。

9991236bcae545fc9e73c5a31af941fd.png

f28ed62e056d46a4af3e7d3c102ba73d.png

3、SDK初始化

1fbe258894ab40a0961ba3e7c2bc66b4.png

 回到文档,以下圈出来的不用关心,直接看广告接入部分。

2a957ee23558417cae5c7993f9330585.pngaaa58f38cdd64081ae49dde0e8f2a1e0.png

4、根据文档编写相应广告加载播放逻辑,略。

遇到的问题

1、项目打包出现报错:linker command failed with exit code 1 (use -v to see invocation)

具体如下:

ld: Undefined symbols:

  __swift_FORCE_LOAD_$_swiftCompatibility50, referenced from:

      __swift_FORCE_LOAD_$_swiftCompatibility50_$_AppLovinSDK in AppLovinSDK[395](AdapterDelegate.o)

  __swift_FORCE_LOAD_$_swiftCompatibility51, referenced from:

      __swift_FORCE_LOAD_$_swiftCompatibility51_$_AppLovinSDK in AppLovinSDK[395](AdapterDelegate.o)

  __swift_FORCE_LOAD_$_swiftCompatibilityConcurrency, referenced from:

      __swift_FORCE_LOAD_$_swiftCompatibilityConcurrency_$_AppLovinSDK in AppLovinSDK[395](AdapterDelegate.o)

  __swift_FORCE_LOAD_$_swiftCompatibilityDynamicReplacements, referenced from:

      __swift_FORCE_LOAD_$_swiftCompatibilityDynamicReplacements_$_AppLovinSDK in AppLovinSDK[395](AdapterDelegate.o)

clang: error: linker command failed with exit code 1 (use -v to see invocation)

百度告诉我在项目目录下新建一个swift脚本,不用写啥,再打包就可以了,实测有效。

2、加载广告提示网络错误

考虑app包名是否和广告id设置的一致。

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值