rollbar / rollbar-ios

Objective-C library for crash reporting and logging with Rollbar.

Home Page:https://docs.rollbar.com/docs/ios

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Can't use Rollbar in extension

deni2s opened this issue · comments

I tried to implement Rollbar into app action extension and it isn't compiling because of this error in Xcode in KSCrashReportSinkEmail.m line 140

'sharedApplication' is unavailable: not available on iOS (App Extension) - Use view controller based solutions where appropriate instead.

@deni2s , would you be able to post here a repro project for this compilation error?

@akornich sorry, but no, don't have time for that, and project I am working on is under NDA.
The issue is that app extensions shouldn't access UIApplication.shared object, so it's not compiling (even if there are ways to avoid that, like described here https://medium.com/@rob.jonson/swift-how-to-use-unsafe-code-in-a-framework-used-by-extensions-50a0705788f2

@deni2s , btw, this one also looks like an issue that can be only fixed on the KSCrash side (if I understand the issue correctly).

@akornich, yes, it seems that way.

@deni2s, this issue should not be a problem in the context of this SDK's replacement: Rollbar-Apple. It has an optional dependency on KSCrash. Also, KSCrash went through some recent updates as well, so you may want to try the new SDK even with the optional KSCrash module enabled.