public boolean invoke(AppRequestData paramAppRequestData) {
   HttpRequest localHttpRequest =
       applyMultipartDataTo(
           applyHeadersTo(getHttpRequest(), paramAppRequestData), paramAppRequestData);
   Fabric.getLogger().d("Fabric", "Sending app info to " + getUrl());
   if (paramAppRequestData.icon != null) {
     Fabric.getLogger().d("Fabric", "App icon hash is " + paramAppRequestData.icon.hash);
     Fabric.getLogger()
         .d(
             "Fabric",
             "App icon size is "
                 + paramAppRequestData.icon.width
                 + "x"
                 + paramAppRequestData.icon.height);
   }
   int i = localHttpRequest.code();
   if ("POST".equals(localHttpRequest.method())) {}
   for (paramAppRequestData = "Create"; ; paramAppRequestData = "Update") {
     Fabric.getLogger()
         .d(
             "Fabric",
             paramAppRequestData + " app request ID: " + localHttpRequest.header("X-REQUEST-ID"));
     Fabric.getLogger().d("Fabric", "Result was " + i);
     if (ResponseParser.parse(i) != 0) {
       break;
     }
     return true;
   }
   return false;
 }
 @Override
 public void onCreate() {
   super.onCreate();
   Fabric.with(this, new Crashlytics());
   if (!BuildConfig.DEBUG) {
     Fabric.with(this, new Crashlytics());
   }
   initializeSdk();
   // broadcastPushTest();
 }
Ejemplo n.º 3
0
 private void attemptUploadWithRetry() {
   Fabric.getLogger()
       .m23d(Fabric.TAG, "Starting report processing in " + this.delay + " second(s)...");
   if (this.delay > 0.0f) {
     try {
       Thread.sleep((long) (this.delay * 1000.0f));
     } catch (InterruptedException e) {
       Thread.currentThread().interrupt();
       return;
     }
   }
   Crashlytics crashlytics = Crashlytics.getInstance();
   CrashlyticsUncaughtExceptionHandler handler = crashlytics.getHandler();
   List<Report> reports = ReportUploader.this.findReports();
   if (!handler.isHandlingException()) {
     if (reports.isEmpty() || crashlytics.canSendWithUserApproval()) {
       int retryCount = 0;
       while (!reports.isEmpty()
           && !Crashlytics.getInstance().getHandler().isHandlingException()) {
         Fabric.getLogger()
             .m23d(Fabric.TAG, "Attempting to send " + reports.size() + " report(s)");
         for (Report report : reports) {
           ReportUploader.this.forceUpload(report);
         }
         reports = ReportUploader.this.findReports();
         if (!reports.isEmpty()) {
           int retryCount2 = retryCount + 1;
           long interval =
               (long)
                   ReportUploader.RETRY_INTERVALS[
                       Math.min(retryCount, ReportUploader.RETRY_INTERVALS.length - 1)];
           Fabric.getLogger()
               .m23d(
                   Fabric.TAG,
                   "Report submisson: scheduling delayed retry in " + interval + " seconds");
           try {
             Thread.sleep(1000 * interval);
             retryCount = retryCount2;
           } catch (InterruptedException e2) {
             Thread.currentThread().interrupt();
             return;
           }
         }
       }
       return;
     }
     Fabric.getLogger()
         .m23d(Fabric.TAG, "User declined to send. Removing " + reports.size() + " Report(s).");
     for (Report report2 : reports) {
       report2.remove();
     }
   }
 }
Ejemplo n.º 4
0
 List<Report> findReports() {
   Fabric.getLogger().m23d(Fabric.TAG, "Checking for crash reports...");
   synchronized (this.fileAccessLock) {
     File[] clsFiles = Crashlytics.getInstance().getSdkDirectory().listFiles(crashFileFilter);
   }
   List<Report> reports = new LinkedList();
   for (File file : clsFiles) {
     Fabric.getLogger().m23d(Fabric.TAG, "Found crash report " + file.getPath());
     reports.add(new SessionReport(file));
   }
   if (reports.isEmpty()) {
     Fabric.getLogger().m23d(Fabric.TAG, "No reports found.");
   }
   return reports;
 }
