fun logCompleteLogin()

in facebook-common/src/main/java/com/facebook/login/LoginLogger.kt [67:107]


  fun logCompleteLogin(
      loginRequestId: String?,
      loggingExtras: Map<String, String>,
      result: LoginClient.Result.Code?,
      resultExtras: Map<String, String>?,
      exception: Exception?,
      eventName: String? = EVENT_NAME_LOGIN_COMPLETE
  ) {
    val bundle = newAuthorizationLoggingBundle(loginRequestId)
    if (result != null) {
      bundle.putString(EVENT_PARAM_LOGIN_RESULT, result.loggingValue)
    }
    if (exception?.message != null) {
      bundle.putString(EVENT_PARAM_ERROR_MESSAGE, exception.message)
    }

    // Combine extras from the request and from the result.
    var jsonObject: JSONObject? = null
    if (loggingExtras.isNotEmpty()) {
      jsonObject = JSONObject(loggingExtras)
    }
    if (resultExtras != null) {
      if (jsonObject == null) {
        jsonObject = JSONObject()
      }
      try {
        for ((key, value) in resultExtras) {
          if (key != null) {
            jsonObject.put(key, value)
          }
        }
      } catch (e: JSONException) {}
    }
    if (jsonObject != null) {
      bundle.putString(EVENT_PARAM_EXTRAS, jsonObject.toString())
    }
    logger.logEventImplicitly(eventName, bundle)
    if (result == LoginClient.Result.Code.SUCCESS) {
      logHeartbeatEvent(loginRequestId)
    }
  }