Ejemplo n.º 1
0
 public void validateSignedInUser() {
   if (Jump.getSignedInUser() != null && Jump.getAccessToken() != null) {
     try {
       loadLinkedUnlinkedAccounts();
     } catch (JSONException e) {
       Toast.makeText(LinkListActivity.this, "Account LinkUnlink Failed.", Toast.LENGTH_LONG)
           .show();
     }
   }
 }
Ejemplo n.º 2
0
 @Override
 public void jrAuthenticationDidSucceedForLinkAccount(
     JRDictionary auth_info, String provider) {
   String token = auth_info.getAsString("token");
   link_unlink = true;
   Jump.performLinkAccount(token, captureApiResultHandler);
 }
Ejemplo n.º 3
0
  public void loadLinkedUnlinkedAccounts() throws JSONException {
    Jump.performFetchCaptureData(
        new Jump.CaptureApiResultHandler() {
          @Override
          public void onSuccess(JSONObject response) {
            ArrayList<LinkData> linkUnlinkResults = new ArrayList<LinkData>();
            JSONObject json = response;
            try {
              JSONArray profiles = json.getJSONObject("result").getJSONArray("profiles");
              for (int i = 0; i < profiles.length(); i++) {
                JSONObject profileData = profiles.getJSONObject(i);
                LogUtils.loge(profileData.getString("domain"));
                LinkData linkedRecords =
                    new LinkData(
                        profileData.getString("identifier"), profileData.getString("domain"));
                linkUnlinkResults.add(linkedRecords);
                LogUtils.loge(profileData.getString("identifier"));
              }
              mAdapter = new LinkAccountsAdapter(LinkListActivity.this, linkUnlinkResults);
              link_account.setAdapter(mAdapter);
            } catch (JSONException e) {
              LogUtils.loge("Error parsing data " + e.toString());
            }
          }

          @Override
          public void onFailure(CaptureAPIError error) {
            Toast.makeText(LinkListActivity.this, "Account LinkUnlink Failed.", Toast.LENGTH_LONG)
                .show();
          }
        });
  }