BARK (Better App Reporting Kit) is a simple, in-app issue reporting library for iOS. Shaking the app pulls up an action sheet, where beta users can instantly send email or create GitHub issues.
## Get Started ##- Add BARK to your Podfile
pod 'Bark', '~> 0.1'
or clone the repository withgit clone git@github.com:stagebloc/bark.git
- Link the following frameworks in the Build Phases tab:
MessageUI
- to send emails from within the appSystemConfiguration
- for network reachability supportSecurity
- for secure storage of GitHub credentials
- In your
AppDelegate.m
,#import "SBWindow.h"
- Finally, set
self.window
equal to the SBWindow subclass, as shown below - make sure to setwindow.repositoryName
to the name of the repository you want to submit issues to.
// an example applicationdidFinishLaunchingWithOptions method
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
SBWindow *window = [[SBWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
window.repositoryName = @"stagebloc/bark";
self.window = window;
// Override point for customization after application launch.
SBRootViewController *rootViewController = [[SBRootViewController alloc] init];
self.window.rootViewController = rootViewController;
self.window.backgroundColor = [UIColor whiteColor];
[self.window makeKeyAndVisible];
return YES;
}
BARK comes with a set of features to make quick adjustments. You can set these below repositoryName
on the window object.
// email
window.emailRecipients = @[@"hi@stagebloc.com", @"ratchet@stagebloc.com"];
window.emailSubject = @"Subject";
window.emailBody = @"Body"; // note that this will override sending device info
window.attachScreenshot = YES; // defaults to YES
// github
window.defaultAssignee = @"your_username";
window.defaultMilestone = @"milestone_title";
window.attachDeviceInfo = YES; // defaults to YES
Submitting images through the GitHub API is currently unsupported. We're planning to build a workaround to make this possible, so you'll soon be able to attach screenshots to GitHub issues as well.
BARK can now be used in production by implementing a simple callback.
- Add the
SBWindowDelegate
to yourAppDelegate.h
file.
#import "SBWindow.h"
@interface SBAppDelegate : UIResponder <UIApplicationDelegate, SBWindowDelegate>
- Set the delegate property on your
SBWindow
instance in yourAppDelegate.m
file. Note that the property is calledwindowDelegate
as opposed todelegate
. This is to avoid interfering with thedelegate
property on theUIWindow
superclass.
window.windowDelegate = self;
- Implement the delegate method
shouldShowActionSheet
. You'll need to create your own way of determining whether or not the current user is an admin. We check against the logged in user's email address.
- (BOOL)shouldShowActionSheet
{
/* add the logic to determine whether or not to show the action sheet. Something like:
if([currentUser isAdmin]) {
return YES;
} else return NO;
*/
return YES;
}
BARK is published under the MIT License (MIT)
Copyright (c) 2013 StageBloc
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.