Fabric Plugin

This plugin allows you log Fabric analytic data (Also known as Fabric Answers). And log crash data via Crashlytics.

Platforms:

iOS, macOS(not simulator), tvOS, and Android

Functions:

fabric.init(enableDebug)

-- setup Fabric and Crashlytics

enableDebug(boolean) -- default is false

Fabric Answers Api:

fabric.sendPurchase(price, currency, success, itemName, itemType, itemId, customAttributes)

-- log purchase

price(number) The item's price

currency(string) The ISO4217 currency code

success(boolean) succesful or unsuccesful

itemName(string) The human-readable form of the item's name

itemType(string) The type, or genre of the item

itemId(string) The machine-readable, unique item identifier

customAttributes(table)(optional) table of custom attributes

fabric.sendAddToCart(price, currency, itemName, itemType, itemId, customAttributes)

-- log add to cart event

price(number) The item's price

currency(string) The ISO4217 currency code

itemName(string) The human-readable form of the item's name

itemType(string) The type, or genre of the item

itemId(string) The machine-readable, unique item identifier

customAttributes(table)(optional) table of custom attributes

fabric.sendStartCheckout(price, currency, itemCount, customAttributes)

-- log checkout

price(number) price of item(s)

currency(string) The ISO4217 currency code

itemCount(number) number of items to checkout

customAttributes(table)(optional) table of custom attributes

fabric.sendSearch(seachQuery, customAttributes)

-- log search

seachQuery(string) item searched

customAttributes(table)(optional) table of custom attributes

fabric.sendShare(method, contentName, contentType, contentId, customAttributes)

-- log share event

method(string) where item was shared

contentName(string) name of content

contentType(string) type of content

contentId(string) id of content

customAttributes(table)(optional) table of custom attributes

fabric.sendShare(method, contentName, contentType, contentId, customAttributes)

-- log share event

method(string) where item was shared

contentName(string) name of content

contentType(string) type of content

contentId(string) id of content

customAttributes(table)(optional) table of custom attributes

fabric.sendRatedContent(rating, contentName, contentType, contentId, customAttributes)

-- log rating

rating(number(whole number)) rating for content

contentName(string) name of content

contentType(string) type of content

contentId(string) id of content

customAttributes(table)(optional) table of custom attributes

fabric.sendSignUp(method, success, customAttributes)

-- log sign up

method(string) how user signed in

c(boolean) The ultimate success or failure of the login

customAttributes(table)(optional) table of custom attributes

fabric.sendLogIn(method, success, customAttributes)

-- log sign in

method(string) how user signed in

success(boolean) The ultimate success or failure of the login

customAttributes(table)(optional) table of custom attributes

fabric.sendInvite(method, customAttributes)

-- log invite sent

method(string) how user signed in

customAttributes(table)(optional) table of custom attributes

fabric.sendLevelStart(levelName, customAttributes)

-- log level start

levelName(string) name of level started

customAttributes(table)(optional) table of custom attributes

fabric.sendLevelEnd(levelName, success, customAttributes)

-- log level ended

levelName(string) name of level ended

success(boolean) A boolean representing whether or not the level was completed succesfully

customAttributes(table)(optional) table of custom attributes

fabric.sendContentView(contentViewName, contentType, contentId, customAttributes)

-- log content viewed

contentViewName(string) name of content viewed

contentType(string) type of content

contentId(string) id of content

customAttributes(table)(optional) table of custom attributes

fabric.sendCustomEvent( eventName, customAttributes)

-- log event

eventName(string) name of event

customAttributes(table)(optional) table of custom attributes

Crashlytics Api:

fabric.addLog(log)

--add log to be sent with crash data

log(string) log data

fabric.setUserIdentifier(userId)

--Specify a user identifier which will be visible in the Crashlytics UI.

userId(string) id of user

fabric.setUserName(username)

--Specify a user name which will be visible in the Crashlytics UI.

username(string) username to specify in UI

fabric.setUserEmail(email)

--Specify a user email which will be visible in the Crashlytics UI.

email(string) email to specify in UI

fabric.sendCrash(error)

--The easiest way to cause a crash

error(string) error description

fabric.setStringValue(key,string)

--Set a string value for a key to be associated with your crash data which will be visible in the Crashlytics UI.

key(string) key associated with string

string(string) string to associated with crash

fabric.setIntValue(key,int)

--Set an interger value for a key to be associated with your crash data which will be visible in the Crashlytics UI.

key(string) key associated with interger

int(number) interger to associated with crash

fabric.setBoolValue(key,boolean)

--Set a boolean value for a key to be associated with your crash data which will be visible in the Crashlytics UI.

key(string) key associated with boolean

boolean(boolean) boolean to associated with crash

fabric.recordError(error, errorCode)

--log error

error(string) error description

errorCode(number) error code

Fabric Setup:

go to https://fabric.io/kits/ios/crashlytics/install, sign in (or create an account), select apple, scroll down to this part(see image below), grab the fabric api key (if you signed in your code will apear), and paste in plist template below. Make sure to open and enable events you apps dashboard. If your app does not appear contact [email protected]

Crashlytics Setup:

first make sure you have setup Fabric (see above). For android you are already setup. On iOS, when you build your project thought Corona Simulator, it creates your app file and an appname.dysm file. That dsym need to be uploaded to fabric. Go to your fabric dashboard, click settings icon in top left, click apps, then your iOS app(associated with the symbols), missing DSYM, and upload the appname.dysm. When submiting you app to app store on iOS make sure include symbols. (As for tvOS(probably similar to iOS) and macOS, I don't have guides for setup but they are supported). On Android make sure you add the string bellow in build.settings.

Build Settings:

Helpful Links:

Example

Support

Get Plugin