【发布时间】:2014-03-13 14:49:12
【问题描述】:
我正在尝试将 Urban Airship 集成到我的应用程序中。一些错误 发生在 UAirship:takeOff 期间。我写了常见问题解答,但没有人回复我。
我正在使用以下代码:
NSLog(@"Starting airship...");
UAConfig *config = [UAConfig defaultConfig];
config.developmentAppKey = @"mydevelopmentkey";
config.developmentAppSecret = @"mydevelopmentsecretkey";
config.inProduction = FALSE;
[UAirship takeOff:config];
NSLog(@"Airship started");
然后,当调用 takeOff 方法时,应用程序崩溃了,我得到了 以下输出:
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)
我使用 Marmalade SDK 开发了一款游戏。它提供了编写本机“扩展”(本机代码库,可以从 c++ 代码调用)的能力。问题是,扩展 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 被处理。
我尝试从主线程调用上面的代码作为方法。但是结果是错误的。
有人可以帮忙吗?
【问题讨论】:
标签: ios urbanairship.com marmalade