Ejemplo n.º 5
0
 public static void initialize(Application app) {
   Timber.d("{analytics enabled} Enabling Crashlytics");
   Timber.d("{analytics enabled} Enabling Answers");
   Fabric fabric =
       new Fabric.Builder(app).kits(new Crashlytics(), new Answers()).debuggable(true).build();
   Fabric.with(fabric);
 }
Ejemplo n.º 6
0
  @Override
  protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    TwitterAuthConfig authConfig = new TwitterAuthConfig(TWITTER_KEY, TWITTER_SECRET);
    Fabric.with(this, new Twitter(authConfig));
    TwitterSession session = Twitter.getInstance().core.getSessionManager().getActiveSession();

    if (session != null) {
      Twitter4JFactory.generateInstance(
          TWITTER_KEY, TWITTER_SECRET, session.getAuthToken().token, session.getAuthToken().secret);
      Twitter.getApiClient(session)
          .getAccountService()
          .verifyCredentials(
              false,
              true,
              new com.twitter.sdk.android.core.Callback<User>() {

                Intent intent = new Intent(LoginActivity.this, MainActivity.class);

                @Override
                public void success(Result<User> result) {
                  startActivity(intent);
                  finish();
                }

                @Override
                public void failure(TwitterException e) {
                  loadLoginScreen();
                  // Continues execution
                }
              });
    } else {
      loadLoginScreen();
    }
  }
Ejemplo n.º 7
0
 @Override
 public void onCreate() {
   super.onCreate();
   Fabric.with(this, new Crashlytics());
   Timber.plant(BuildConfig.DEBUG ? new Timber.DebugTree() : new TimberCrashReportingTree());
   component = getDaggerComponent();
 }
  @Override
  protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    TwitterAuthConfig authConfig =
        new TwitterAuthConfig(Constants.TWITTER_KEY, Constants.TWITTER_SECRET);
    Fabric.with(this, new TwitterCore(authConfig), new Digits());

    authCallback =
        new AuthCallback() {
          @Override
          public void success(DigitsSession session, String phoneNumber) {
            Toast.makeText(getBaseContext(), "Success", Toast.LENGTH_LONG).show();
            startProfileActivity(phoneNumber);
          }

          @Override
          public void failure(DigitsException exception) {
            Toast.makeText(getBaseContext(), "Failure", Toast.LENGTH_LONG).show();
          }
        };

    setContentView(com.crimepunch.app.R.layout.activity_registration);

    DigitsAuthButton digitsButton = (DigitsAuthButton) findViewById(R.id.auth_button);
    digitsButton.setCallback(authCallback);

    if (session.getUser(this) != null) {
      startHomeActivity();
    }
  }
  @Override
  protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    TwitterAuthConfig authConfig = new TwitterAuthConfig(TWITTER_KEY, TWITTER_SECRET);
    Fabric.with(this, new Twitter(authConfig));
    setContentView(R.layout.activity_login);
    // Set up the login form.
    mEmailView = (AutoCompleteTextView) findViewById(R.id.email);
    populateAutoComplete();

    mPasswordView = (EditText) findViewById(R.id.password);
    mPasswordView.setOnEditorActionListener(
        new TextView.OnEditorActionListener() {
          @Override
          public boolean onEditorAction(TextView textView, int id, KeyEvent keyEvent) {
            if (id == R.id.login || id == EditorInfo.IME_NULL) {
              attemptLogin();
              return true;
            }
            return false;
          }
        });

    Button mEmailSignInButton = (Button) findViewById(R.id.email_sign_in_button);
    mEmailSignInButton.setOnClickListener(
        new OnClickListener() {
          @Override
          public void onClick(View view) {
            attemptLogin();
          }
        });

    mLoginFormView = findViewById(R.id.login_form);
    mProgressView = findViewById(R.id.login_progress);
  }
 @Override
 public void onCreate() {
   if (BuildConfig.USE_CRASHLYTICS) {
     Fabric.with(this, new Crashlytics());
   }
   super.onCreate();
 }
 private HttpRequest applyMultipartDataTo(
     HttpRequest paramHttpRequest, AppRequestData paramAppRequestData) {
   HttpRequest localHttpRequest =
       paramHttpRequest
           .part("app[identifier]", paramAppRequestData.appId)
           .part("app[name]", paramAppRequestData.name)
           .part("app[display_version]", paramAppRequestData.displayVersion)
           .part("app[build_version]", paramAppRequestData.buildVersion)
           .part("app[source]", Integer.valueOf(paramAppRequestData.source))
           .part("app[minimum_sdk_version]", paramAppRequestData.minSdkVersion)
           .part("app[built_sdk_version]", paramAppRequestData.builtSdkVersion);
   if (!CommonUtils.isNullOrEmpty(paramAppRequestData.instanceIdentifier)) {
     localHttpRequest.part("app[instance_identifier]", paramAppRequestData.instanceIdentifier);
   }
   Object localObject;
   if (paramAppRequestData.icon != null) {
     localObject = null;
     paramHttpRequest = null;
   }
   try {
     InputStream localInputStream =
         this.kit
             .getContext()
             .getResources()
             .openRawResource(paramAppRequestData.icon.iconResourceId);
     paramHttpRequest = localInputStream;
     localObject = localInputStream;
     localHttpRequest
         .part("app[icon][hash]", paramAppRequestData.icon.hash)
         .part("app[icon][data]", "icon.png", "application/octet-stream", localInputStream)
         .part("app[icon][width]", Integer.valueOf(paramAppRequestData.icon.width))
         .part("app[icon][height]", Integer.valueOf(paramAppRequestData.icon.height));
     CommonUtils.closeOrLog(localInputStream, "Failed to close app icon InputStream.");
   } catch (Resources.NotFoundException localNotFoundException) {
     for (; ; ) {
       localObject = paramHttpRequest;
       Fabric.getLogger()
           .e(
               "Fabric",
               "Failed to find app icon with resource ID: "
                   + paramAppRequestData.icon.iconResourceId,
               localNotFoundException);
       CommonUtils.closeOrLog(paramHttpRequest, "Failed to close app icon InputStream.");
     }
   } finally {
     CommonUtils.closeOrLog((Closeable) localObject, "Failed to close app icon InputStream.");
   }
   if (paramAppRequestData.sdkKits != null) {
     paramHttpRequest = paramAppRequestData.sdkKits.iterator();
     while (paramHttpRequest.hasNext()) {
       paramAppRequestData = (KitInfo) paramHttpRequest.next();
       localHttpRequest.part(
           getKitVersionKey(paramAppRequestData), paramAppRequestData.getVersion());
       localHttpRequest.part(
           getKitBuildTypeKey(paramAppRequestData), paramAppRequestData.getBuildType());
     }
   }
   return localHttpRequest;
 }
 @Override
 public void onCreate() {
   super.onCreate();
   Fabric.with(this, new Crashlytics());
   AppApi.createInstance(getApplicationContext());
   FacebookSdk.sdkInitialize(getApplicationContext());
   Fresco.initialize(this);
 }
