W.S
W.S

Reputation: 931

Integration and Use of W3i iOS Advertiser SDK to advertise our iOS app

I'm integrating W3i Advertiser SDK in iOS app, but app is being crashed at following line.

 [[W3iAdvertiserSdk sharedConnector] connectWithAppID:W3I_APP_ID];

and here is exception:

 *** 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

I Searched a lot but there is no information on net related to w3i's integration and it's use except w3i's official guideline. https://associate.w3i.com/integration/W3i_iOS_Advertiser_SDK_Integration_Guide1.htm

https://associate.w3i.com/integration/index.html

Here are steps i'm following:

Step1: Download SDK from W3i enter image description here

Step2: Drag W3iAdvertiserSdk-3.2.0 folder into project's file folder enter image description here

Step3 Add a link to the following frameworks if not already present:

Step4: Add to your AppDelegate.m file, #import "W3iAdvertiserSdk.h"

If I run the app after above Integration then app runs fine without any error but when i call the method of W3iAdvertiser to connect with app then it it throws exception which i've already posted above.

// 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

Can anyone please guide me where i'm going wrong, how to use SDK's functions to connect App with w3i's to advertise our app through w3i ?

Upvotes: 0

Views: 344

Answers (2)

JeremyDay
JeremyDay

Reputation: 440

You need to follow this step as well:

  1. Add -ObjC to Other Linker Flags in your target's Build Settings. That will allow "Option 1" to not crash.

Upvotes: 2

W.S
W.S

Reputation: 931

There are two ways to connect app with w3i:

Option1: Integrate W3i-iOS-SDK, and call it's method "connectWithAppId" at start of application.

Option2: Call W3i "appWasRun" API at start of application

first option didn't work for me, but Option2 is quite easy and working fine.

Here is format of API and it's parameters:

http://api.w3i.com/PublicServices/MobileTrackingApiRestV1.svc/AppWasRun?AppId={APPID}&clientIp={CLIENTIP}&iOSIDFA={advertisingIdentifier}&iOSUDID={IOSUDID}&iOSOpenUDID={IOSOpenUDID}&iOSMD5WLANMAC={iOSMD5WLANMAC}&iOSSha1HashedMac={iOSSha1HashedMac}

Request Type: GET

Required Parameters: APPID (generated by W3I) and at-least one identifier (all parameters are preferred by W3i)

I used only OpenUDID and it worked fine.

http://api.w3i.com/PublicServices/MobileTrackingApiRestV1.svc/AppWasRun?AppId=W3i_APP_ID&iOSOpenUDID=OPEN_UDID

For More Information check the following links.

https://sites.google.com/site/w3ideveloperscom/ios/iOSAFPP/advapi

https://associate.w3i.com/integration/Device_Identifiers.htm

Hope it would help others in future :)

Upvotes: 0

Related Questions