title: Custom button for facebook login using Kotlin but failed
body: <p>I would like to apply facebook login module by clicking the custom button and acquire access token from facebook, then pass the access token from Facebook to firebase to Login. </p>
  
  <p>When it comes the execution, there has no response from register call back. </p>
  
  <p>I have setup the Facebook Developer App called : JacksonApplication and  the application written in Kotlin as below: </p>
  
  <p>Would you please tell me what are other ways I have to implement ? </p>
  
  <pre><code>class JacksonApplication : Application() {
  
      override fun onCreate() {
          super.onCreate()
  
          AppEventsLogger.activateApp(this);
  
          JodaTimeAndroid.init(this);
      }
  }
  </code></pre>
  
  <p>My function : </p>
  
  <pre><code> callbackManager = CallbackManager.Factory.create()
  
              LoginManager.getInstance()
              LoginManager.getInstance().registerCallback(callbackManager ,
                      object : FacebookCallback&lt;LoginResult&gt; {
                          override fun onSuccess(loginResult: LoginResult) {
                              println("facebook loginResult : $loginResult")
                              handleFacebookAccessToken(loginResult.accessToken);
                              // App code
                          }
  
                          override fun onCancel() {
                              // App code
                          }
  
                          override fun onError(exception: FacebookException) {
                              println("loginResult : ${exception.localizedMessage}")
  
                              // App code
                          }
                      })
  
   fun  handleFacebookAccessToken( token : AccessToken) {
          Log.d(TAG, "handleFacebookAccessToken:" + token);
  
          val credential = FacebookAuthProvider.getCredential(token.getToken());
          mAuth!!.signInWithCredential(credential)
                  .addOnCompleteListener(this) { task -&gt;
                      if (task.isSuccessful) {
                          // Sign in success
                          val firebaseUser = mAuth!!.currentUser
                          updateUI(firebaseUser)
  
                      } else {
                          // Sign in fails
                          val currentUser = mAuth!!.currentUser!!
                          user.register(currentUser.uid)
                      }
                  }
      }
  </code></pre>
  
  <p>My actions : </p>
  
  <pre><code>private fun loginSocial( type : String ) {
          if (type  == "Facebook") {
              println("execute social reg by facebook")
              callbackManager = CallbackManager.Factory.create()
  
              LoginManager.getInstance()
              LoginManager.getInstance().registerCallback(callbackManager ,
                      object : FacebookCallback&lt;LoginResult&gt; {
                          override fun onSuccess(loginResult: LoginResult) {
                              println("facebook loginResult : $loginResult")
                              handleFacebookAccessToken(loginResult.accessToken);
                              // App code
                          }
  
                          override fun onCancel() {
                              // App code
                          }
  
                          override fun onError(exception: FacebookException) {
                              println("loginResult : ${exception.localizedMessage}")
  
                              // App code
                          }
                      })
  
          }else if(type  == "Google") {
              println("execute social reg by google")
  
              val intent = Auth.GoogleSignInApi.getSignInIntent(mGoogleApiClient)
              startActivityForResult(intent, REQUEST_CODE_GOOGLE_SIGN_IN)
              mGoogleApiClient!!.connect()
          }
      }
  </code></pre>
  
  <p>onActivity Result : </p>
  
  <pre><code>override fun onActivityResult(requestCode: Int , resultCode: Int , data: Intent?) {
      super.onActivityResult(requestCode , resultCode , data)
      callbackManager?.onActivityResult(requestCode, resultCode, data)
  
      if (requestCode == REQUEST_CODE_GOOGLE_SIGN_IN) {
  
           progressDialog = ProgressDialog(this )
           progressDialog!!.setMessage(this.resources.getString(R.string.loading))
           progressDialog!!.setCancelable(false)
           progressDialog!!.show()
  
          val result = Auth.GoogleSignInApi.getSignInResultFromIntent(data)
          if (result.isSuccess) {
              // successful -&gt; authenticate with Firebase
              val account = result.signInAccount
              firebaseAuthWithGoogle(account!!)
          } else {
              // failed -&gt; update UI
              updateUI(null)
              Toast.makeText(applicationContext, "SignIn: failed!",
                      Toast.LENGTH_SHORT).show()
          }
      }else  {
           progressDialog = ProgressDialog(this )
           progressDialog!!.setMessage(this.resources.getString(R.string.loading))
           progressDialog!!.setCancelable(false)
           progressDialog!!.show()
  
  
       }
  }
  </code></pre>