Sending more than 2 images via email with skpsmtpmessage in ios6 - ios

I am trying to attach images to the email and send the email to my email add. The problem is that when i send out an email with 4 or 5 images attached, the app keeps processing for ever and eventually gets hanged and crashes and doesn't send the email. It is working fine with one image. I am using skpsmtp to send the mail. The same app is working fine in iOS5, but it hangs when I run it on iOS6, I am unable to send an mail as it hangs.
The code looks like this:
- (IBAction) SendEmail {
//supports multiple emails
BOOL bIsEmailValid = NO;
if ([txtTO.text rangeOfString:#","].location != NSNotFound) {
NSArray *arrEmails = [txtTO.text componentsSeparatedByString:#","];
DLog(#"Emails: %#", arrEmails);
if ([arrEmails count] > 0) {
for (int ctr = 0; ctr < [arrEmails count] ; ctr++) {
NSString *strEmail = [(NSString*)[arrEmails objectAtIndex:ctr] stringByReplacingOccurrencesOfString:#" " withString:#""];
if ([self IsValidEmail:strEmail]) {
bIsEmailValid = YES;
} else {
bIsEmailValid = NO;
break;
}
}
}
} else { // only 1 email entered
if ([self IsValidEmail:txtTO.text]) {
bIsEmailValid = YES;
} else {
bIsEmailValid = NO;
}
}
if (bIsEmailValid) {
[NSThread detachNewThreadSelector:#selector(ActivityViewLoading) toTarget:self withObject:nil];
SKPSMTPMessage *testMsg = [[SKPSMTPMessage alloc] init];
testMsg.fromEmail = FROM_EMAIL;
testMsg.toEmail = txtTO.text;
testMsg.relayHost = RELAY_HOST;
testMsg.requiresAuth = YES;
testMsg.login = EMAIL_LOGIN;
testMsg.pass = PASSWORD;
testMsg.subject = txtSubj.text;
testMsg.wantsSecure = YES;
testMsg.delegate = self;
testMsg.bccEmail = BCC_EMAIL;
NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
NSString *defStrName = [defaults stringForKey:#"keyEName"];
NSString *defStrContact = [defaults stringForKey:#"keyEContNo"];
NSString *defStrEmail = [defaults stringForKey:#"keyEEmailAdd"];
NSString *defStrDescr = [defaults stringForKey:#"keyEShortMessage"];
DLog(#"%# %# %# %#",defStrName, defStrContact, defStrEmail, defStrDescr);
NSMutableArray* parts = [[NSMutableArray alloc] init];
NSString *strhtml = [NSString stringWithFormat:#"<div>%#</div>",[txtDesc.text stringWithNewLinesAsBRs]];
NSString *defStrWebLinks = [defaults stringForKey:#"keyEwebLinks"];
NSArray *array = [defStrWebLinks componentsSeparatedByString:#"|"];
NSString *strTemp1 = [[array objectAtIndex:0] stringByReplacingOccurrencesOfString:#" " withString:#""];
NSString *strTemp2 = [[array objectAtIndex:1] stringByReplacingOccurrencesOfString:#" " withString:#""];
NSString *strFormat1 = [NSString stringWithFormat:#"<a href=\"\%#\"\>%#</a>",
strTemp1,strTemp1];
NSString *strFormat12 = [NSString stringWithFormat:#"<a href=\"\%#\"\>%#</a>",
strTemp2,strTemp2];
NSString *strComb = [NSString stringWithFormat:#"%# | %#",strFormat1,strFormat12];
strhtml = [strhtml stringByReplacingOccurrencesOfString:defStrWebLinks withString:strComb];
//DLog(#"%#",strhtml);
NSDictionary *plainPart = [NSDictionary dictionaryWithObjectsAndKeys:#"text/html",kSKPSMTPPartContentTypeKey,
strhtml,kSKPSMTPPartMessageKey,#"8bit",kSKPSMTPPartContentTransferEncodingKey,nil];
[parts addObject:plainPart];
for (int nCtr = 0; nCtr < [arrPix count]; nCtr++) {
UIImageView *imageV = [arrPix objectAtIndex:nCtr];
if (imageV.image) {
NSData *imageData = UIImagePNGRepresentation(imageV.image);
NSString *strFileName = [NSString stringWithFormat:#"MyPicture-%d.jpeg",nCtr];
NSString *strFormat = [NSString stringWithFormat:#"image/jpeg;\r\n\tx-unix-mode=0644;\r\n\tname=\"%#\"",strFileName];
NSString *strFormat2 = [NSString stringWithFormat:#"attachment;\r\n\tfilename=\"%#\"",strFileName];
NSDictionary *vcfPart = [NSDictionary dictionaryWithObjectsAndKeys:strFormat,kSKPSMTPPartContentTypeKey,
strFormat2,kSKPSMTPPartContentDispositionKey,[imageData encodeBase64ForData],kSKPSMTPPartMessageKey,#"base64",kSKPSMTPPartContentTransferEncodingKey,nil];
[parts addObject:vcfPart];
}
}
testMsg.parts = parts;
[testMsg send];
}
Need some guidance. Thanks..

Change the image format from PNG to JPEG.
Hence change this line
NSData *imageData = UIImagePNGRepresentation(imageV.image);
to
NSData *imageData = UIImageJPEGRepresentation(imageV.image,0.9);
It will solve the problem...

Related

HashValue mis match in PayUMoney framework, iOS - Objective-C

I got error like Hash value Mismatch from PayUMoney payment gateway
Here is my code which I did, please let me know where is issue
PUMTxnParam *txnParam= [[PUMTxnParam alloc] init];
//Set the parameters
txnParam.phone = [[NSUserDefaults standardUserDefaults] valueForKey:#"mobile"];
txnParam.email = [[NSUserDefaults standardUserDefaults] valueForKey:#"username"];
txnParam.amount = _txtCash.text;
txnParam.environment = PUMEnvironmentProduction;
txnParam.firstname = [[NSUserDefaults standardUserDefaults] valueForKey:#"name1"];
txnParam.key = #"xxxxxxxx";
txnParam.merchantid = #"xxxxxxx";
txnParam.txnID = [txnData valueForKey:#"txnid"];
txnParam.surl = #"https://google.com/";
txnParam.furl = #"https://google.com/";
txnParam.productInfo = #"My App";
txnParam.udf1 = #"";
txnParam.udf2 = #"";
txnParam.udf3 = #"";
txnParam.udf4 = #"";
txnParam.udf5 = #"";
txnParam.hashValue = [self createSHA512:[NSString stringWithFormat:#"%#|%#|%#|%#|%#|%#|%#|%#|%#|%#|%#||||||%#|",txnParam.key,txnParam.txnID,txnParam.amount,txnParam.productInfo,txnParam.firstname,txnParam.email,txnParam.udf1,txnParam.udf2,txnParam.udf3,txnParam.udf4,txnParam.udf5,#"dxltF25QEp"]];
-(NSString *)createSHA512:(NSString *)string
{
const char *cstr = [string cStringUsingEncoding:NSUTF8StringEncoding];
NSData *data = [NSData dataWithBytes:cstr length:string.length];
uint8_t digest[CC_SHA512_DIGEST_LENGTH];
CC_SHA512(data.bytes, (CC_LONG)data.length, digest);
NSMutableString* output = [NSMutableString stringWithCapacity:CC_SHA512_DIGEST_LENGTH * 2];
for(int i = 0; i < CC_SHA512_DIGEST_LENGTH; i++)
[output appendFormat:#"%02x", digest[i]];
return output;
}
Please help to clear this out.
Cocoa pods and Github have their old libraries,
I just copied the library from their example which is in GitHub and it works fine :)

iOS: Creating structured NSArray in given format

hello all i am working on a project in which i have to create an array in this format:
{
"1": {
"Child_Gender": "",
"Child_DOB": "",
"Child_tobbacoUse": ""
},
"2": {
"Child_Gender": "",
"Child_DOB": "",
"Child_tobbacoUse": ""
},
but the array i create gives this format
(
{
"Child_DOB" = "";
"Child_Gender" = "";
"Child_tobbacoUse" = "";
},
{
"Child_DOB" = "";
"Child_Gender" = "";
"Child_tobbacoUse" = "";
}
)
i am using the following code:
for (int i = 0; i < arrayChildModel.count; i++)
{
ChildModel *model = [arrayChildModel objectAtIndex:i];
NSString *keyOrder = [NSString stringWithFormat:#"Children_Gender[%d]",i];
NSString *keyQuantity = [NSString stringWithFormat:#"Children_BirthDate[%d]",i];
NSString *keyTobacco = [NSString stringWithFormat:#"Children_HasTobaccoUsage[%d]",i];
//NSString *keyNotes = [NSString stringWithFormat:#"row[%d][description]",i];
childDateOfBirthStr = model.ChildBirthDate ;
childGenderStr = model.ChildGender ;
childTobaccoStr = model.ChildTobaccoUsage;
NSString *string1 = [NSString stringWithFormat:#"%#=%#&",keyOrder,childGenderStr];
NSString *string2 = [NSString stringWithFormat:#"%#=%#",keyQuantity,childDateOfBirthStr];
NSString *string3 = [NSString stringWithFormat:#"%#=%#",keyTobacco,childTobaccoStr];
[stringParams appendString:string1];
[stringParams appendString:string2];
[stringParams appendString:string3];
NSDictionary * ChildDict;
NSArray * ApplicantKeys = [[NSArray alloc]initWithObjects:#"Child_Gender",#"Child_DOB",#"Child_tobbacoUse", nil];
NSArray * ApplicantObjects = [[NSArray alloc]initWithObjects:childGenderStr,childDateOfBirthStr,childTobaccoStr, nil];
ChildDict = [NSDictionary dictionaryWithObjects:ApplicantObjects forKeys:ApplicantKeys];
NSLog(#"Dictionary is %#",ChildDict);
[CompleteArray addObject:ChildDict];
}
NSLog(#"Final Array is %#",CompleteArray);
please help me to convert the output array to the required formatted array
Create one dictionary outer for loop
NSMutableDictionary *dict =[[NSMutableDictionary alloc]init];
add this line before NSLog(#"Dictionary is %#",ChildDict);
[dict setObject:ChildDict forKey:[NSString stringWithFormat:#"%ld",i+1]];
[CompleteArray addObject:dict];
Please check following solution it will give you as expected output.
NSMutableDictionary *resultDic = [NSMutableDictionary new];
for (int i = 0; i < arrayChildModel.count; i++)
{
ChildModel *model = [arrayChildModel objectAtIndex:i];
NSString *keyOrder = [NSString stringWithFormat:#"Children_Gender[%d]",i];
NSString *keyQuantity = [NSString stringWithFormat:#"Children_BirthDate[%d]",i];
NSString *keyTobacco = [NSString stringWithFormat:#"Children_HasTobaccoUsage[%d]",i];
//NSString *keyNotes = [NSString stringWithFormat:#"row[%d][description]",i];
childDateOfBirthStr = model.ChildBirthDate ;
childGenderStr = model.ChildGender ;
childTobaccoStr = model.ChildTobaccoUsage;
NSString *string1 = [NSString stringWithFormat:#"%#=%#&",keyOrder,childGenderStr];
NSString *string2 = [NSString stringWithFormat:#"%#=%#",keyQuantity,childDateOfBirthStr];
NSString *string3 = [NSString stringWithFormat:#"%#=%#",keyTobacco,childTobaccoStr];
[stringParams appendString:string1];
[stringParams appendString:string2];
[stringParams appendString:string3];
NSDictionary * ChildDict = [NSDictionary dictionaryWithObjectsAndKeys:childGenderStr,#"Child_Gender",childDateOfBirthStr,#"Child_DOB",childTobaccoStr,#"Child_tobbacoUse", nil];
NSLog(#"Dictionary is %#",ChildDict);
NSString *resultDicKey = [NSString stringWithFormat:#"%d",i+1];
[resultDic setValue:ChildDict forKey:resultDicKey];
}
NSLog(#"Result dic %#",resultDic);

NSMutableArray have restriction in adding object?

I am using NSMutableArray for adding objects.But its add only first 10 objects.
I have code for sharing
for (int j = 0; j<[feedData count]; j++)
{
[sharingItems addObject:[self whatsappdata:[feedData objectAtIndex:j]]];
}
This method return NSString type text.
Please provide me valid solution for this.
Thanks in Advance
-(NSString *)whatsappdata:(NSDictionary *)cellData1
{
NSString *brandName = [NSString stringWithFormat:#"%#", [cellData1 objectForKey:#"brand_name"]];
NSString *modelName = [NSString stringWithFormat:#"%#", [cellData1 objectForKey:#"brand_model_name"]];
NSString *version = [NSString stringWithFormat:#"%#", [cellData1 objectForKey:#"version_name"]];
if ([version isEqualToString: #"<null>"])
{
version = #"";
}
NSString *year = [NSString stringWithFormat:#"%#", [cellData1 objectForKey:#"model_year"]];
if (year == nil || [year isEqualToString:#"0"])
{
year = #"";
}
NSString *inventoryValue = [NSString stringWithFormat:#"%#",[cellData1 objectForKey:#"inventory_type"]];
NSInteger value = [inventoryValue intValue];
NSString *inventoryName;
NSString *msg;
if(value == 1)
{
inventoryName = [NSString stringWithFormat:#"%#", #"Stock"];
i++;
NSString *text2 = [NSString stringWithFormat:#"%d.%# %# %#- %# Single Owner\n",i, brandName, modelName, version, year];
msg = [NSString stringWithFormat:#"%#",text2];
msg= [msg stringByReplacingOccurrencesOfString:#"\n" withString:#"<br/>"];
}
else
{
inventoryName = [NSString stringWithFormat:#"%#", #"Required"];
msg = #"";
}
return msg;
//end data
}
Most probably "fetch limit" has set for 'NSFetchRequest' inside your code.
NSFetchRequest *fetchRequest = [[NSFetchRequest alloc] init];
[fetchRequest setFetchLimit:10];//such code you need to find and remove/change fetch limit
you need to allocate memory to array before adding elements
sharingItems = [[NSMutableArray alloc]init];

array is not empty but still getting the error index 0 bounds

I am using SQLite and I want to save the name, address, and phone text fields for them to show up in the next view controller for when the "show details" button is clicked in 1st VC.
I placed "save" and "show details" button in 1st VC, as well as "previous" and "next" button in 2nd VC. Whenever I click on "show details" I am getting this error message:
index 0 beyond bounds for empty array.
However, I see that the array is not empty. I want to store the student details in the array.
- (void)viewDidLoad
{
[super viewDidLoad];
NSString *homeDirectory = NSHomeDirectory();
NSString *documentsDirectoryPath = [homeDirectory stringByAppendingPathComponent:#"Documents"];
self.dbFilePathInDocuments = [documentsDirectoryPath stringByAppendingPathComponent:#"details.db"];
self.studentDetails = [[NSMutableArray alloc]init];
NSString *selectQuery = [NSString stringWithFormat:#"select name,address,phone from contacts"];
sqlite3_open([self.dbFilePathInDocuments UTF8String], &dataBase);
sqlite3_prepare_v2(dataBase, [selectQuery UTF8String], -1,&selectStatement, NULL);
while (sqlite3_step(selectStatement) == SQLITE_ROW)
{
NSMutableDictionary *studentDict = [[NSMutableDictionary alloc]init];
NSString *name = [NSString stringWithFormat:#"%s",sqlite3_column_text(selectStatement, 0)];
NSString *address = [NSString stringWithFormat:#"%s",sqlite3_column_text(selectStatement, 1)];
NSString *phone = [NSString stringWithFormat:#"%s",sqlite3_column_text(selectStatement, 2)];
[studentDict setObject:name forKey:#"name"];
[studentDict setObject:address forKey:#"address"];
[studentDict setObject:phone forKey:#"phone"];
[self.studentDetails addObject:studentDict];
NSLog(#"student is:%#",self.studentDetails);
}
sqlite3_finalize(selectStatement);
sqlite3_close(dataBase);
self.nameLabel.text = [[self.studentDetails objectAtIndex:0] valueForKey:#"name"];
self.addressLabel.text = [[self.studentDetails objectAtIndex:0] valueForKey:#"address"];
self.phoneLabel.text = [[self.studentDetails objectAtIndex:0] valueForKey:#"phone"];
currentStudentIndex = 0;
}
- (IBAction)clickPrevious:(id)sender {
if(currentStudentIndex <=0)
{
currentStudentIndex = 0;
}else
{
currentStudentIndex = currentStudentIndex - 1;
}
self.nameLabel.text = [[self.studentDetails objectAtIndex:currentStudentIndex] valueForKey:#"name"];
self.addressLabel.text = [[self.studentDetails objectAtIndex:currentStudentIndex] valueForKey:#"address"];
self.phoneLabel.text = [[self.studentDetails objectAtIndex:currentStudentIndex] valueForKey:#"phone"];
}
- (IBAction)clickNext:(id)sender {
if(currentStudentIndex >= [self.studentDetails count] - 1)
{
currentStudentIndex = [self.studentDetails count] - 1;
}else
{
currentStudentIndex = currentStudentIndex + 1;
}
self.nameLabel.text = [[self.studentDetails objectAtIndex:currentStudentIndex] valueForKey:#"name"];
self.addressLabel.text = [[self.studentDetails objectAtIndex:currentStudentIndex] valueForKey:#"address"];
self.phoneLabel.text = [[self.studentDetails objectAtIndex:currentStudentIndex] valueForKey:#"phone"];
}
The issue is that you always accessing the array self.studentDetails even if it's empty. This will cause an exception.
First limit setting of the labels to a single method and check the array access will succeed before attempting it:
- (void)updateLabels
{
if (currentStudentIndex >= [self.studentDetails count])
return;
self.nameLabel.text = [[self.studentDetails objectAtIndex:currentStudentIndex] valueForKey:#"name"];
self.addressLabel.text = [[self.studentDetails objectAtIndex:currentStudentIndex] valueForKey:#"address"];
self.phoneLabel.text = [[self.studentDetails objectAtIndex:currentStudentIndex] valueForKey:#"phone"];
}
and use that method in the 3 places you currently set the labels. For example:
- (IBAction)clickPrevious:(id)sender {
currentStudentIndex--;
[self updateLabels];
}
- (IBAction)clickNext:(id)sender {
currentStudentIndex++;
[self updateLabels];
}
In the viewDidLoad method use this code:
...
sqlite3_finalize(selectStatement);
sqlite3_close(dataBase);
currentStudentIndex = 0;
[self updateLabels];
After that you're gonna want to work on enabling/disabling buttons depending on whether there is a next or previous student to view to make using the app more intuitive.

ios App crash instantly after in-app purchase buying

Basically, i am in really bad situation. Our team successfully develop and release new version of application with new feature, which users are able to buy (in-app purchases).
So, we have tested all new functionality with iTunes test user, and everything worked great, however, when we saw release version in appStore with real iTunes user, there is a huge problem. User just press button to buy in-app purchase, after he write password of his account and accept to buy this new information. Unfortunately, app crashes everytime after this action. And there is no actions after this.
Basically, for in-app purchases I use MKStoreKit.
So, I would like to present code of the following action:
- (IBAction)buyNewRequest:(id)sender
{
id<GAITracker> tracker = [[GAI sharedInstance] defaultTracker];
[tracker send:[[GAIDictionaryBuilder createEventWithCategory:#"uiAction"
action:#"Обработчик нажатия кнопки"
label:#"Кнопка - отправить запрос. Экран - запроса кредитной истории бки"
value:[NSNumber numberWithInt:100]] build]];
if ([self checkValidaionTextFields])
{
[DejalBezelActivityView activityViewForView:self.view withLabel:#"Подождите..."].showNetworkActivityIndicator = YES;
self.sendButton.enabled = NO;
[[MKStoreManager sharedManager] buyFeature:#"ru.financemart.nbki"
onComplete:^(NSString* purchasedFeature,
NSData* purchasedReceipt,
NSArray* availableDownloads)
{
id<GAITracker> tracker = [[GAI sharedInstance] defaultTracker];
[tracker send:[[GAIDictionaryBuilder createEventWithCategory:#"uiAction"
action:#"Уведомление подтверждения покупки БКИ"
label:#"Уведомление - покупка бки. Экран - отправки запроса кредитной истории БКИ"
value:[NSNumber numberWithInt:100]] build]];
NSString *stringReceipt = [NSString stringWithFormat:#"%#", purchasedReceipt];
stringReceipt = [stringReceipt stringByReplacingOccurrencesOfString:#" " withString:#""];
stringReceipt = [stringReceipt stringByReplacingOccurrencesOfString:#"<" withString:#""];
stringReceipt = [stringReceipt stringByReplacingOccurrencesOfString:#">" withString:#""];
NSString *base64Receipt = [self base64forData:purchasedReceipt];
NSString *hashDevelopKey = #"i5FnXIZ2aKjdn1Ru2VfLarbdCwbiJvfsnh9QTm9MB0I";
NSString *hashMD5 = #"";
hashMD5 = [hashMD5 stringByAppendingString:hashDevelopKey];
NSString *familyText = self.familyTextField.text;
NSString *nameText = self.nameTextField.text;
NSString *patronimicText = self.patronimicTextField.text;
NSString *passportID = self.passportID.text;
NSString *email = self.emailTextField.text;
NSString *dateOfBirth = dateOfBirthFormat;
NSString *passportDate = datePassportFormat;
NSString *regionForRequest = #"";
if ([[UnicomAPIConfigResponse lastResponse] cityByID:#(self.unicomProposalsModel.cityID).stringValue].ru_RU != nil) {
regionForRequest = [[UnicomAPIConfigResponse lastResponse] cityByID:#(self.unicomProposalsModel.cityID).stringValue].ru_RU;
}
hashMD5 = [hashMD5 stringByAppendingString:dateOfBirth];
hashMD5 = [hashMD5 stringByAppendingString:email];
hashMD5 = [hashMD5 stringByAppendingString:nameText];
hashMD5 = [hashMD5 stringByAppendingString:patronimicText];
hashMD5 = [hashMD5 stringByAppendingString:passportID];
hashMD5 = [hashMD5 stringByAppendingString:passportDate];
hashMD5 = [hashMD5 stringByAppendingString:base64Receipt];
hashMD5 = [hashMD5 stringByAppendingString:regionForRequest];
hashMD5 = [hashMD5 stringByAppendingString:familyText];
NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
NSString *stringToken = [[[[defaults valueForKey:#"deviceToken"] description]
stringByTrimmingCharactersInSet:[NSCharacterSet characterSetWithCharactersInString:#"<>"]]
stringByReplacingOccurrencesOfString:#" "
withString:#""];
hashMD5 = [hashMD5 stringByAppendingString:stringToken];
NSDateFormatter *formatter = [[NSDateFormatter alloc] init];
[formatter setDateFormat:#"dd.MM.yyyy"];
NSString *stringFromDate = [formatter stringFromDate:[NSDate date]];
hashMD5 = [hashMD5 stringByAppendingString:stringFromDate];
[DejalBezelActivityView activityViewForView:self.view withLabel:#"Отправляем..."].showNetworkActivityIndicator = YES;
[self.unicomService postNBKIRequestWithName:nameText WithFamily:familyText andPatronimic:patronimicText andDOB:dateOfBirth andPassport:passportID andPassportDate:passportDate andPartnerName:#"1" andEmail:email andToken:stringToken andReceipt:base64Receipt andHashKey:[self md5:hashMD5] andRegion:regionForRequest success:^(UnicomAPIRequestsNBKIResponse *response)
{
self.sendButton.enabled = YES;
} error:^(NSError *error) {
self.sendButton.enabled = YES;
[self performSelector:#selector(showError) withObject:nil afterDelay:2.0];
}]->addObserver( ^( TLSignal<NSDictionary *> *sender, NSDictionary *response )
{
[self performSelector:#selector(showSuccessPostRequest) withObject:nil afterDelay:0.0];
userModel = [CreditUserModel tlSharedInstance];
NSDictionary *dicta = [userModel.serverResponse valueForKey:#"result"];
NSString *dictb = [dicta valueForKey:#"id"];
NSMutableDictionary *paramNBKI = [[NSMutableDictionary alloc] init];
[paramNBKI setObject:dictb forKey:#"requestID"];
[paramNBKI setObject:self.familyTextField.text forKey:#"familyName"];
[paramNBKI setObject:self.nameTextField.text forKey:#"name"];
[paramNBKI setObject:self.patronimicTextField.text forKey:#"patronimic"];
[paramNBKI setObject:passportID forKey:#"passportID"];
[paramNBKI setObject:dateOfBirth forKey:#"dateOfBirth"];
[paramNBKI setObject:passportDate forKey:#"passportDate"];
[paramNBKI setObject:base64Receipt forKey:#"baseReceipt"];
[paramNBKI setObject:[self convertDate:[NSDate date]] forKey:#"requestDate"];
NSUserDefaults *defaults= [NSUserDefaults standardUserDefaults];
if([[[defaults dictionaryRepresentation] allKeys] containsObject:#"nbkiHistory"])
{
NSMutableArray *nbkiHistory = [[NSMutableArray alloc] init];
nbkiHistory = [NSMutableArray arrayWithArray:[defaults valueForKey:#"nbkiHistory"]];
[nbkiHistory addObject:paramNBKI];
[defaults setObject:nbkiHistory forKey:#"nbkiHistory"];
NSLog(#"mykey found");
} else {
NSMutableArray *nbkiHistory = [[NSMutableArray alloc] init];
[nbkiHistory addObject:paramNBKI];
[defaults setObject:nbkiHistory forKey:#"nbkiHistory"];
}
self.sendButton.enabled = YES;
} );
}
onCancelled:^
{
self.sendButton.enabled = YES;
[DejalBezelActivityView removeViewAnimated:YES];
}];
}
}
So, after user accept in-app purchase you could see POST request to our server ([self.unicomService postNBKIRequestWithName:), but there are no requests in our server database log, so app crashes before this code. But, there are no code strings where are it is able to crash.

Resources