mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-22 22:25:57 +00:00
Various fixes and documentation improvements
This commit is contained in:
@@ -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<BITAuthenticatorDelegate> delegate;
|
||||
|
||||
|
||||
@@ -54,7 +54,7 @@
|
||||
* 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 crashAttachmentData The attachment data as NSData
|
||||
* @param contentType The content type of your data as MIME type
|
||||
*
|
||||
* @return An instsance of BITCrashAttachment
|
||||
|
||||
@@ -28,6 +28,9 @@
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
/**
|
||||
* 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!
|
||||
|
||||
@@ -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,9 +354,19 @@ 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;
|
||||
|
||||
|
||||
@@ -29,6 +29,9 @@
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
|
||||
/**
|
||||
* This class provides properties that can be attached to a crash report via a custom alert view flow
|
||||
*/
|
||||
@interface BITCrashMetaData : NSObject
|
||||
|
||||
/**
|
||||
|
||||
@@ -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<BITFeedbackComposeViewControllerDelegate> delegate;
|
||||
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -89,6 +89,11 @@ typedef NS_ENUM(NSInteger, BITFeedbackObservationMode) {
|
||||
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
|
||||
`[BITFeedbackManager feedbackListViewController:]` to push onto a navigation stack.
|
||||
@@ -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<BITFeedbackManagerDelegate> 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.
|
||||
*/
|
||||
|
||||
@@ -29,10 +29,10 @@
|
||||
|
||||
#import "HockeySDK.h"
|
||||
|
||||
#import <AssetsLibrary/AssetsLibrary.h>
|
||||
|
||||
#if HOCKEYSDK_FEATURE_FEEDBACK
|
||||
|
||||
#import <AssetsLibrary/AssetsLibrary.h>
|
||||
|
||||
#import "HockeySDKPrivate.h"
|
||||
|
||||
#import "BITFeedbackManager.h"
|
||||
|
||||
@@ -61,6 +61,9 @@ typedef NS_ENUM(NSInteger, BITFeedbackMessageStatus) {
|
||||
BITFeedbackMessageStatusArchived = 5
|
||||
};
|
||||
|
||||
/**
|
||||
* An individual feedback message
|
||||
*/
|
||||
@interface BITFeedbackMessage : NSObject {
|
||||
}
|
||||
|
||||
|
||||
@@ -30,6 +30,9 @@
|
||||
#import <UIKit/UIKit.h>
|
||||
#import <QuickLook/QuickLook.h>
|
||||
|
||||
/**
|
||||
* An individual feedback message attachment
|
||||
*/
|
||||
@interface BITFeedbackMessageAttachment : NSObject<NSCoding, QLPreviewItem>
|
||||
|
||||
@property (nonatomic, copy) NSNumber *id;
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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:
|
||||
<a id="prerequisites"></a>
|
||||
## Prerequisites
|
||||
|
||||
1. Mac OS X 10.6
|
||||
1. Mac OS X 10.8
|
||||
2. Xcode 4
|
||||
|
||||
<a id="installation"></a>
|
||||
|
||||
@@ -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];
|
||||
73
docs/HowTo-Set-Custom-AlertViewHandler-template.md
Normal file
73
docs/HowTo-Set-Custom-AlertViewHandler-template.md
Normal file
@@ -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 () <UIAlertViewDelegate>
|
||||
@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
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user