Reattempt sending reports

20 views
Skip to first unread message

Jason Au

unread,
Aug 25, 2016, 12:50:29 PM8/25/16
to acra-discuss

There are some app that are made to target users whom lack data connections. Such situation means reports will be rarely delivered successfully, as report delivery require a data connection while the crash/exception-logging is happening or when the app is relaunching.

A method to dynamically reattempt pending reports will be great. However ErrorReporter's checkReportsOnApplicationStart has been deprecated for a while.

Is there a good reason for ACRA not to have a public function reattemptUnsentReport?

If so, can one branch off and use the below code without any problems?

// code is borrowed from init
public static void reattemptUnsentReport(){
       final boolean senderServiceProcess = isACRASenderServiceProcess();
       ACRAConfiguration config = configProxy;

        if (isACRASenderServiceProcess()) {
            final ApplicationStartupProcessor startupProcessor = new ApplicationStartupProcessor(mApplication,  config);
            if (config.deleteOldUnsentReportsOnApplicationStart()) {
                startupProcessor.deleteUnsentReportsFromOldAppVersion();
            }
            if (config.deleteUnapprovedReportsOnApplicationStart()) {
                startupProcessor.deleteAllUnapprovedReportsBarOne();
            }
            if (enableAcra) {
                startupProcessor.sendApprovedReports();
            }
}

William Ferguson

unread,
Sep 6, 2016, 1:34:08 AM9/6/16
to acra-discuss
You need to use

if (!isACRASenderServiceProcess()) {


And yes, there is no reason why ACRA couldn't have an explicit #sendUnsentReports method.

William
Reply all
Reply to author
Forward
0 new messages