Ejemplo n.º 13
0
  @Override
  public void onCreate() {
    super.onCreate();
    Fabric.with(this, new Crashlytics());
    if (AppPrefs.getInstance(this).once(FIRST_SEED))
      Queues.localQueue(this).execute(new SeedScheduleDataTask());

    if (AppPrefs.getInstance(this).isLoggedIn()) RefreshScheduleDataKot.Companion.callMe(this);
  }
  @Override
  public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    Fabric.with(this, new Crashlytics());

    setContentView(R.layout.main_activity_layout);

    launch();
  }
Ejemplo n.º 15
0
  @Override
  protected void onActivityResult(int requestCode, int resultCode, Intent data) {
    super.onActivityResult(requestCode, resultCode, data);

    Fabric.with(this, new TweetComposer());
    TweetComposer.Builder builder =
        new TweetComposer.Builder(this).text("#teamasia My heart Rate just went up to!");
    builder.show();
  }
  @Override
  public void onCreate() {
    super.onCreate();

    Fabric.with(this, new Crashlytics());

    mApplicationComponent =
        DaggerApplicationComponent.builder().applicationModule(new ApplicationModule(this)).build();
  }
Ejemplo n.º 17
0
  @Override
  protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    TwitterAuthConfig authConfig =
        new TwitterAuthConfig(
            TWITTER_KEY, TWITTER_SECRET); // register with twitter using the key and secret
    Fabric.with(
        this, new TwitterCore(authConfig), new TweetComposer()); // set up a new twitter instance
    Fabric.with(this, new Twitter(authConfig), new Answers());
    SharedPreferences loggedin_pref =
        getSharedPreferences(
            "PREFS_NAME",
            0); // a sharedpreference value shared among all activities to determine whether the
    // user has logged in
    Boolean test_existence = loggedin_pref.getBoolean("Loggedin", false);
    if (test_existence == null) {
      SharedPreferences.Editor editor = loggedin_pref.edit(); // edit the sharedpreference
      editor.clear();
      editor.putBoolean("Loggedin", false); // default value set to "false"
      editor.commit(); // make the change
    }
    boolean loggedin =
        loggedin_pref.getBoolean(
            "Loggedin",
            false); // set up a boolean value called loggedin, the value of which will be determined
    // by the value in sharedpreference

    // setContentView(R.layout.activity_main);//set the screen to activity_main
    if (!loggedin) { // if the user is logged in
      this.finish();
      Intent act3 =
          new Intent(
              getApplicationContext(), Main3Activity.class); // start activity 3 (send a tweet)
      startActivity(act3); // start activity 3

    } else { // if the user is not logged in
      this.finish();
      Intent act2 =
          new Intent(
              getApplicationContext(),
              Main2Activity.class); // start activity 2 (prompt the user to log in)
      startActivity(act2); // start activity 2
    }
  }
  public TwitterLoginManager(ReactApplicationContext reactContext, Context activityContext) {
    super(reactContext);

    mActivityContext = activityContext;

    TwitterAuthConfig authConfig = new TwitterAuthConfig(TWITTER_KEY, TWITTER_SECRET);
    Fabric.with(mActivityContext, new Crashlytics(), new Twitter(authConfig));

    mTwitterAuthClient = new TwitterAuthClient();
  }
