- Create an application class, is a simple class wich extend the class application
- Inside your application class, put the solution provided. Since we are on it, we can also enable offline persistence for Firebase database
- Register your class in the AndroidManifest.xml
- Please be aware that there are 2 problems solved there, conflict with RTL and the original crash with Twitter login
- Fix the graddle, if by any chance you the 'maven { url 'https://maven.fabric.io/public' }' in the general project graddle, remove it from there. Fabric allready added to your app graddle.
- Remember to use the latest Firebase-ui-auth version, there is a Twitter conflict with reusable email solved alrready.
Last active
March 23, 2018 13:44
-
-
Save cutiko/0cab3fc3b53f339b2274f3667e058dc6 to your computer and use it in GitHub Desktop.
Firebase Twitter login and Fabric crash solution guid
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!--You can see here, that there are 2 attributes added. First tools:replace="android:supportsRtl" is ment to fix the rtl merge conflict | |
and android:name=".YourApp" is ment to register the class extending application as your app--> | |
<application | |
android:allowBackup="true" | |
android:icon="@mipmap/ic_launcher" | |
android:label="@string/app_name" | |
android:supportsRtl="false" | |
android:theme="@style/AppTheme" | |
android:name=".YourApp" | |
tools:replace="android:supportsRtl"> | |
</application> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class YourApp extends Application { | |
@Override | |
public void onCreate() { | |
super.onCreate(); | |
TwitterAuthConfig authConfig = new TwitterAuthConfig(getString(R.string.twitter_consumer_key), getString(R.string.twitter_consumer_secret)); | |
Fabric.with(this, new Twitter(authConfig), new Crashlytics()); | |
//You will probably be using the Firebase RealTime Database, and since we are creating this application class, | |
//go a head and uncomment below line to activate offline feature | |
//FirebaseDatabase.getInstance().setPersistenceEnabled(true); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hey, Thanks for posting this it helped me resolve the issue I was having. Thought I would pitch this in as well in case anyone needs the debug option too: