feedbackreporter icon indicating copy to clipboard operation
feedbackreporter copied to clipboard

Email feedback submission example requires "application" parameter

Open Mark-s99 opened this issue 13 years ago • 7 comments

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

Mark-s99 avatar Mar 08 '11 15:03 Mark-s99

Hm ...the server script changed and I am not using the latest version myself. Definitely should default to the application name.

tcurdt avatar Mar 08 '11 15:03 tcurdt

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.

FlyingDiver avatar Aug 30 '11 01:08 FlyingDiver

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]

FlyingDiver avatar Aug 30 '11 02:08 FlyingDiver

@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 avatar Jul 12 '17 15:07 seanm

@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.

tcurdt avatar Jul 12 '17 16:07 tcurdt

Oh, so we want the inverse of @FlyingDiver's patch? i.e. to add POST_KEY_APPLICATION?

seanm avatar Jul 12 '17 16:07 seanm

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.

tcurdt avatar Jul 12 '17 18:07 tcurdt