[FabricPlugin] Fabric Plugin Documentation

  
Forge Component
(0)
Published on 18 Nov (3 weeks ago) by OutSystems Experts
0 votes
Published on 18 Nov (3 weeks ago) by OutSystems Experts

How to use Fabric

What is Fabric

Fabric is a cloud service that provides crash reporting and mobile analytics, showing the data in dashboards. If you already know what Fabric is you can skip this to Fabric Setup.

Features

Two of the available services provided by Fabric are Crashlytics and Answers

Crashlytics

With Crashlytics, you get real-time information on crashes inside your app, and all the details you need to tackle the most impactful stability issues head-on.


Answers

Answers gives you real-time statistics on how your app is being used, including active user numbers, session length, stability rating, and retention. Answers gives you instant metrics as soon as you turn it on, without requiring any additional code.


You can also send customized events with your mobile application. 



Developers can have accurate and detailed data about the usage of the mobile application when analysing the customized events.


Offline Mode

When there’s no connectivity, gathered metrics are cached and sent when the Application is launched with an active network connection.


If you want to know more about Fabric and their products, you can access their website here.  

Fabric Setup

How to create an account

If you don’t have a Fabric account, the first thing to do is create one on Fabric website.

Once created and confirmed the account, you will be asked to choose your organization name.



After clicked on “Next” button, you will be presented with Fabric wizard screen:


For now don't do anything on this screen. We'll take care of this after adding the Fabric Plugin to your mobile application.

How to get Fabric API Key and Fabric API Secret

To be able to integrate the Fabric Plugin on your mobile application, you will need to get the “Fabric API Key” and the “Fabric API Secret”.

  1. Access https://fabric.io/kits/ios/crashlytics/install;
  2. Scroll down until you find the subtitle “Add a Run Script Build Phase”;
  3. If you’re not logged, you have to log in first;


  1. When you’re logged you will able to get the Fabric API Key (first visible number) and the Fabric API Secret (second visible number).


How to activate Answers

After Fabric is integrated in your mobile application (it means that you have to generate an application using the Fabric Plugin)you can activate Answers, for that click on the Answers menu item.

After accepting the Answers agreement, you will be asked to perform a new install of your app in order to start sending events to Answers.

When the Answers is activated in your mobile application, you will see the following success screen:



What can you do with the Fabric Plugin

When the Fabric Plugin is integrated in your Outsystems Application, by default you are able to see: native crashesreal-time data about active usersdaily new usersnumber of sessionsmost used application buildmost used operating systems and also most used devices

It is also possible to refine this information using Fabric Plugin actions. You can also track: crashes with additional information (which user or variables used to crash the application)custom views and content; information about login and sign up; the most used search queries; information about rated content and information about invitations and shares of the application.


Fabric Plugin Actions


These are the actions available on Fabric Plugin:


fabric_actions.PNG


For more detailed information about each action, you can find their descriptions and input params on the Plugin itself.


In the section  “Some integration use cases”, you can learn how to implement two use cases using some of actions listed above:

  • Keep track of all errors and exceptions using “SendNonFatalCrash” action;
  • Keep track of the number of banking transfers done on my home banking app using “SendCustomEvent” action;


How to use the Fabric Plugin

Installation

Start by installing the Fabric Plugin from OutSystems Forge. The fastest way to do this is to go to the OutSystems tab in your development environment and install from there.

First Configuration

Pre-Requirements

  1. You must have a Fabric account;
  2. You must have Fabric API Key and Secret;

Configure Fabric Plugin 

You need to open the installed Fabric Plugin module to insert the Fabric API Key and API Secret.

  1. Go to the Module properties and open the Extensibility Configuration property;
  2. On the available JSON object you have to change the “FABRIC_API_KEY” value and “FABRIC_API_SECRET” value;


  1. After applying these changes, you have to publish the plugin..

Add the Plugin to your Outsystems Application

On your application, use “Manage Dependencies…” to add a reference to the Fabric plugin.

If you want to use Answers capability you have to activate it to get statistics data and generate a new application version on Outsystems platform.


To use the Fabric Plugin actions, you have to drag and drop the “Client Action” to your screen and choose one of the Fabric Plugin action that you want to use on your Outsystem application.


Some integration use cases

Track Crashes

It is possible to track all exceptions that occur in your actions. For that use the “SendNonFatalCrash” Fabric Plugin action. 




As input to this Fabric action, use the exception message content:



Now let’s see the data in Fabric website. Click on the Crashlytics tab, and you will be able to see the crashes of your application.


Custom Event

Let's say you have a mobile home banking application, and you want to know which types of bank transfers are most used by your users.


Assuming you have a “Transfer” action flow like this: 

You can track the transfer event by using ““SendCustomEvent” Fabric action in your “Transfer” action.

Next, you need to fill the inputs of the Fabric Plugin action. “EventName” is a mandatory field and as an example you can use the string “Transfer” on it. 

“Custom Attributes” is an optional field. In this example it is used to track the transfer type.



The “CustomAttributes” is a List of “Attribute” Structure data type that you can use to collect additional information about the event. In this example let’s track the type of transfer that the user did. 


To do that, Add a variable called “AttributeList” to your “Transfer” action.



All required inputs are now ready to be assigned to “SendCustomEvent” action.



Despite all the variables being assigned to the Fabric Plugin action, our “AttributeList” remains empty. Let's create a new variable of “Attribute” Structure data type and call it “TransferType”.




Now, you just need to assign values to that variable. 

To track the transfer as an internal bank transfer, assign “Key” with “Type” string and “Value” with “Internal” string.




To populate the “AttributeList”, use “AppendList” action.


The final step is to append the “TransferType” variable to “AttributeList”.



In the end the “Transfer” action should be similar to this:

Now let’s see the data in Fabric website. You need to activate Answers to be able to view data about events. Click on the Answers tab and click also on the events tab, and you will be able to see the “Transfer” event.



We can get more details of this event:



With the above dashboard you can conclude that 417 transfers were made with your application. Let’s see what kind of transfers and how many transfers were made:



You can see that there were 281 “Internal Transfers” and 136 “External Transfers”. 

Limitations

Crashlytics on iOS

Outsystems platform doesn’t create the “dSYM” file after generating an iOS application. Therefore, it’s not possible to see the crash details from iOS applications on Fabric without a “dSYM” file upload. 


A “Missing dSYM” alert will appear on your Fabric dashboard.



To see more information about “missing dSYM” click here.