Question

I`m trying to integrate Urban Airship in my application. Some error happened during UAirship:takeOff. I wrote to FAQ, but nobody answered me.

I `m using the following code:

NSLog(@"Starting airship...");
UAConfig *config = [UAConfig defaultConfig];
config.developmentAppKey = @"mydevelopmentkey";
config.developmentAppSecret = @"mydevelopmentsecretkey";
config.inProduction = FALSE;
[UAirship takeOff:config];
NSLog(@"Airship started");

Then, when calling takeOff method, application crashes and I get the following output:

hero[3457] Warning: Starting airship...
hero[3457] Warning: [W] -[UAConfig validate] [Line 163] Production App Key
is not valid.
hero[3457] Warning: [W] -[UAConfig validate] [Line 167] Production App
Secret is not valid.
hero[3457] Warning: [I] +[UAirship executeUnsafeTakeOff:] [Line 151] App
Key: <removed>
hero[3457] Warning: [I] +[UAirship executeUnsafeTakeOff:] [Line 152] App
Secret: <removed>
hero[3457] Warning: [I] +[UAirship executeUnsafeTakeOff:] [Line 153]
Server: https://device-api.urbanairship.com
hero[3457] Warning: [D] -[UAirship configureUserAgent] [Line 296] Setting
User-Agent for UA requests to hero 2.28.11.42.57 (iPod touch; iPhone OS
6.1.3; UALib 2.1.0; <removed>; ru_RU)
hero[3457] Warning: [D] void
PrintReachabilityFlags(SCNetworkReachabilityFlags, const char *) [Line 79]
Reachability Flag Status: -R -----l- networkStatusForFlags
hero[3457] Warning: [D] +[UAirship executeUnsafeTakeOff:] [Line 186]
Deleting the UA device ID
hero[3457] Error: *** Terminating app due to uncaught exception
'NSInvalidArgumentException', reason: '*** setObjectForKey: object cannot
 be nil (key: gena)'
*** First throw call stack:
(0x32d792a3 0x3aa5d97f 0x32cdb313 0x4ef85 0x4ee27 0x4f877 0x490b7 0x48aaf
0x3ae744b7 0x3ae7a3f7 0x48a8b 0x43760 0x43484 0xd95c0 0xe7020 0x336900f5
0x32d4e683 0x32d4dee9 0x32d4ccb7 0x32cbfebd 0x32cbfd49 0x368872eb
0x34bd5301 0xead4c 0x2e214)

I develop a game using Marmalade SDK. It provides the ability to write native "extensions" (the libraries of native code, that can be called from the c++ code). The problem is, that extensions dont support all the app delegate events. For example, in Urban Airship sample code takeOff method is called from didFinishLaunchingWithOptions. But extensions are initialised later, than this message occured in appdelegate, so it cant be handled. I try to call the code above as a method from the main thread. But the result is error to.

Can anybody help with it?

Was it helpful?

Solution

The error says that you're setting nil in setObjectForkey. Check the argument properly. We've added urban airship into our marmalade projects too, so I am sure that's not Urban Airship's bug.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top