Ejemplo n.º 19
0
 @Override
 public AppSession deserialize(String serializedSession) {
   if (!TextUtils.isEmpty(serializedSession)) {
     try {
       return gson.fromJson(serializedSession, AppSession.class);
     } catch (Exception e) {
       Fabric.getLogger().d(TwitterCore.TAG, "Failed to deserialize session " + e.getMessage());
     }
   }
   return null;
 }
Ejemplo n.º 20
0
 @Override
 public String serialize(AppSession session) {
   if (session != null && session.getAuthToken() != null) {
     try {
       return gson.toJson(session);
     } catch (Exception e) {
       Fabric.getLogger().d(TwitterCore.TAG, "Failed to serialize session " + e.getMessage());
     }
   }
   return "";
 }
 public boolean invoke(CreateReportRequest createreportrequest) {
   createreportrequest =
       applyMultipartDataTo(
           applyHeadersTo(getHttpRequest(), createreportrequest), createreportrequest);
   Fabric.getLogger()
       .d(
           "CrashlyticsCore",
           (new StringBuilder()).append("Sending report to: ").append(getUrl()).toString());
   int i = createreportrequest.code();
   Fabric.getLogger()
       .d(
           "CrashlyticsCore",
           (new StringBuilder())
               .append("Create report request ID: ")
               .append(createreportrequest.header("X-REQUEST-ID"))
               .toString());
   Fabric.getLogger()
       .d("CrashlyticsCore", (new StringBuilder()).append("Result was: ").append(i).toString());
   return ResponseParser.parse(i) == 0;
 }
Ejemplo n.º 22
0
 public void onRun() {
   try {
     attemptUploadWithRetry();
   } catch (Exception e) {
     Fabric.getLogger()
         .m26e(
             Fabric.TAG,
             "An unexpected error occurred while attempting to upload crash reports.",
             e);
   }
   ReportUploader.this.uploadThread = null;
 }
Ejemplo n.º 23
0
  @Override
  protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);
    // Crashlytics
    Fabric.with(this, new Crashlytics());
    Crashlytics.setString("git_sha", BuildConfig.GIT_SHA);
    // Adding Toolbar to Main screen
    Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
    setSupportActionBar(toolbar);
    // Setting ViewPager for each Tabs
    ViewPager viewPager = (ViewPager) findViewById(R.id.viewpager);
    setupViewPager(viewPager);
    // Set Tabs inside Toolbar
    TabLayout tabs = (TabLayout) findViewById(R.id.tabs);
    tabs.setupWithViewPager(viewPager);
    // Create Navigation drawer and inflate layout
    NavigationView navigationView = (NavigationView) findViewById(R.id.nav_view);
    mDrawerLayout = (DrawerLayout) findViewById(R.id.drawer);
    // Adding menu icon to Toolbar
    ActionBar supportActionBar = getSupportActionBar();
    if (supportActionBar != null) {
      supportActionBar.setHomeAsUpIndicator(R.drawable.ic_menu_white_24dp);
      supportActionBar.setDisplayHomeAsUpEnabled(true);
    }
    // Set behavior of Navigation drawer
    navigationView.setNavigationItemSelectedListener(
        new NavigationView.OnNavigationItemSelectedListener() {
          // This method will trigger on item Click of navigation menu
          @Override
          public boolean onNavigationItemSelected(MenuItem menuItem) {
            // Set item in checked state
            menuItem.setChecked(true);

            // TODO: add navigation

            // Closing drawer on item click
            mDrawerLayout.closeDrawers();
            return true;
          }
        });
    // Adding Floating Action Button to bottom right of main view
    FloatingActionButton fab = (FloatingActionButton) findViewById(R.id.fab);
    fab.setOnClickListener(
        new View.OnClickListener() {
          @Override
          public void onClick(View v) {
            Snackbar.make(v, "Snackbar!", Snackbar.LENGTH_LONG).show();
          }
        });
  }
Ejemplo n.º 24
0
  @Override
  public void onCreate() {
    super.onCreate();

    JodaTimeAndroid.init(this);

    TwitterAuthConfig authConfig = new TwitterAuthConfig(TWITTER_KEY, TWITTER_SECRET);
    Fabric.with(this, new Crashlytics(), new Twitter(authConfig));

    applicationComponent =
        DaggerApp_ApplicationComponent.builder()
            .applicationModule(new ApplicationModule(this))
            .build();
  }
Ejemplo n.º 25
0
  @Override
  public void onCreate() {
    super.onCreate();
    // Parse.enableLocalDatastore(this);
    Parse.initialize(
        this,
        "4r6GuVjJO85qw30CpTtEAcxRKY2xN7ividCi4yQA",
        "E6a1zZSV37Gs9Mv56L5ylP9cnqVcXbkTWRyFuywX");
    ParseInstallation.getCurrentInstallation().saveInBackground();
    TwitterAuthConfig authConfig = new TwitterAuthConfig(TWITTER_KEY, TWITTER_SECRET);
    Fabric.with(this, new Twitter(authConfig));

    // Enable Local Datastore.
  }
Ejemplo n.º 26
0
  /** Initialize the app object */
  public void init() {

    // Leak Tracking
    //        refWatcher = LeakCanary.install(this);
    // Logging
    Timber.plant(new Timber.DebugTree());

    initFirebase();

    // Crashes
    if (!BuildConfig.DEBUG) {
      Fabric.with(this, new Crashlytics());
    }
  }
 @Override
 protected void setUp() throws Exception {
   super.setUp();
   // Set a mock thread pool executor so we can run these tests knowing that doInBackground
   // has not been run.
   Fabric.with(
       new Fabric.Builder(getContext())
           .threadPoolExecutor(mock(PriorityThreadPoolExecutor.class))
           .kits(
               new TwitterCore(
                   new TwitterAuthConfig(TestFixtures.CONSUMER_KEY, TestFixtures.CONSUMER_SECRET)),
               new TweetUi())
           .build());
 }
