java - Truecaller android sdk Error Code 3 -


i trying implement truecaller android-sdk sign in/sign on 1 of personal app. received partner key truecaller implement in app. error occurs on pressing 'autofill truecaller' returns 'error code 3' on 'trueerror.geterrortype( )' in 'public void onfailureprofileshared()'. can't seem find method describing error. happen know fix error?

my implementation:

public class auth extends appcompatactivity implements itruecallback{  private truebutton truebutton = null; private trueclient trueclient = null;  private string mtruecallerrequestnonce = null;   @override protected void oncreate(bundle savedinstancestate) {     super.oncreate(savedinstancestate);     setcontentview(r.layout.activity_auth);     truebutton = (truebutton) findviewbyid(r.id.com_truecaller_android_sdk_truebutton);      boolean isusable = truebutton.isusable();     if(isusable) {         trueclient = new trueclient(auth.this, auth.this);         truebutton.settrueclient(trueclient);     }     else {         truebutton.setvisibility(view.gone);     }      truebutton.setonclicklistener(new view.onclicklistener() {         @override         public void onclick(view view) {             trueclient.gettruecalleruserprofile(auth.this);         }     }); }   @override protected void onresume() {     mtruecallerrequestnonce = trueclient.generaterequestnonce();     super.onresume(); }  @override protected void onactivityresult(int requestcode, int resultcode, intent data) {     if(trueclient!=null && trueclient.onactivityresult(requestcode, resultcode, data)) {         return;     }     super.onactivityresult(requestcode, resultcode, data); }  @override public void onsuccesprofileshared(@nonnull trueprofile trueprofile) {     toast.maketext(auth.this, trueprofile.firstname + " " + trueprofile.lastname, toast.length_long).show(); }  @override public void onfailureprofileshared(@nonnull trueerror trueerror) {     log.e("error code", trueerror.geterrortype() + " "); } } 

here list of of truecaller error codes:

error_type_internal = 0; error_type_network = 1; error_type_user_denied = 2; error_type_unauthorized_partner = 3; error_type_unauthorized_user = 4; error_type_truecaller_closed_unexpectedly = 5; error_type_truesdk_too_old = 6; error_type_possible_req_code_collision = 7; error_type_response_signature_missmatch = 8; error_type_request_nonce_missmatch = 9; 

these codes static members of trueerror class, access them so:

switch (trueerror.geterrortype()) {      case trueerror.error_type_internal:         //         break;     case trueerror.error_type_network:         // else         break;     // etc. } 

in case error getting error code 3, error_type_unauthorized_partner. have made sure partner key, , add line in androidmanifest.xml?

<meta-data android:name="com.truecaller.android.sdk.partnerkey" android:value="your_partner_key_here"/> 

Comments

Popular posts from this blog

php - Vagrant up error - Uncaught Reflection Exception: Class DOMDocument does not exist -

vue.js - Create hooks for automated testing -

Add new key value to json node in java -