EddyVerbruggen / nativescript-fabric

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

NativeScript Fabric Plugin apple android

Greenkeeper badge Build Status npm version Maintainability

Plugin is still WIP

NPM

Feel free to donate

Click here to lend your support and make a donation at www.pledgie.com ! Or donate Bitcoins: bitcoin:3NKtxw1SRYgess5ev4Ri54GekoAgkR213D

Bitcoin

Also via greenaddress

Usage

Installation

$ tns plugin add nativescript-fabric

Or if you want to use the development version (nightly build), which maybe not stable!:

$ tns plugin add nativescript-fabric@next

Go to Crashlytics and pick of the needed API-Key and API-Secret:

Create a file fabric.json in the project root folder and add the API-Key and API-Secret:

{
    "using_ios": true,
    "using_android": true,
    "api_key": "...",
    "api_secret": "..."
}

Android

Add the API-Key to your AndroidManifest.xml:

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="__PACKAGE__" android:versionCode="385" android:versionName="1.0.14">
 ....
  <application android:name="com.tns.NativeScriptApplication" android:allowBackup="true" android:icon="@drawable/icon" android:label="@string/app_name" android:theme="@style/AppTheme">
    ...
    <meta-data android:name="io.fabric.ApiKey" android:value="**<API-KEY>**"/>
  </application>
</manifest>

iOS

No further confiugration needed

Additional information

Android

For more details see fabric.io/kits/android/crashlytics.

iOS

For more details see fabric.io/kits/ios/crashlytics.

API

Init the plugin in your app (for angular apps use main.ts):

import { Fabric } from 'nativescript-fabric';
Fabric.init();

Afterwards you can use the instance methods for logging (general error logging is already added):

  • Fabric.logSignUp(method: string, success: boolean);
  • Fabric.logLogin(method: string, success: boolean);
  • Fabric.logContentView(id: string, name: string, type: string)
  • Fabric.logCustomEvent(withName: string, customAttributes: Map<String, String>)
  • Fabric.logError(error: any, msg?: string)

Angular

import { FabricModule } from 'nativescript-fabric/angular';

NgModule({
  ...
  imports: [
    FabricModule.forRoot()
  ],

About

License:MIT License


Languages

Language:JavaScript 84.3%Language:TypeScript 13.6%Language:HTML 1.7%Language:CSS 0.3%