Ejemplo n.º 28
0
  @Override
  public void onCreate() {
    super.onCreate();
    long startDate = SystemClock.elapsedRealtime();

    mContext = this;

    ProfilingUtils.start("App Startup");
    // Enable log recording
    AppLog.enableRecording(true);
    AppLog.i(T.UTILS, "WordPress.onCreate");

    if (!PackageUtils.isDebugBuild()) {
      Fabric.with(this, new Crashlytics());
    }

    versionName = PackageUtils.getVersionName(this);
    initWpDb();
    enableHttpResponseCache(mContext);

    // EventBus setup
    EventBus.TAG = "WordPress-EVENT";
    EventBus.builder()
        .logNoSubscriberMessages(false)
        .sendNoSubscriberEvent(false)
        .throwSubscriberException(true)
        .installDefaultEventBus();
    EventBus.getDefault().register(this);

    RestClientUtils.setUserAgent(getUserAgent());

    // Volley networking setup
    setupVolleyQueue();

    AppLockManager.getInstance().enableDefaultAppLockIfAvailable(this);
    if (AppLockManager.getInstance().isAppLockFeatureEnabled()) {
      AppLockManager.getInstance()
          .getCurrentAppLock()
          .setDisabledActivities(
              new String[] {"org.wordpress.android.ui.ShareIntentReceiverActivity"});
    }

    HelpshiftHelper.init(this);

    ApplicationLifecycleMonitor applicationLifecycleMonitor = new ApplicationLifecycleMonitor();
    registerComponentCallbacks(applicationLifecycleMonitor);
    registerActivityLifecycleCallbacks(applicationLifecycleMonitor);

    initAnalytics(SystemClock.elapsedRealtime() - startDate);
  }
Ejemplo n.º 29
0
  @Override
  public void onCreate() {
    super.onCreate();

    ////////////////////////////////////////////////////////////////////////////////////////////
    ////////////////////////////////////////////////////////////////////////////////////////////

    // Enable Fabric Crashanalytics ////////////////////////////////////////////////////////////

    Fabric.with(this, new Crashlytics());

    // Initialize Parse Crash Reporting ////////////////////////////////////////////////////////

    // ParseCrashReporting.enable(this);

    // Enable Local Datastore //////////////////////////////////////////////////////////////////

    // Parse.enableLocalDatastore(this);

    // Initialization Parse & Fresco ///////////////////////////////////////////////////////////

    Fresco.initialize(this);
    Parse.initialize(this);

    // Set Global Parse settings ///////////////////////////////////////////////////////////////

    ParseUser.enableAutomaticUser();
    ParseACL defaultACL = new ParseACL();
    defaultACL.setPublicReadAccess(true);
    defaultACL.setPublicWriteAccess(true);
    ParseACL.setDefaultACL(defaultACL, true);

    // Save user - required for first launch
    ParseUser.getCurrentUser()
        .saveInBackground(
            new SaveCallback() {
              @Override
              public void done(ParseException e) {
                if (e != null) e.printStackTrace();
              }
            });

    // Save the current Installation to Parse and associate the device with a user
    ParseInstallation installation = ParseInstallation.getCurrentInstallation();
    installation.put(DiaryActivity.PARSE_USER_NAME, ParseUser.getCurrentUser());
    installation.saveInBackground();

    ////////////////////////////////////////////////////////////////////////////////////////////
    ////////////////////////////////////////////////////////////////////////////////////////////
  }
Ejemplo n.º 30
0
  @Override
  public void initLogin(final Activity activity) {
    TwitterAuthConfig authConfig = new TwitterAuthConfig(consumerKey, consumerSecret);
    Fabric.with(activity, new TwitterCore(authConfig));
    // Check if already logged in

    loginButton = new TwitterLoginButton(activity);

    loginButton.setCallback(
        new Callback<TwitterSession>() {
          @Override
          public void success(final Result<TwitterSession> result) {
            // Do something with result, which provides a TwitterSession for making API calls

            TwitterCore.getInstance()
                .getApiClient()
                .getAccountService()
                .verifyCredentials(
                    true,
                    false,
                    new Callback<User>() {

                      @Override
                      public void failure(TwitterException e) {}

                      @Override
                      public void success(Result<User> userResult) {

                        User user = userResult.data;
                        Social.getSingleton()
                            .getCallback()
                            .onSocialLoginSuccess(
                                new SocialUserProfile(
                                    result, user.email, user.name, user.profileImageUrl),
                                SocialType.TWITTER);
                        activity.finish();
                      }
                    });
          }

          @Override
          public void failure(TwitterException exception) {
            // Do something on failure
            Social.getSingleton().getCallback().onSocialLoginFailure("Failed");
            exception.printStackTrace();
            activity.finish();
          }
        });
    loginButton.performClick();
  }