集成并使用W3i iOS广告商SDK宣传我们的iOS应用程序

集成并使用W3i iOS广告商SDK宣传我们的iOS应用程序,ios,ads,Ios,Ads,我正在将W3i广告客户SDK集成到iOS应用程序中,但该应用程序在下面一行中崩溃 [[W3iAdvertiserSdk sharedConnector] connectWithAppID:W3I_APP_ID]; 这里有一个例外: *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[__NSDictionaryI W3iPublisherJSONRepresentati

我正在将W3i广告客户SDK集成到iOS应用程序中,但该应用程序在下面一行中崩溃

 [[W3iAdvertiserSdk sharedConnector] connectWithAppID:W3I_APP_ID];
这里有一个例外:

 *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[__NSDictionaryI W3iPublisherJSONRepresentation]: unrecognized selector sent to instance 0xa1d7520'
*** First throw call stack:
(0x29d3012 0x23fae7e 0x2a5e4bd 0x29c2bbc 0x29c294e 0x16af7a 0x3e25 0xcd57b7 0xcd5da7 0xcd6fab 0xce8315 0xce924b 0xcdacf8 0x2903df9 0x2903ad0 0x2948bf5 0x2948962 0x2979bb6 0x2978f44 0x2978e1b 0xcd67da 0xcd865c 0x2d08d 0x26c5)
libc++abi.dylib: terminate called throwing an exception
我搜索了很多,但除了w3i的官方指南外,网上并没有关于w3i集成及其使用的信息。

以下是我将遵循的步骤: 步骤1:从W3i下载SDK

步骤2:将W3iAdvertiserSdk-3.2.0文件夹拖动到项目的文件文件夹中

步骤3添加到以下框架的链接(如果尚未出现):

  • AdSupport.framework
  • UIKit.framework
  • 基础.框架
  • CoreGraphics.framework
步骤4:添加到AppDelegate.m文件中,导入“W3iAdvertiserSdk.h”

如果我在上面的集成之后运行应用程序,那么应用程序运行良好,没有任何错误,但是当我调用W3iAdvertiser方法连接应用程序时,它会抛出我上面已经发布的异常

// add this line to application's didFinishLaunchingWithOptions method
[[W3iAdvertiserSdk sharedConnector] connectWithAppID:W3I_APP_ID];  //appId created at w3i

 *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[__NSDictionaryI W3iPublisherJSONRepresentation]: unrecognized selector sent to instance 0xa1d7520'
*** First throw call stack:
(0x29d3012 0x23fae7e 0x2a5e4bd 0x29c2bbc 0x29c294e 0x16af7a 0x3e25 0xcd57b7 0xcd5da7 0xcd6fab 0xce8315 0xce924b 0xcdacf8 0x2903df9 0x2903ad0 0x2948bf5 0x2948962 0x2979bb6 0x2978f44 0x2978e1b 0xcd67da 0xcd865c 0x2d08d 0x26c5)
libc++abi.dylib: terminate called throwing an exception

谁能告诉我哪里出了问题,如何使用SDK的功能将应用程序与w3i连接,通过w3i宣传我们的应用程序?

有两种方法将应用程序与w3i连接:

选项1:集成W3iOS SDK,并在应用程序开始时调用其方法“connectWithAppId”

选项2:在应用程序开始时调用W3i“appWasRun”API

第一个选项对我来说不起作用,但选项2非常简单,工作正常

以下是API的格式及其参数:

http://api.w3i.com/PublicServices/MobileTrackingApiRestV1.svc/AppWasRun?AppId={APPID}&clientIp={clientIp}&iosdfa={advisingidentifier}&iOSUDID={iOSUDID}&iOSOpenUDID={iOSOpenUDID}&iOSMD5WLANMAC={iOSMD5WLANMAC}&iOSSha1HashedMac={iosshash1hashedmac}

请求类型:GET

所需参数:APPID(由W3I生成)和至少一个标识符(W3I首选所有参数)

我只使用了OpenUDID,它工作得很好

http://api.w3i.com/PublicServices/MobileTrackingApiRestV1.svc/AppWasRun?AppId=W3i_APP_ID&iOSOpenUDID=OPEN_UDID
有关更多信息,请查看以下链接


希望它将来能帮助其他人:)

您还需要遵循以下步骤:

  • 将-ObjC添加到目标的生成设置中的其他链接器标志。这将允许“选项1”不会崩溃

  • 您是否使用与网站文档中提到的相同的lib版本?转到“W3iAdvertiserSdk”类,并确保在其中定义了“connectWithAppID:”方法。是的,我使用的是相同的lib版本。我刚刚得到了解决方案,我使用了w3i的“appWasRun”API而不是SDK。它现在运转良好。谢谢