Hi together,
i hope you can help me. My app update is always rejected. The reason of apple is : "Your app crashed on both Wi-Fi and cellular networks upon launch."
But in Germany the app is running with no Problems . I have tested it on more than 10 Devices.
The only thing i have changed in the update is, that i have added an easy reporting.
But why is the reporting causing crashes in the use ?
Here is the code i have added :
Code:
- (void) insert_reporting
{
NSNumber *n_AppID = [[[NSBundle mainBundle] infoDictionary] objectForKey:@"AppID"];
NSNumber *n_platform_id = [NSNumber numberWithInt:1];
NSString *appName = [[[NSBundle mainBundle] infoDictionary] objectForKey:@"CFBundleDisplayName"];
NSString *appVersion = [[[NSBundle mainBundle] infoDictionary] objectForKey:@"CFBundleVersion"];
UIDevice *dev = [UIDevice currentDevice];
NSString *deviceModel = dev.model;
NSString *deviceSystemVersion = dev.systemVersion;
NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
NSArray *languages = [defaults objectForKey:@"AppleLanguages"];
NSString *currentLanguage = [languages objectAtIndex:0];
UIDeviceHardware *h=[[UIDeviceHardware alloc] init];
NSString *deviceVersion = [h platformString];
[h release];
NSDate *today1 = [NSDate date];
NSDateFormatter *dateFormat = [[NSDateFormatter alloc] init];
[dateFormat setDateFormat:@"dd.MM.yyyy HH:mm:ss Z"];
NSString *dateString11 = [dateFormat stringFromDate:today1];
NSArray *split = [dateString11 componentsSeparatedByString:@"+"];
NSArray *split2 = [[split objectAtIndex:1] componentsSeparatedByString:@"0"];
int i_hoursToAdd = [[split2 objectAtIndex:1] intValue];
//get time from string
NSTimeZone *gmt = [NSTimeZone timeZoneWithAbbreviation:@"GMT"];
NSDateFormatter *inputFormatter = [[NSDateFormatter alloc] init];
[inputFormatter setDateFormat:@"dd.MM.yyyy HH:mm:ss Z"];
[inputFormatter setTimeZone:gmt];
[inputFormatter setFormatterBehavior:NSDateFormatterBehavior10_4];
NSLocale *locale = [[NSLocale alloc] initWithLocaleIdentifier:@"de_DE"];
[inputFormatter setLocale:locale];
NSDate *formatterDate = [inputFormatter dateFromString:dateString11];
formatterDate = [formatterDate dateByAddingTimeInterval:i_hoursToAdd*3600];
NSTimeInterval ti = [formatterDate timeIntervalSince1970];
NSNumber *n_date = [[NSNumber numberWithInt: ti] retain];
NSString * functionName = @"insert_reporting";
NSMutableDictionary* toJSON = [[NSMutableDictionary alloc] init];
toJSON = [NSDictionary dictionaryWithObjectsAndKeys:
n_AppID, @"appId",
[AppState sharedInstance].s_apns_token, @"apns_token",
[UIDevice currentDevice].uniqueIdentifier, @"uid",
@"ios", @"uid_type",
n_platform_id, @"platform_id",
appName, @"app_name",
appVersion, @"app_version",
deviceModel, @"device_model",
deviceSystemVersion, @"device_software_version",
deviceVersion, @"device_hardware_version",
currentLanguage, @"device_language",
[AppState sharedInstance].n_dateTimeAktuallisiert, @"timestamp",
n_date, @"currentTimestamp",
nil];
//Set Json and start Parser
SBJsonWriter *writer = [SBJsonWriter new];
[writer stringWithObject:toJSON];
NSString* JSONBody = [writer stringWithObject:toJSON];