Easily integrate Fabric in your RubyMotion application.
Supported Fabric kits:
Kit Name | Description | Supported? |
---|---|---|
Amazon Cognito Sync | Develop apps quickly. Scale and run reliably. | âś… |
Answers | Finally, mobile app analytics you don't need to analyze. | âś… |
Appsee | Analyze user behavior with videos of sessions, heatmaps & analytics. | âś… |
Crashlytics | The most powerful, yet lightest weight crash reporting solution. | âś… |
Digits | No more passwords. Powerful login that grows your mobile graph. | âś… |
GameAnalytics | To build great games, you need to understand player behavior. | âś… |
Mapbox | Build the map your application deserves. | ❌ |
MoPub | Drive More Mobile Ad Revenue. | âś… |
Nuance | Develop natural, engaging experiences with speech | ❌ |
Optimizely | Fast, powerful A/B testing for mobile apps. | âś… |
PubNub | Realtime apps made simple. | âś… |
Stripe | Seamlessly integrated mobile payments. | âś… |
The easiest way to bring Twitter content into your app. | âś… |
Add this line to your application's Gemfile:
gem 'motion-fabric'
And then execute:
$ bundle
To install the required Pods execute:
$ rake pod:install
NOTE: If you already have a Fabric team with an API KEY and BUILD SECRET, skip to step 5.
-
Sign up for a Fabric account here
-
You will receive a confirmation email. Enter your team's name and download the Xcode plugin (Dont worry, this is a separate app called Fabric.app. You wont need to open Xcode).
-
Open Fabric.app and log in with your account (Important! You must keep Fabric.app open and logged in throughout the configuration process).
-
Go to this page and retrieve your API KEY and BUILD SECRET for your organization in the step two. They will appear in a box in this form:
"${PODS_ROOT}/Fabric/run" {api_key} {build_secret}
-
Configure your
Rakefile
with the API KEY and BUILD SECRET:app.fabric do |config| config.api_key = "api_key" config.build_secret = "build_secret" config.kit 'Crashlytics' end
-
Add the following line in your AppDelegate:
Fabric.with([Crashlytics])
-
Register your app with Fabric (this will run your app in the simulator):
$ rake fabric:setup
-
Go to fabric.io and verify that your app has been created
To process your crash reports, Crashlytics needs a special file that contains the debug information of your app. This is needed to add method name, file name and line number annotations to the crash reports.
This file is called the dSYM
file and is generated every time you build the application.
By default motion-fabric
does NOT upload any dSYM
file.
Usually, you only want crash reporting for your distribution and Crashlytics Beta builds:
if RUBYMOTION_ENV == 'release' || CRASHLYTICS_BETA == true
Fabric.with([Crashlytics])
end
You can automate the upload of the dSYM file after you run certain rake commands:
# Upload the dSYM after creating a release build
Rake::Task["archive:distribution"].enhance do
Rake::Task["fabric:dsym:device"].invoke
end
# Upload the dSYM after every simulator build
Rake::Task["build:simulator"].enhance do
Rake::Task["fabric:dsym:simulator"].invoke
end
# Upload the dSYM after every device build
Rake::Task["build:device"].enhance do
Rake::Task["fabric:dsym:device"].invoke
end
# Upload the dSYM after uploading a beta build to Crashlytics
Rake::Task["fabric:upload"].enhance do
Rake::Task["fabric:dsym:device"].invoke
end
Fabric offers another service under the name Crashlytics Beta which helps you distribute beta builds of your app to your testers.
You can customize the configuration for your beta distribution. You should use this to configure your AdHoc provisioninig profile.
app.fabric do |config|
config.beta do
app.identifier = "my_identifier"
app.codesign_certificate = "my_certificate"
app.provisioning_profile = "my_ad_hoc_provisioning_file"
end
end
NOTE: Make sure to use an Ad-Hoc provisioning profile and not a developent one. You can create an Ad-Hoc provisioning profile in the provisioning portal
The only difference between your development builds and your Crashlytics Beta
builds is the presence of the CRASHLYTICS_BETA
constant which is only present
for beta builds:
if Module.const_defined?(:CRASHLYTICS_BETA)
puts 'This code will only run in builds distributed via Crashlytics Beta'
end
To create a beta build and upload it to Crashlytics Beta:
$ rake fabric:upload notes="my release notes" emails="[email protected],[email protected]" groups="group1,group2" notifications=YES
The notes, emails, groups and notifications options are optional.
NOTE: Be careful to include the group alias and not the group name in the groups option. You can find the group alias in the Fabric dashboard.
Go to the Crashlytics Beta section of your Fabric dashboard and check that your build was successfully uploaded.
Click here to learn how to get your API keys.
Add the following to your Rakefile
:
config.kit 'AWSCognitoIdentity' do |info|
info[:AWSCognitoIdentityPoolId] = 'MyPoolId'
info[:AWSCognitoIdentityRegionType] = 'MyRegionType'
end
app.pods do
pod 'AWSCognito'
end
And the following to your application code:
Fabric.with([AWSCognito])
The answers SDK is already included in the Crashlytics SDK, so you simply have to initialize it by adding the following to your application code:
Fabric.with([Answers])
Click here to learn how to get your API keys.
Add the following to your Rakefile
:
config.kit 'Appsee' do |info|
info[:apikey] = 'MyApiKey'
end
app.pods do
pod 'Appsee'
end
And the following to your application code:
Fabric.with([Appsee])
See the Configuration section above.
Click here to learn how to get your API keys.
Add the following to your Rakefile
:
config.kit 'Digits' do |info|
info[:consumerKey] = 'MyKey'
info[:consumerSecret] = 'MySecret'
end
app.pods do
pod 'Digits'
end
And the following to your application code:
Fabric.with([Digits])
Click here to learn how to get your API keys.
Add the following to your Rakefile
:
config.kit 'GameAnalytics' do |info|
info['api-key'] = 'MyKey'
info['api-secret'] = 'MySecret'
end
app.pods do
pod 'GA-SDK-IOS'
end
And the following to your application code:
Fabric.with([GameAnalytics])
NOTE: The MapBox SDK is not currently supported
Click here to learn how to get your API keys.
Add the following to your Rakefile
:
config.kit 'MGLAccountManager' do |info|
info[:accessToken] = 'MyToken'
end
app.pods do
pod 'Mapbox-iOS-SDK'
end
And the following to your application code:
Fabric.with([MGLAccountManager])
Add the following to your Rakefile
:
app.pods do
pod 'mopub-ios-sdk'
end
And the following to your application code:
Fabric.with([MoPub])
NOTE: The Nuance SDK is not currently supported
Click here to learn how to get your API keys.
Add the following to your Rakefile
:
config.kit 'SKSession' do |info|
info[:appKey] = 'MyKey'
info[:url] = 'MyURL'
end
app.pods do
pod 'SpeechKit'
end
And the following to your application code:
Fabric.with([SKSession])
Click here to learn how to get your API keys.
Add the following to your Rakefile
:
config.kit 'Optimizely' do |info|
info[:socket_token] = 'MyToken'
end
app.pods do
pod 'Optimizely-iOS-SDK'
end
And the following to your application code:
Fabric.with([Optimizely])
Optimizely.startOptimizelyWithAPIToken("{api-key}", launchOptions:launchOptions)
Click here to learn how to get your API keys.
Add the following to your Rakefile
:
config.kit 'PubNub' do |info|
info['publish-key'] = 'MyPublishKey'
info['subscribe-key'] = 'MySubscribeKey'
info['secret-key'] = 'MySecretKey'
end
app.pods do
pod 'PubNub/Fabric'
end
And the following to your application code:
Fabric.with([PubNub])
Click here to learn how to get your API keys.
Add the following to your Rakefile
:
config.kit 'STPAPIClient' do |info|
info[:publishable] = 'MyPublishableAPIKey'
end
app.pods do
pod 'Stripe'
end
And the following to your application code:
Fabric.with([STPAPIClient])
Click here to learn how to get your API keys.
Add the following to your Rakefile
:
app.fabric do |config|
config.kit 'Twitter' do |info|
info[:consumerKey] = 'MyKey'
info[:consumerSecret] = 'MySecret'
end
end
app.pods do
pod 'TwitterKit'
end
And the following to your application code:
Fabric.with([Twitter])