GithubHelp home page GithubHelp logo

papiguy / shakereport Goto Github PK

View Code? Open in Web Editor NEW

This project forked from jayztemplier/shakereport

0.0 3.0 0.0 13.94 MB

Shake it and report bugs!

License: MIT License

Objective-C 99.12% Shell 0.06% Ruby 0.81%

shakereport's Introduction

Build Status

SRReport

SRReport is a small library which make easy for your testers to report bugs. Shake the iDevice, and they will send:

  • a screenshot of the current view
  • the logs of the current session
  • the crash report if a crash has been reported
  • the dumped view hierarchy

Go to our website to get more information

Installation

If you use Cocoapods, add the ShakeReport pod to your Podfile.

OR

Add those frameworks to your target:

  • QuartzCore
  • MessageUI
  • CoreVideo
  • CoreMedia
  • AVFoundation
  • AssetsLibrary

Copy the library folder in your project.

Include SRReporter.h

Then, copy this line to start the reporter:

- (BOOL)application:(UIApplication *)application 
		didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
	[[SRReporter reporter] startListener]; //this line starts the reporter
	return YES;
}

Usage

Shake the iDevice when you want to report something. A Mail Composer view will appear with all the information that will be send. The tester can add some explanation, and change the recipient of the email.

Configurations

Where should you start the listener ?

Ideally, you want to start the listen when the application becomes active, and stop it when it enters in background: - (void)applicationDidBecomeActive:(UIApplication *)application { [[SRReporter reporter] startListener]; }

- (void)applicationDidEnterBackground:(UIApplication *)application
{
		[[SRReporter reporter] stopListener];
}

Without Screen Capture

You can setup the default email address that should receive the reports:

SRReporter *reporter = [SRReporter reporter];
[reporter setDefaultEmailAddress:@"[email protected]"];
[reporter startListener];

With Screen Capture

You basically have 2 options. The first one is to record the entire session: #include "SRVideoReporter.h"

SRVideoReporter *reporter = [SRVideoReporter reporter];
NSURL *url = [NSURL URLWithString:@"http://localhost:3000"];
[reporter setApplicationToken:@"token_of_the_application"];
[reporter startListenerConnectedToBackendURL:url];
[reporter startScreenRecorder];

But be careful, the entire video will be recorded on the user's device. That's why we recommend you to set a max duration for the video. To do so, you just have to replace the last line of the previous example by:

// replace [reporter startScreenRecorder]; by
[reporter startScreenRecorderWithMaxDurationPerVideo:30]; //max duration = 30 sec

Additional Information

If you need to add custom information to the reports sent by email, you can do it!

[reporter setCustomInformationBlock:^NSString *{
    return [NSString stringWithFormat:@"Application: Sample Application, User: Jayztemplier, Device Name: %@", [[UIDevice currentDevice] name]];
}];

The block has to return a string which will be inserted in the additionalInformation.log file.

Use it with a Backend

You can also use Shake Report with a backend. And guess what!? It's open source too! https://github.com/jayztemplier/ShakeReportServer

To send the reports to the server, setup the listener like that:

SRReporter *reporter = [SRReporter reporter];
// Send data to a Server instead of displaying the mail composer
NSURL *url = [NSURL URLWithString:@"http://localhost:3000/reports.json"];
[reporter startListenerConnectedToBackendURL:url];

If you backend requires to provide an application token, you have to setup the reporter:

[reporter setApplicationToken:@"token_of_the_application"];

Tips

Manually display the report composer

[[SRReporter reporter] displayReportComposer];

Disable the Shake motion detection

[reporter setDisplayReportComposerWhenShakeDevice:NO];

Known Issues

  • with screen capture enable, the second report does not contain the video.

License

SRReport is available under the MIT license. See the LICENSE file for more info

Inspiration & Help from others

AFNetworking

I would like to mention AFNetworking, super useful HTTP library. I used it to create the http request that upload the video to the SRReport backend. I explicitely renamed AFHTTPClient in SRHTTPClient to allow users to use AFNetworking v2 or v1.x without having any conflict with SRReport

shakereport's People

Contributors

jayztemplier avatar jvanmetre avatar snehaviewglass avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.