diff --git a/Classes/BITAuthenticator.h b/Classes/BITAuthenticator.h index 240e415a28..2a96e49e83 100644 --- a/Classes/BITAuthenticator.h +++ b/Classes/BITAuthenticator.h @@ -199,10 +199,14 @@ typedef NS_ENUM(NSUInteger, BITAuthenticatorAppRestrictionEnforcementFrequency) @property (nonatomic, copy) NSString *authenticationSecret; /** - * Delegate that can be used to do any last minute configurations on the - * presented viewController. - * - * @see BITAuthenticatorDelegate + Delegate that can be used to do any last minute configurations on the + presented viewController. + + The delegate is automatically set by using `[BITHockeyManager setDelegate:]`. You + should not need to set this delegate individually. + + @see `[BITHockeyManager setDelegate:]` + @see BITAuthenticatorDelegate */ @property (nonatomic, weak) id delegate; diff --git a/Classes/BITCrashAttachment.h b/Classes/BITCrashAttachment.h index 73217a2ac7..e3bd6875c8 100644 --- a/Classes/BITCrashAttachment.h +++ b/Classes/BITCrashAttachment.h @@ -53,9 +53,9 @@ /** * Create an BITCrashAttachment instance with a given filename and NSData object * - * @param filename The filename the attachment should get - * @param attachmentData The attachment data as NSData - * @param contentType The content type of your data as MIME type + * @param filename The filename the attachment should get + * @param crashAttachmentData The attachment data as NSData + * @param contentType The content type of your data as MIME type * * @return An instsance of BITCrashAttachment */ diff --git a/Classes/BITCrashDetails.h b/Classes/BITCrashDetails.h index 4cd8fb7321..aa176453cc 100644 --- a/Classes/BITCrashDetails.h +++ b/Classes/BITCrashDetails.h @@ -28,6 +28,9 @@ #import +/** + * Provides details about the crash that occured in the previous app session + */ @interface BITCrashDetails : NSObject /** @@ -80,7 +83,7 @@ took too long to startup or blocks the main thread for too long, or other reasons. See Apple documentation: https://developer.apple.com/library/ios/qa/qa1693/_index.html - See `[BITCrashManager enableDectionAppKillWhileInForeground]` for more details about which kind of kills can be detected. + See `[BITCrashManager enableAppNotTerminatingCleanlyDetection]` for more details about which kind of kills can be detected. @warning This property only has a correct value, once `[BITHockeyManager startManager]` was invoked! In addition, it is automatically disabled while a debugger session is active! diff --git a/Classes/BITCrashManager.h b/Classes/BITCrashManager.h index 3a72a5fecc..a3dc213bc3 100644 --- a/Classes/BITCrashManager.h +++ b/Classes/BITCrashManager.h @@ -163,6 +163,11 @@ typedef NS_ENUM(NSUInteger, BITCrashManagerUserInput) { /** Sets the optional `BITCrashManagerDelegate` delegate. + + The delegate is automatically set by using `[BITHockeyManager setDelegate:]`. You + should not need to set this delegate individually. + + @see `[BITHockeyManager setDelegate:]` */ @property (nonatomic, weak) id delegate; @@ -290,8 +295,8 @@ typedef NS_ENUM(NSUInteger, BITCrashManagerUserInput) { * * Documentation taken from PLCrashReporter: https://www.plcrashreporter.org/documentation/api/v1.2-rc2/async_safety.html * - * @see `BITCrashManagerPostCrashSignalCallback` - * @see `BITCrashManagerCallbacks` + * @see BITCrashManagerPostCrashSignalCallback + * @see BITCrashManagerCallbacks * * @param callbacks A pointer to an initialized PLCrashReporterCallback structure, see https://www.plcrashreporter.org/documentation/api/v1.2-rc2/struct_p_l_crash_reporter_callbacks.html */ @@ -349,11 +354,21 @@ typedef NS_ENUM(NSUInteger, BITCrashManagerUserInput) { Lets you set a custom block which handles showing a custom UI and asking the user whether he wants to send the crash report. + This replaces the default alert the SDK would show! + + You can use this to present any kind of user interface which asks the user for additional information, + e.g. what they did in the app before the app crashed. + + In addition to this you should always ask your users if they agree to send crash reports, send them + always or not and return the result when calling `handleUserInput:withUserProvidedCrashDescription`. + @param alertViewHandler A block that is responsible for loading, presenting and and dismissing your custom user interface which prompts the user if he wants to send crash reports. The block is also responsible for triggering further processing of the crash reports. - @warning Block needs to call the `handleUserInput:withUserProvidedCrashDescription` method! + @warning Block needs to call the `[BITCrashManager handleUserInput:withUserProvidedMetaData:]` method! + + @warning This needs to be set before calling `[BITHockeyManager startManager]`! */ -- (void) setAlertViewHandler:(BITCustomAlertViewHandler)alertViewHandler; +- (void)setAlertViewHandler:(BITCustomAlertViewHandler)alertViewHandler; /** * Provides details about the crash that occured in the last app session diff --git a/Classes/BITCrashMetaData.h b/Classes/BITCrashMetaData.h index ac6bb2b650..a7c5a96c0c 100644 --- a/Classes/BITCrashMetaData.h +++ b/Classes/BITCrashMetaData.h @@ -29,6 +29,9 @@ #import +/** + * This class provides properties that can be attached to a crash report via a custom alert view flow + */ @interface BITCrashMetaData : NSObject /** diff --git a/Classes/BITFeedbackComposeViewController.h b/Classes/BITFeedbackComposeViewController.h index 2ef4f84664..9d3285122e 100644 --- a/Classes/BITFeedbackComposeViewController.h +++ b/Classes/BITFeedbackComposeViewController.h @@ -55,6 +55,11 @@ /** Sets the `BITFeedbackComposeViewControllerDelegate` delegate. + + The delegate is automatically set by using `[BITHockeyManager setDelegate:]`. You + should not need to set this delegate individually. + + @see `[BITHockeyManager setDelegate:`] */ @property (nonatomic, weak) id delegate; diff --git a/Classes/BITFeedbackComposeViewController.m b/Classes/BITFeedbackComposeViewController.m index 1677536289..d7dbb896ff 100644 --- a/Classes/BITFeedbackComposeViewController.m +++ b/Classes/BITFeedbackComposeViewController.m @@ -237,8 +237,6 @@ [[UIApplication sharedApplication] setStatusBarStyle:(self.navigationController.navigationBar.barStyle == UIBarStyleDefault) ? UIStatusBarStyleDefault : UIStatusBarStyleBlackOpaque]; #endif - // [self.textView setFrame:self.view.frame]; - if (_text) { self.textView.text = _text; } diff --git a/Classes/BITFeedbackManager.h b/Classes/BITFeedbackManager.h index 2056d1486d..66ad75e2e5 100644 --- a/Classes/BITFeedbackManager.h +++ b/Classes/BITFeedbackManager.h @@ -88,6 +88,11 @@ typedef NS_ENUM(NSInteger, BITFeedbackObservationMode) { This is the HockeySDK module for letting your users to communicate directly with you via the app and an integrated user interface. It provides to have a single threaded discussion with a user running your app. + + You should never create your own instance of `BITFeedbackManager` but use the one provided + by the `[BITHockeyManager sharedHockeyManager]`: + + [BITHockeyManager sharedHockeyManager].feedbackManager The user interface provides a list view than can be presented modally using `[BITFeedbackManager showFeedbackListView]` modally or adding @@ -140,6 +145,11 @@ typedef NS_ENUM(NSInteger, BITFeedbackObservationMode) { Sets the `BITFeedbackManagerDelegate` delegate. Can be set to be notified when new feedback is received from the server. + + The delegate is automatically set by using `[BITHockeyManager setDelegate:]`. You + should not need to set this delegate individually. + + @see `[BITHockeyManager setDelegate:`] */ @property (nonatomic, weak) id delegate; @@ -282,6 +292,7 @@ typedef NS_ENUM(NSInteger, BITFeedbackObservationMode) { /** Present the modal feedback compose message user interface with the items given. + All NSString-Content in the array will be concatenated and result in the message, while all UIImage and NSData-instances will be turned into attachments. */ diff --git a/Classes/BITFeedbackManager.m b/Classes/BITFeedbackManager.m index 056266fc23..3357f92f19 100644 --- a/Classes/BITFeedbackManager.m +++ b/Classes/BITFeedbackManager.m @@ -29,10 +29,10 @@ #import "HockeySDK.h" -#import - #if HOCKEYSDK_FEATURE_FEEDBACK +#import + #import "HockeySDKPrivate.h" #import "BITFeedbackManager.h" diff --git a/Classes/BITFeedbackMessage.h b/Classes/BITFeedbackMessage.h index 908e4fc8fd..f754e30c59 100644 --- a/Classes/BITFeedbackMessage.h +++ b/Classes/BITFeedbackMessage.h @@ -61,6 +61,9 @@ typedef NS_ENUM(NSInteger, BITFeedbackMessageStatus) { BITFeedbackMessageStatusArchived = 5 }; +/** + * An individual feedback message + */ @interface BITFeedbackMessage : NSObject { } diff --git a/Classes/BITFeedbackMessageAttachment.h b/Classes/BITFeedbackMessageAttachment.h index dbb398b1da..d79971391a 100644 --- a/Classes/BITFeedbackMessageAttachment.h +++ b/Classes/BITFeedbackMessageAttachment.h @@ -30,6 +30,9 @@ #import #import +/** + * An individual feedback message attachment + */ @interface BITFeedbackMessageAttachment : NSObject @property (nonatomic, copy) NSNumber *id; diff --git a/Classes/BITUpdateManager.h b/Classes/BITUpdateManager.h index 4425363d03..f10f8c30d3 100644 --- a/Classes/BITUpdateManager.h +++ b/Classes/BITUpdateManager.h @@ -82,6 +82,11 @@ typedef NS_ENUM (NSUInteger, BITUpdateSetting) { /** Sets the `BITUpdateManagerDelegate` delegate. + + The delegate is automatically set by using `[BITHockeyManager setDelegate:]`. You + should not need to set this delegate individually. + + @see `[BITHockeyManager setDelegate:]` */ @property (nonatomic, weak) id delegate; diff --git a/Support/HockeySDK.xcodeproj/project.pbxproj b/Support/HockeySDK.xcodeproj/project.pbxproj index 751e04ef51..f5e47d0d92 100644 --- a/Support/HockeySDK.xcodeproj/project.pbxproj +++ b/Support/HockeySDK.xcodeproj/project.pbxproj @@ -987,7 +987,7 @@ ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; - shellScript = "/usr/local/bin/appledoc \\\n --output \"${SOURCE_ROOT}/../documentation\" \\\n --ignore Vendor \\\n --ignore Products \\\n --ignore Support \\\n --ignore .m \\\n --ignore *Private.h \\\n --ignore BITAttributedLabel.h \\\n --ignore BITStoreButton.h \\\n --ignore BITFeedbackListViewCell.h \\\n --ignore BITAppStoreHeader.h \\\n --ignore BITFeedbackMessage.h \\\n --ignore BITAuthenticationViewController.h \\\n --create-html \\\n --create-docset \\\n --install-docset \\\n --keep-intermediate-files \\\n --project-name \"${HOCKEYSDK_DOCSET_NAME} ${VERSION_STRING}\" \\\n --project-version \"${VERSION_STRING}\" \\\n --project-company \"Bit Stadium GmbH\" \\\n --company-id \"de.bitstadium\" \\\n --docset-bundle-name \"${HOCKEYSDK_DOCSET_NAME} ${VERSION_STRING}\" \\\n --docset-feed-name \"${HOCKEYSDK_DOCSET_NAME}\" \\\n --docset-desc \"\" \\\n --docset-platform-family \"iphoneos\" \\\n --index-desc \"${SOURCE_ROOT}/../docs/index.md\" \\\n --include \"${SOURCE_ROOT}/../docs/index.html\" \\\n --include \"${SOURCE_ROOT}/../docs/\" \\\n --merge-categories \\\n --no-repeat-first-par \\\n --warn-undocumented-object \\\n --warn-undocumented-member \\\n --warn-empty-description \\\n --warn-unknown-directive \\\n --warn-invalid-crossref \\\n --warn-missing-arg \\\n --logformat xcode \\\n --exit-threshold 2 \\\n \"${SOURCE_ROOT}/../\"\n"; + shellScript = "/usr/local/bin/appledoc \\\n --output \"${SOURCE_ROOT}/../documentation\" \\\n --ignore Vendor \\\n --ignore Products \\\n --ignore Support \\\n --ignore .m \\\n --ignore *Private.h \\\n --ignore BITAttributedLabel.h \\\n --ignore BITStoreButton.h \\\n --ignore BITFeedbackListViewCell.h \\\n --ignore BITAppStoreHeader.h \\\n --ignore BITFeedbackMessage.h \\\n --ignore BITFeedbackMessageAttachment.h \\\n --ignore BITAuthenticationViewController.h \\\n --ignore BITHockeyAppClient.h \\\n --create-html \\\n --create-docset \\\n --install-docset \\\n --keep-intermediate-files \\\n --project-name \"${HOCKEYSDK_DOCSET_NAME} ${VERSION_STRING}\" \\\n --project-version \"${VERSION_STRING}\" \\\n --project-company \"Bit Stadium GmbH\" \\\n --company-id \"de.bitstadium\" \\\n --docset-bundle-name \"${HOCKEYSDK_DOCSET_NAME} ${VERSION_STRING}\" \\\n --docset-feed-name \"${HOCKEYSDK_DOCSET_NAME}\" \\\n --docset-desc \"\" \\\n --docset-platform-family \"iphoneos\" \\\n --index-desc \"${SOURCE_ROOT}/../docs/index.md\" \\\n --include \"${SOURCE_ROOT}/../docs/index.html\" \\\n --include \"${SOURCE_ROOT}/../docs/\" \\\n --merge-categories \\\n --no-repeat-first-par \\\n --warn-undocumented-object \\\n --warn-undocumented-member \\\n --warn-empty-description \\\n --warn-unknown-directive \\\n --warn-invalid-crossref \\\n --warn-missing-arg \\\n --logformat xcode \\\n --exit-threshold 2 \\\n \"${SOURCE_ROOT}/../\"\n"; }; 1EE9071A16F6871F003DDE1D /* ShellScript */ = { isa = PBXShellScriptBuildPhase; diff --git a/docs/Guide-Installation-Mac-App-template.md b/docs/Guide-Installation-Mac-App-template.md index 2cd95e3493..e911487544 100644 --- a/docs/Guide-Installation-Mac-App-template.md +++ b/docs/Guide-Installation-Mac-App-template.md @@ -1,7 +1,7 @@ ## Introduction -HockeyMac is a simple client application for Mac OS 10.6 or higher to upload files to HockeyApp. After the installation, you can drag & drop either .ipa files or .xcarchive bundles to the dock or menu icon. HockeyMac will then open a window to enter release notes and set the download flag of the version. The upload is shown with a progress bar and there is some minimal error handling. +HockeyMac is a simple client application for Mac OS 10.8 or higher to upload files to HockeyApp. After the installation, you can drag & drop either .ipa files or .xcarchive bundles to the dock or menu icon. HockeyMac will then open a window to enter release notes and set the download flag of the version. The upload is shown with a progress bar and there is some minimal error handling. This document contains the following sections: @@ -14,7 +14,7 @@ This document contains the following sections: ## Prerequisites -1. Mac OS X 10.6 +1. Mac OS X 10.8 2. Xcode 4 diff --git a/docs/HowTo-Integrate-Atlassian-JMC-template.md b/docs/HowTo-Integrate-Atlassian-JMC-template.md deleted file mode 100644 index 347fbf2089..0000000000 --- a/docs/HowTo-Integrate-Atlassian-JMC-template.md +++ /dev/null @@ -1,37 +0,0 @@ -## Introduction - -The SDK provides integrated support to automatically configure the Atlassian JIRA Mobile Connect (JMC). It will take the JIRA configuration that is associated to your app on HockeyApp and use that to configure JMC. - -## Requirements - -The binary distribution of HockeySDK does not provide this integration. You need to follow the [Installation & Setup Advanced](Guide-Installation-Setup-Advanced) Guide and activate the JMC integration as described below. - -## HowTo - -1. Select `HockeySDK.xcodeproj` project in the Xcode navigator -2. Select `HockeySDKLib` target -3. Search for `Preprocessor Macros` -4. Double tab in the `HockeySDKLib` column and add the following two values - - $(inherited) - HOCKEYSDK_FEATURE_JIRA_MOBILE_CONNECT=1 - -5. Setup JMC as described in the [JMC instructions](https://developer.atlassian.com/display/JMC/Enabling+JIRA+Mobile+Connect) -6. Sign in to HockeyApp -7. Select the app and edit the apps bug tracker -8. Choose `JIRA` or `JIRA5`. -9. Enter your JIRA credentials. Make sure you supply the credentials for a user with admin rights, otherwise HockeyApp cannot fetch the JMC token from JIRA. -10. Download the latest JMC client file: [https://bitbucket.org/atlassian/jiraconnect-ios/downloads](https://bitbucket.org/atlassian/jiraconnect-ios/downloads) -11. Unzip the file and move the folder into your project directory. -12. Drag & drop the JMC folder from your project directory to your Xcode project. Select `Create groups for any added folders` and set the checkmark for your target. Then click `Finish`. -13. The class `BITHockeyManager` automatically fetches the API token and project key for JMC from HockeyApp, so you don't need to adjust the configuration in your AppDelegate.m file. The only thing you need to do is find a place in your UI to open the feedback view, such as a button and table view cell. You can then open the feedback view as follows: - - In SomeViewController.m: - - [self presentModalViewController:[[JMC sharedInstance] viewController] animated:YES]; - -14. You can customize the options of JMC like this: - - In AppDelegate.m: - - [[[JMC sharedInstance] options] setBarStyle:UIBarStyleBlack]; diff --git a/docs/HowTo-Set-Custom-AlertViewHandler-template.md b/docs/HowTo-Set-Custom-AlertViewHandler-template.md new file mode 100644 index 0000000000..cf70b001b9 --- /dev/null +++ b/docs/HowTo-Set-Custom-AlertViewHandler-template.md @@ -0,0 +1,73 @@ +## Introduction + +HockeySDK lets the user decide wether to send a crash report or lets the developer send crash reports automatically without user interaction. In addition it is possible to attach more data like logs, a binary, or the users name, email or a user ID if this is already known. + +Starting HockeySDK version 3.6 it is now possible to customize this even further and implement your own flow to e.g. ask the user for more details about what happened or his name and email address if your app doesn't know that yet. + +The following example shows how this could be implemented. We'll present a custom UIAlertView asking the user for more details and attaching that to the crash report. + +## HowTo + +1. Setup the SDK +2. Configure HockeySDK to use your custom alertview handler using the `[[BITHockeyManager sharedHockeyManager].crashManager setAlertViewHandler:(BITCustomAlertViewHandler)alertViewHandler;` method in your AppDelegate. +3. Implement your handler in a way that it calls `[[BITHockeyManager sharedHockeyManager].crashManagerhandleUserInput:(BITCrashManagerUserInput)userInput withUserProvidedMetaData:(BITCrashMetaData *)userProvidedMetaData]` with the input provided by the user. +4. Dismiss your custom view. + +## Example + + @interface BITAppDelegate () + @end + + + @implementation BITAppDelegate + + - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { + [self.window makeKeyAndVisible]; + + [[BITHockeyManager sharedHockeyManager] configureWithIdentifier:@"<>" + delegate:nil]; + + // optionally enable logging to get more information about states. + [BITHockeyManager sharedHockeyManager].debugLogEnabled = YES; + + [[BITHockeyManager sharedHockeyManager].crashManager setAlertViewHandler:^(){ + NSString *exceptionReason = [[BITHockeyManager sharedHockeyManager].crashManager lastSessionCrashDetails].exceptionReason; + UIAlertView *customAlertView = [[UIAlertView alloc] initWithTitle: @"Oh no! The App crashed" + message: nil + delegate: self + cancelButtonTitle: @"Don't send" + otherButtonTitles: @"Send", @"Always send", nil]; + if (exceptionReason) { + customAlertView.message = @"We would like to send a crash report to the developers. Please enter a short description of what happened:"; + customAlertView.alertViewStyle = UIAlertViewStylePlainTextInput; + } else { + customAlertView.message = @"We would like to send a crash report to the developers"; + } + + [customAlertView show]; + }]; + + [[BITHockeyManager sharedHockeyManager].authenticator authenticateInstallation]; + + return YES; + } + + - (void)alertView:(UIAlertView *)alertView didDismissWithButtonIndex:(NSInteger)buttonIndex { + BITCrashMetaData *crashMetaData = [BITCrashMetaData new]; + if (alertView.alertViewStyle != UIAlertViewStyleDefault) { + crashMetaData.userDescription = [alertView textFieldAtIndex:0].text; + } + switch (buttonIndex) { + case 0: + [[BITHockeyManager sharedHockeyManager].crashManager handleUserInput:BITCrashManagerUserInputDontSend withUserProvidedMetaData:nil]; + break; + case 1: + [[BITHockeyManager sharedHockeyManager].crashManager handleUserInput:BITCrashManagerUserInputSend withUserProvidedMetaData:crashMetaData]; + break; + case 2: + [[BITHockeyManager sharedHockeyManager].crashManager handleUserInput:BITCrashManagerUserInputAlwaysSend withUserProvidedMetaData:crashMetaData]; + break; + } + } + + @end diff --git a/docs/index.md b/docs/index.md index b8efea064f..ddeb0128df 100644 --- a/docs/index.md +++ b/docs/index.md @@ -36,11 +36,11 @@ The main SDK class is `BITHockeyManager`. It initializes all modules and provide - [How to upload symbols for crash reporting](HowTo-Upload-Symbols) - [How to handle crashes on startup](HowTo-Handle-Crashes-On-Startup) - [How to add application specific log data](HowTo-Add-Application-Log) -- [How to integrate Atlassian JMC](HowTo-Integrate-Atlassian-JMC) +- [How to ask the user for more details about a crash](HowTo-Set-Custom-AlertViewHandler) ## Troubleshooting -- [Symbolication doesn't work](Symbolication-Doesnt-Work) (Or the rules of binary UUIDs and dSYMs) +- [Symbolication doesn't work](Troubleshooting-Symbolication-Doesnt-Work) (Or the rules of binary UUIDs and dSYMs) - [Crash Reporting is not working](Troubleshooting-Crash-Reporting-Not-Working) ## Xcode Documentation