Question

I have an iOS app that has been in the app store for over a year. The most recent version was posted April 17. The purpose of this app is to allow the user to create a chess portable game notation (PGN) file and email it from their iPhone or iPad to their desktop computer. Then the email attachment can be read by any number of chess database applications.

Within the last week I have had two users give me feedback that the attachment is not included in their emails. One has shown me a screenshot of the mail composer showing that it is composed with the attachment.

Not being able to send the PGN attachment is a serious issue for this app, so if it was a widespread problem, I would hear from more than two users.

One of the users is sending to a gmail account, the other to an iCloud account. One user reported that a friend using the same WiFi connection was able to send the email attachment without issues from his iPad. He has also been able to send screen shots and reply to messages from me where I have attached PGN (mimeType:@"text/pgn") files.

My mail composer code is from Apple examples and has worked for over a year for users all over the world.

Has anyone had a similar experience? I'm concerned that I have had two issues within a week on code that has been in the app for over a year.

Thanks!

Attached is some of the code to add the attachment data.
Note that the attachment is not a "file".

PgnGenerator *generator = [[PgnGenerator alloc] init];
generator.game = inGame;

NSString *pgn = [generator pgnString];

NSData *myData = [pgn dataUsingEncoding:NSASCIIStringEncoding];

NSString* fileName = [NSString stringWithFormat:@"%@.pgn", [inGame eventAndRound]];

[picker addAttachmentData:myData mimeType:@"text/pgn" fileName:fileName];

Using

NSData *myData = [pgn dataUsingEncoding:NSASCIIStringEncoding allowLossyConversion:YES];

Solved the issue.
"For example, in converting a character from NSUnicodeStringEncoding to NSASCIIStringEncoding, the character ‘Á’ becomes ‘A’, losing the accent."

Many of the chess applications that would be reading the PGN file cannot handle the accented characters anyhow, so losing the accent is is the best solution until the specification is updated.

Was it helpful?

Solution

I have noticed before that even if the file I'm attaching doesn't exist on the device the mail composer will still show as if the file is going to attach. Then when the email gets sent the attachment is not there.

Is it possible that this situation is occurring?

OTHER TIPS

In my case when I used NSASCIIStringEncoding NSString was returning nil on iOS7 (it works good on iOS6), NSUTF8StringEncoding works fine

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