У меня была такая же проблема.Ответ UrbanAirship: здесь - как единовременное решение добавьте DELETE_KEYCHAIN_CREDENTIALS = YES
файл конфигурации.Я создаю свой файл конфигурации UA, я не использую AirshipConfig.plist, поэтому я добавил переключатель в настройки, чтобы разрешить добавление этой строки по мере необходимости.
Вот код, который я использую для создания настроекмассив:
- (void)urbanAirshipTakeoffWithLaunchOptions:(NSDictionary *)launchOptions {
// Init Airship launch options
NSMutableDictionary *takeOffOptions = [[NSMutableDictionary alloc] init];
[takeOffOptions setValue:launchOptions forKey:UAirshipTakeOffOptionsLaunchOptionsKey];
// Build the Urban Airship TakeOffOptions
NSMutableDictionary *airshipConfigOptions = [[NSMutableDictionary alloc] init];
/*
* Set up the Push keys based on target
*/
// TARGET1
#ifdef TARGET1
NSLog(@"Urban Airship - Target TARGET1");
[airshipConfigOptions setValue:@"xxxxxxxxxxxxxxxxxxxxxx" forKey:@"DEVELOPMENT_APP_KEY"];
[airshipConfigOptions setValue:@"xxxxxxxxxxxxxxxxxxxxxx" forKey:@"DEVELOPMENT_APP_SECRET"];
[airshipConfigOptions setValue:@"xxxxxxxxxxxxxxxxxxxxxx" forKey:@"PRODUCTION_APP_KEY"];
[airshipConfigOptions setValue:@"xxxxxxxxxxxxxxxxxxxxxx" forKey:@"PRODUCTION_APP_SECRET"];
#endif
// TARGET2
#ifdef TARGET2
NSLog(@"Urban Airship - Target TARGET2");
[airshipConfigOptions setValue:@"xxxxxxxxxxxxxxxxxxxxxx" forKey:@"DEVELOPMENT_APP_KEY"];
[airshipConfigOptions setValue:@"xxxxxxxxxxxxxxxxxxxxxx" forKey:@"DEVELOPMENT_APP_SECRET"];
[airshipConfigOptions setValue:@"xxxxxxxxxxxxxxxxxxxxxx" forKey:@"PRODUCTION_APP_KEY"];
[airshipConfigOptions setValue:@"xxxxxxxxxxxxxxxxxxxxxx" forKey:@"PRODUCTION_APP_SECRET"];
#endif
// TARGET3
#ifdef TARGET3
NSLog(@"Urban Airship - Target TARGET3");
[airshipConfigOptions setValue:@"xxxxxxxxxxxxxxxxxxxxxx" forKey:@"DEVELOPMENT_APP_KEY"];
[airshipConfigOptions setValue:@"xxxxxxxxxxxxxxxxxxxxxx" forKey:@"DEVELOPMENT_APP_SECRET"];
[airshipConfigOptions setValue:@"xxxxxxxxxxxxxxxxxxxxxx" forKey:@"PRODUCTION_APP_KEY"];
[airshipConfigOptions setValue:@"xxxxxxxxxxxxxxxxxxxxxx" forKey:@"PRODUCTION_APP_SECRET"];
#endif
// If CONFIGURATION_Debug is definied, then use the development servers, else use the production servers
#ifdef CONFIGURATION_Debug
[airshipConfigOptions setValue:@"NO" forKey:@"APP_STORE_OR_AD_HOC_BUILD"];
NSLog(@"Using Development Servers at Urban Airship");
#else
[airshipConfigOptions setValue:@"YES" forKey:@"APP_STORE_OR_AD_HOC_BUILD"];
NSLog(@"Using Production Servers at Urban Airship");
#endif
// Erase stored user information from keychain - set in settings?
if(self.getEraseUser) [airshipConfigOptions setValue:@"YES" forKey:@"DELETE_KEYCHAIN_CREDENTIALS"];
// Set and start Urban Airship
[takeOffOptions setValue:airshipConfigOptions forKey:UAirshipTakeOffOptionsAirshipConfigKey];
[UAirship takeOff:takeOffOptions];
// If the application gets an UAInbox message id on launch open it up immediately. Only works for the default inbox
[UAInbox useCustomUI:[UAInboxUI class]]; //sample UI implementation
[UAInbox shared].pushHandler.delegate = [UAInboxUI shared];
[UAInboxUI shared].inboxParentController = self.tabcontroller;
[UAInboxPushHandler handleLaunchOptions:launchOptions];
if([[UAInbox shared].pushHandler hasLaunchMessage]) {
[[[UAInbox shared] uiClass] loadLaunchMessage];
}
// Register for push notifications
[[UIApplication sharedApplication] registerForRemoteNotificationTypes:(UIRemoteNotificationTypeBadge |
UIRemoteNotificationTypeSound |
UIRemoteNotificationTypeAlert)];
}
После запуска мой файл журнала показывает:
2012-03-30 10:32:33.505 iFlightBag[13792:707] -[UAInboxMessageList messageListReady:] [Line 188] after retrieveMessageList, messages: (
"4e825e6863051f2fed001efa - New User Welcome"
)
2012-03-30 10:32:33.632 ThisApp[13792:707] -[UAUser updatedDefaultDeviceToken:] [Line 1036] Updated Device Token response: 200
2012-03-30 10:33:32.089 ThisApp[13792:707] +[UAKeychainUtils getDeviceID] [Line 263] Retrieved device id info from keychain.
2012-03-30 10:33:32.090 ThisApp[13792:707] +[UAKeychainUtils getDeviceID] [Line 267] Device ID result is not nil.
Показывает, что был создан новый пользователь.Я использую форматированный текстовый почтовый ящик на основе псевдонима и тегов.Таким образом, имя пользователя не влияет на мое приложение.
Я что-то пропустил?