feedbackreporter
feedbackreporter copied to clipboard
Email feedback submission example requires "application" parameter
Here's a suggestion: I tried to the the server example up and running that sends the feedback as email.
It would never send my crash reports until I discovered that it requires a custom key to be present: "application". I had to add this to my code to get it to work:
- (NSDictionary*) customParametersForFeedbackReport
{
return [NSDictionary dictionaryWithObjectsAndKeys:@"TestApp", @"application", nil];
}
Either I completely missed that from the docs or it's not there ;) Maybe something worth adding. Or, alternatively, just add it automatically based on the application name...
Thanks again, Rico
Hm ...the server script changed and I am not using the latest version myself. Definitely should default to the application name.
It's worse than having to add the key. If you try to use the PLIST_KEY_SENDDETAILSISOPTIONAL, and the user elects to not send details, the custom key doesn't get sent either and the submission fails.
Here's the patch diff between my fixed commit and the one I pulled from the repository.
diff --git a/Sources/Main/FRConstants.h b/Sources/Main/FRConstants.h
index d6d3265..0b13101 100644
--- a/Sources/Main/FRConstants.h
+++ b/Sources/Main/FRConstants.h
@@ -48,7 +48,6 @@
// POST fields filled by default
-#define POST_KEY_APPLICATION @"application"
#define POST_KEY_TYPE @"type"
#define POST_KEY_EMAIL @"email"
#define POST_KEY_MESSAGE @"comment"
diff --git a/Sources/Main/FRFeedbackController.m b/Sources/Main/FRFeedbackController.m
index 60cb277..6fda9f4 100644
--- a/Sources/Main/FRFeedbackController.m
+++ b/Sources/Main/FRFeedbackController.m
@@ -365,10 +365,7 @@
NSMutableDictionary *dict = [NSMutableDictionary dictionary];
- [dict setValidString: [[[NSBundle mainBundle] infoDictionary] objectForKey:@"CFBundleName"]
- forKey:POST_KEY_APPLICATION];
-
- [dict setValidString:[emailBox stringValue]
+ [dict setValidString:[emailBox stringValue]
forKey:POST_KEY_EMAIL];
[dict setValidString:[messageView string]
@tcurdt I could integrate this... but I don't know much about web technologies... would adding a new key/value in the POST cause any forward/backwards compatibility problems? i.e. apps running old/new framework vs servers running old/new php scripts?
@seanm adding a key should be fine - but that patch is removing one.
I would rather fix the mentioned bug and make sure the CFBundleName is always included as application. Having to manually add it is not as it should be.
Oh, so we want the inverse of @FlyingDiver's patch? i.e. to add POST_KEY_APPLICATION?
What @Rico99 brought up is a bug. And because of the complication with PLIST_KEY_SENDDETAILSISOPTIONAL @FlyingDiver rather removed it altogether.
IMO it's better to actually fix the bug and stay backwards compatible.