Swiftpack.co - softnoesis/ShakeBug as Swift Package

Swiftpack.co is a collection of thousands of indexed Swift packages. Search packages.
See all packages published by softnoesis.
softnoesis/ShakeBug 1.0.34
Bug & Crash reporting tool.
⭐️ 0
🕓 4 weeks ago
.package(url: "https://github.com/softnoesis/ShakeBug.git", from: "1.0.34")

ShakeBug

pod twitter linkedin

Shakebug allows you to receive feedback from your beta testers or real users and improve the quality of your application in a simple way. Here users just need to shake their mobile and all the data regarding bugs & crashes can be seen by developers through their log in panel. It also helpful to analyse your users, session, location etc. Addition, you can add events on each action of your application and track it using this Shakebug framework.

Sign up for a service at https://www.shakebug.com

Supported following type of iOS projects

  1. Swift
  2. Objective-C
  3. SwiftUI
  4. Project with and without SceneDeleage

Features

✅ Image bug reporting

✅ Screen-Recording bug beporting

✅ Automatic Crash reporting

✅ Analytics

✅ Events

✅ Custom theme color, title and error message

✅ On-premise hosting

Compatibility

  • Minimum iOS deployment 13.0
  • Minimum Mac OS deployment 10.15
  • Carthage release for Swift is built with Xcode 13.0 or later
  • CocoaPods: 1.10 or later.

Installation

CocoaPods

To integrate ShakeBug into your Xcode project using CocoaPods, specify it in your Podfile:

pod 'ShakeBug'

Then, run the following command:

$ pod install

Carthage

Add following line to your Xcode project's Cartfile

github "softnoesis/ShakeBug"

Then, run the following command:

$ carthage update

Then drag Shakebug.xcframework from Carthage folder to your Xcode project's settings.

Swift Package Manager

Navigate to the SPM section in your project, add a new package, point it to

https://github.com/softnoesis/ShakeBug/

and select the latest version.

Code

  1. Import the ShakeBug framework header into your app delegate.

    // Swift
    import ShakeBug
    
    // Objective-C
    #import <ShakeBug/ShakeBug.h>
    
  2. Add the following to your app delegate's application:didFinishLaunchingWithOptions: method.

    // Swift
    ShakeBugSDK.sharedInstance.initiateWithKey(“<Your Key>")
    
    // Objective-C
    [[ShakeBugSDK sharedInstance] initiateWithKey:@"<Your Key>"];
    

    Be sure to replace <Your Key> with your application key which given by ShakeBug website.

Note:

NSPhotoLibraryUsageDescription must be added in info.plist.

Optional Settings

  1. Add the following to your app delegate's application:didFinishLaunchingWithOptions: method for showing or not showing first time tutorial screen
// Swift
ShakeBugSDK.sharedInstance.showTutorialScreenFirstTime(false) // Default value True
// Objective-C
[[ShakeBugSDK sharedInstance] showTutorialScreenFirstTime:NO];// Default value YES
  1. If you want to show bug or crash from Simulator then use following code application:didFinishLaunchingWithOptions:
// Swift
ShakeBugSDK.sharedInstance.allowBugCrashFromSimulator(true) // Default value false
// Objective-C
[[ShakeBugSDK sharedInstance] allowCrashFromSimulator:YES];// Default value NO
  1. If you dont want to show any logs on console then use following code application:didFinishLaunchingWithOptions:
// Swift
ShakeBugSDK.sharedInstance.makeLogEnabled(false) // Default value false
// Objective-C
[[ShakeBugSDK sharedInstance] makeLogEnabled:NO];// Default value NO
  1. If you want to set forcefully any language for the bug reporting screen then use following code application:didFinishLaunchingWithOptions:
// Swift
ShakeBugSDK.sharedInstance.setShakebugSDKLanguage(ShakebugLanguage.french) 
// Objective-C
[[ShakeBugSDK sharedInstance] setShakebugSDKLanguage:ShakebugLanguage.french];

Note: Just mind that here, by default it will take device language as defualt language.

  1. Developer can also set custome theme color in Shakebug SDK screens:
// Swift
ShakeBugSDK.sharedInstance.setShakebugThemeColor(UIColor.green)
// Objective-C
[[ShakeBugSDK sharedInstance] setShakebugThemeColor:[UIColor greenColor]];
  1. Developer can also set custom title for Shakebug annotate and feedback input screen:
// Swift
ShakeBugSDK.sharedInstance.changeSDKScreenTitle("Annotate your Bug", "Feedback") 
// Objective-C
[[ShakeBugSDK sharedInstance] changeSDKScreenTitle:@"Annotate your bug" :@"Add detail"];
  1. Set custom error message for any error alert screen from SDK.
// Swift
ShakeBugSDK.sharedInstance.changeSDKErrorAlertMessage("This Error")
// Objective-C
[[ShakeBugSDK sharedInstance] changeSDKErrorAlertMessage:@"Something wrong.."];
  1. If you have on-premise hosting plan then following method will be used.
// Swift
ShakeBugSDK.sharedInstance.setShakebugSDKEndPointURL(url: "", headerKey: "", sslPublicKey: "")
// Objective-C
[[ShakeBugSDK sharedInstance] setShakebugSDKEndPointURLWithUrl:@"" headerKey:@"" sslPublicKey:@""];

Note: New enpoint url, its header key and SSL public key(Optional)

  1. User can report bug either by shaking phone or by triggering default screen capture event. This method can be used to manage "screen capture" event should trigger bug reporting or not.
// Swift
ShakeBugSDK.sharedInstance.allowToReportBugByScreenCapture(false) // Default value true
// Objective-C
[[ShakeBugSDK sharedInstance] allowToReportBugByScreenCapture:NO]; // Default value YES
  1. User can report bug either by shaking phone or by triggering default screen capture event. This method can be used to manage "shaking mobile" should trigger bug reporting or not.
// Swift
ShakeBugSDK.sharedInstance.allowToReportBugByShakingMobile(true) // Default value true
// Objective-C
[[ShakeBugSDK sharedInstance] allowToReportBugByShakingMobile:YES]; // Default value YES

Events

If you want add event to any screen or activity use following methods

// Swift
ShakeBugSDK.sharedInstance.addEventKey(key:"App_open", eventValue: "Started app") //pass any key or value
// Objective-C
[[ShakeBugSDK sharedInstance] addEventKey:@"App_open" eventValue:@"Started app"];// pass any key or value

Usage

Build & run your app. Once your app is running, shake your device (^⌘Z in the simulator) to report a bug! Bug/Crash reports are sent directly to login panel of Shakebug.com and also notify on your registered email address. Additionally, now user can report bug if they trigger screen capture event in iPhone.

If you want to trigger bug reporting screen without shaking then you can call following method in any button action of any screen.

// Swift
ShakeBugSDK.sharedInstance.triggerBugReporting()
// Objective-C
[[ShakeBugSDK sharedInstance] triggerBugReporting];

Contact

Visit on: https://www.shakebug.com

Contact us on [email protected] in case of any use.

GitHub

link
Stars: 0
Last commit: 4 weeks ago
Advertisement: IndiePitcher.com - Cold Email Software for Startups

Related Packages

Release Notes

1.0.34
4 weeks ago

Feature:

  • Analytics issue resolved
  • Support SDK version in api.

Compatibility:

  • Minimum iOS deployment 13.0
  • Minimum Mac OS deployment 10.15
  • Carthage release for Swift is built with Xcode 13.0 or later
  • CocoaPods: 1.10 or later.

Swiftpack is being maintained by Petr Pavlik | @ptrpavlik | @swiftpackco | API | Analytics