Use the native Crashlytics iOS / Android SDK in Titanium.
The whole Firebase support in Titanium is developed and maintained by the community (@hansemannn
and @m1ga
). To keep
this project maintained and be able to use the latest Firebase SDK's, please see the "Sponsor" button of this repository,
thank you!
In general, remember to not use any Crashlytics API's before actually opening your first window. While this might not result
in a crash on iOS, the native Android SDK will error if being used before your app finished launching due to requiring the
native Activity
.
Create a new folder scripts/
in your project root
Copy the run
and upload-symbols
shell files from this repo's helper/
directory to scripts/
in your project
Make sure your Firebase project is configured properly and you have your GoogleService-Info.plist
in place
as described here.
Make sure the upload-symbols file's permissions are correct, running chmod +x PROJ_ROOT_PATH/scripts/upload-symbols
(replace PROJ_ROOT_PATH with your real project root path)
You are ready to go!
var crash = require("ti.crashlytics");
crash.crash(); // test crash
<application>
tag inside the manifest configuration in your tiapp.xml:
<meta-data android:name="firebase_analytics_collection_enabled"
android:value="true"/>
<meta-data android:name="google_analytics_adid_collection_enabled"
android:value="true"/>
<service
android:name="com.google.android.gms.measurement.AppMeasurementService"
android:enabled="true"
android:exported="false"/>
<service
android:name="com.google.android.gms.measurement.AppMeasurementJobService"
android:permission="android.permission.BIND_JOB_SERVICE"
android:enabled="true"
android:exported="false"/>
<service
android:name="INSERT_YOUR_APP_PACKAGE_NAME.gcm.RegistrationIntentService"
android:exported="false"/>
<receiver
android:name="com.google.android.gms.measurement.AppMeasurementReceiver"
android:enabled="true">
<intent-filter>
<action android:name="com.google.android.gms.measurement.UPLOAD"/>
</intent-filter>
</receiver>
See the Sample App for an example of configuring the required API keys and project settings.
Crashlytics.log(message)
Log a Custom Event to see user actions that are uniquely important for your app in real-time.
Crashlytics.userId = myUserId
Specify a user identifier which will be visible in the Crashlytics UI.
Crashlytics.recordError({ domain, code, userInfo })
Records non-fatal errors. Note: The code
and userInfo
parameters are iOS-only.
Crashlytics.crash()
Simulate a crash (for testing purpose)
Crashlytics.throwException()
Simulate an exception (for testing purpose)
Hans Knöchel (@hansemannnn / Web)
MIT
Code contributions are greatly appreciated, please submit a new Pull-Request!