Skip to content

peutetre/cordova-plugin-acra

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

cordova-plugin-acra

What it does

Android

Bundles the Acra client library, and catch all Javascript errors to send them to the server in addition to Java exceptions.

iOS

Catch all javascripts errors by listening to window.onerror and send them to the server.

Javascript errors being all seen as the same Java exception, custom fields are included:

CUSTOM_DATA -> sourceId
CUSTOM_DATA -> line
CUSTOM_DATA -> message

Dependencies

This plugins depends on the Cordova Device plugin: org.apache.cordova.device

Usage

  • Install the plugin to your Cordova application: cordova plugin add path-to-plugin-folder
  • for Android ** As the documentation of Acra says, create an Application class with the ReportsCrashes annotation with the address to your acra server like
package com.mycompany.MyAppPackage;

import android.app.Application;
import org.acra.ACRA;
import org.acra.annotation.ReportsCrashes;
import org.acra.sender.HttpSender;

@ReportsCrashes(
    formKey = "",
    httpMethod = HttpSender.Method.POST,
    reportType = HttpSender.Type.JSON,
    formUri = "http://my-acra-server/report"
)
public class MyApp extends Application {

    @Override
    public void onCreate() {
        super.onCreate();
        ACRA.init(this);
    }

}

then tell the AndroidManifest.xml to point to that Application by adding the following attribute

android:name=".MyApp"

to the application tag in the AndroidManifest.xml

  • for iOS, you need to provide the following 3 global variables:
// the url of the acra service
ACRA_SERVER = "http://my-server";
// the version of you app
APP_VERSION_NAME = "1.0.0";
// the bundle id of your app, this is the cordova id and
this makes your app unique
PACKAGE_NAME = "my-bundle-id";

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 94.2%
  • Java 5.8%