Twitter Fabric Login for Android

前端 未结 4 1586
逝去的感伤
逝去的感伤 2021-02-13 13:36

I\'m attempting to use the new Fabric API that Twitter is offering to let users login to my app. I\'ve followed the tutorial exactly (at least I think I have, maybe I\'ve made s

4条回答
  •  借酒劲吻你
    2021-02-13 14:35

    The Fabric SDK separates functionality into modules called Kits. You must indicate which kits you wish to use via Fabric.with(). This is typically done by extending Android’s Application class.

    package com.example.app;
    import android.app.Application;
    
    public class MyApplication extends Application {
        @Override
        public void onCreate() {
            super.onCreate();
    
            TwitterAuthConfig authConfig = 
                       new TwitterAuthConfig("consumerKey",
                                             "consumerSecret");
    
            Fabric.with(this, new Twitter(authConfig));
    
            // Example: multiple kits
            // Fabric.with(this, new Twitter(authConfig),
            //                  new Crashlytics());
        }
    }
    

    More info: https://dev.twitter.com/twitter-kit/android/integrate

    See the canonical sample app at: https://github.com/twitterdev/cannonball-android

提交回复
热议问题