1
패브릭 디지트로 친구 찾기를 구현하는 방법은 무엇입니까? 속도 제한패브릭 디지트로 친구 찾기를 구현하는 방법은 무엇입니까?
을 초과 : 내가 성공적으로 연락처를 업로드하고 일치하는 연락처 ... 때마다 나는 오류가
같은 오류가 발생 얻기 위해 휴대 전화 번호를 확인하지만 메신저없는 구현 한
아래는 구현입니다.
registerReceiver(new MyResultReceiver() { @Override public void onReceive(Context context, Intent intent) { super.onReceive(context, intent); if (ContactsUploadService.UPLOAD_COMPLETE.equals(intent.getAction())) { ContactsUploadResult result = intent.getParcelableExtra(ContactsUploadService.UPLOAD_COMPLETE_EXTRA); Log.e("upload", result.totalCount + " " + result.successCount); } } }, new IntentFilter("com.digits.sdk.android.UPLOAD_COMPLETE")); sharedPreferences = getSharedPreferences(MyPREFERENCES, Context.MODE_PRIVATE); Ref = FirebaseDatabase.getInstance().getReference().child("Users"); DigitsAuthButton digitsButton = (DigitsAuthButton) findViewById(R.id.auth_button); digitsButton.setCallback(new AuthCallback() { @Override public void success(DigitsSession session, String phoneNumber) { // TODO: associate the session userID with your user model phone = session.getPhoneNumber(); digitsId = String.valueOf(session.getId()); Toast.makeText(getApplicationContext(), "Authentication successful for " + phoneNumber, Toast.LENGTH_LONG).show(); Log.e("number", "Mobile Number: " + phoneNumber); Log.e("digit", "DigitsID " + session.getAuthToken() + " " + session.getId()); // Digits.getInstance().getActiveSession(); sendDigitANdNumber(String.valueOf(session.getId()), phoneNumber); // startService(new Intent(PhoneVerification.this, MyResultReceiver.class)); startActivity(new Intent(PhoneVerification.this, RecentsTab.class)); finish(); } @Override public void failure(DigitsException exception) { Log.d("Digits", "Sign in with Digits failure", exception); } }); }
Receivr
public class MyResultReceiver extends BroadcastReceiver { @Override public void onReceive(Context context, Intent intent) { if (ContactsUploadService.UPLOAD_COMPLETE.equals(intent.getAction())) { ContactsUploadResult result = intent.getParcelableExtra(ContactsUploadService.UPLOAD_COMPLETE_EXTRA); } } }
연락처 클래스
find.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { ContactMatch(); } }); private void ContactMatch() { Digits.uploadContacts(); progressDialog.show(); Digits.findFriends(new ContactsCallback<Contacts>() { @Override public void success(Result<Contacts> result) { if (result.data.users != null) { // Process data progressDialog.dismiss(); linearLayout.setVisibility(View.GONE); Log.e("data", result.toString()); } } @Override public void failure(TwitterException exception) { progressDialog.dismiss(); // Show error } }); }