Ionic Framework 4 is almost here. Preview the beta docs and try it out now! Try Ionic 4 Beta

Answers

Improve this doc

API for interacting with the Answers kit.

https://docs.fabric.io/crashlytics/index.html

Repo: https://www.npmjs.com/package/cordova-fabric-plugin

Installation

  1. Install the Cordova and Ionic Native plugins:
    $ ionic cordova plugin add cordova-fabric-plugin --variable FABRIC_API_KEY=XXX --variable FABRIC_API_SECRET=xxx
    $ npm install --save @ionic-native/fabric
    
  2. Add this plugin to your app's module

Supported platforms

Usage

import { Answers } from '@ionic-native/fabric';


constructor(private answers: Answers) { }

...

this.answers.sendCustomEvent('SomeCustomEvent', { some: "attributes" })

Instance Members

sendPurchase(itemPrice, currency, success, itemName, itemType, itemId, attributes)

Sends the Purchase tracking event.

All parameters are optional.

https://docs.fabric.io/android/answers/answers-events.html#purchase

Param Type Details
itemPrice

The item's amount in the currency specified.

currency

The ISO4217 currency code.

success

Was the purchase completed succesfully?

itemName

The human-readable name for the item.

itemType

The category the item falls under.

itemId

A unique identifier used to track the item.

attributes

Any additional user-defined attributes to be logged.

sendAddToCart(itemPrice, currency, itemName, itemType, itemId, attributes)

Sends the Add To Cart tracking event.

All parameters are optional.

https://docs.fabric.io/android/answers/answers-events.html#add-to-cart

Param Type Details
itemPrice

The item's amount in the currency specified.

currency

The ISO4217 currency code.

itemName

The human-readable name for the item.

itemType

The category the item falls under.

itemId

A unique identifier used to track the item.

attributes

Any additional user-defined attributes to be logged.

sendStartCheckout(totalPrice, currency, itemCount, attributes)

Sends the Start Checkout tracking event.

All parameters are optional.

https://docs.fabric.io/android/answers/answers-events.html#start-checkout

Param Type Details
totalPrice

The total price of all items in cart in the currency specified.

currency

The ISO4217 currency code.

itemCount

The count of items in cart.

attributes

Any additional user-defined attributes to be logged.

sendSearch(query, attributes)

Sends the Search tracking event.

https://docs.fabric.io/android/answers/answers-events.html#search

Param Type Details
query

What the user is searching for.

attributes

Any additional user-defined attributes to be logged.

sendShare(method, contentName, contentType, contentId, attributes)

Sends the Share tracking event.

All parameters are optional.

https://docs.fabric.io/android/answers/answers-events.html#share

Param Type Details
method

The method used to share content.

contentName

The description of the content.

contentType

The type or genre of content.

contentId

A unique key identifying the content.

attributes

Any additional user-defined attributes to be logged.

sendRatedContent(rating, contentName, contentType, contentId, attributes)

Sends the Rated Content tracking event.

All parameters are optional.

https://docs.fabric.io/android/answers/answers-events.html#rated-content

Param Type Details
rating

An integer rating of the content.

contentName

The human-readable name of content.

contentType

The category your item falls under.

contentId

A unique identifier used to track the item.

attributes

Any additional user-defined attributes to be logged.

sendSignUp(method, success, attributes)

Sends the Sign Up tracking event.

All parameters are optional.

https://docs.fabric.io/android/answers/answers-events.html#sign-up

Param Type Details
method

An optional description of the sign up method (Twitter, Facebook, etc.); defaults to "Direct".

success

An optional flag that indicates sign up success; defaults to true.

attributes

Any additional user-defined attributes to be logged.

sendLogIn(method, success, attributes)

Sends the Log In tracking event.

All parameters are optional.

https://docs.fabric.io/android/answers/answers-events.html#log-in

Param Type Details
method

An optional description of the sign in method (Twitter, Facebook, etc.); defaults to "Direct".

success

An optional flag that indicates sign in success; defaults to true.

attributes

Any additional user-defined attributes to be logged.

sendInvite(method, attributes)

Sends the Invite tracking event.

All parameters are optional.

https://docs.fabric.io/android/answers/answers-events.html#invite

Param Type Details
method

An optional description of the sign in method (Twitter, Facebook, etc.); defaults to "Direct".

attributes

Any additional user-defined attributes to be logged.

sendLevelStart(levelName, attributes)

Sends the Level Start tracking event.

All parameters are optional.

https://docs.fabric.io/android/answers/answers-events.html#level-start

Param Type Details
levelName

String key describing the level.

attributes

Any additional user-defined attributes to be logged.

sendLevelEnd(levelName, score, success, attributes)

Sends the Level End tracking event.

All parameters are optional.

https://docs.fabric.io/android/answers/answers-events.html#level-end

Param Type Details
levelName

String key describing the level.

score

The score for this level.

success

Completed the level or failed trying.

attributes

Any additional user-defined attributes to be logged.

sendContentView()

Send the Content View tracking event.

https://docs.fabric.io/android/answers/answers-events.html#content-view

sendScreenView()

Shortcut for sendContentView(…) using type of “Screen”.

sendCustomEvent()

Send a custom tracking event with the given name.

https://docs.fabric.io/android/answers/answers-events.html#custom-event

API

Native

General