Shake to send a bug report!
BugShaker allows your users to simply submit bug reports by shaking the device. When a shake is detected, the current screen state is captured and the user is prompted to submit a bug report via a mail composer with the screenshot attached.
Android developers: If you are looking for an Android library with similar functionality, check out stkent/bugshaker-android.
To run the example project, clone the repo, and run pod install
from the Example directory first.
All you have to do to enable bug reporting is import BugShaker
in your AppDelegate
and call the configure()
method in application:didFinishLaunchingWithOptions
,
passing in the array of email recipients and an optional custom subject line:
import BugShaker
@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate {
var window: UIWindow?
func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool {
/**
* Configure ShakeReport with an array of email recipients (required)
* and an optional custom subject line to use for all bug reports.
*/
BugShaker.configure(to: ["example@email.com"], subject: "Bug Report")
return true
}
}
NOTE: There is a known issue with using a mail compose view controller in a simulator. The mail view will either not display at all, or possibly crash the simulator. You will need to run the example on a device to test out the full report compose view functionality.
If you need to disable BugShaker's shake detection for any reason:
BugShaker.enabled = false
BugShaker is available through CocoaPods. To install it, simply add the following line to your Podfile:
pod "BugShaker"
Dan Trenz (@dtrenz) c/o Detroit Labs
BugShaker is available under the Apache License, Version 2.0. See the LICENSE file for more info.