Giter Club home page Giter Club logo

crashlytics-fpcustomhandler's Introduction

FPCrashHandler

FPCustomHandler is a helper class for Crashlytics to allow you run custom NSUncaughtExceptionHandler or signal handler when crash happened.

Warning

FPCustomHandler relies on the underlying implementation details of Crashlytics(version 3.8.4(121)), These may be changed in future Crashlytics releases. At your own risk to use it.

When you implement your custom handlers, please do take Async-Safe Functions into considerations.

Integration

Add pod 'Crashlytics-FPCustomHandler' to your Podfile

    pod 'FPCrashHandler'

Example Swift

func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
    //These methods should be called after start Crashlytics
    FPCrashHandler.setupCustomExceptionHandler { exception in
        NSLog("==> CustomNSExceptionCrashHandler called\n")
    }

    FPCrashHandler.setupCustomSignal { (status, info, context) in
        NSLog("==> CustomSignalCrashHandler called\n");
    }
}

Example ObjC

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
	
	//These methods should be called after start Crashlytics
    [FPCrashHandler setupCustomExceptionHandler:&CustomNSExceptionCrashHandler];
    [FPCrashHandler setupCustomSignalHandler:&CustomSignalCrashHandler];
    return YES;
}
static void CustomNSExceptionCrashHandler(NSException *exception)
{
    NSLog(@"==> CustomNSExceptionCrashHandler called\n");
}

static void CustomSignalCrashHandler(int signo, siginfo_t *info, void *context)
{
    NSLog(@"==> CustomSignalCrashHandler called\n");
}

Trigger a crash

	//SIGABRT
	abort();
	
	//NSInvalidArgumentException
	NSString* str = nil;
	NSArray* array = @[str];

Or just present the debugOptionsAlert on FPCrashHandler.

You should run the demo app without Xcode's debbuger attached, then you can search the logs with "==>" here:

iOS Simulator -> Debug -> Open System Log (or press Cmd + / in iOS Simulator)

Reference

License

MIT

crashlytics-fpcustomhandler's People

Contributors

hewigovens avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

crashlytics-fpcustomhandler's Issues

Weekly Digest (17 April, 2019 - 24 April, 2019)

Here's the Weekly Digest for hewigovens/Crashlytics-FPCustomHandler:


ISSUES

Last week, no issues were created.


PULL REQUESTS

Last week, no pull requests were created, updated or merged.


COMMITS

Last week there were no commits.


CONTRIBUTORS

Last week there were no contributors.


STARGAZERS

Last week there were no stargazers.


RELEASES

Last week there were no releases.


That's all for last week, please ๐Ÿ‘€ Watch and โญ Star the repository hewigovens/Crashlytics-FPCustomHandler to receive next weekly updates. ๐Ÿ˜ƒ

You can also view all Weekly Digests by clicking here.

Your Weekly Digest bot. ๐Ÿ“†

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.