[Resolved]Android LogginButton: An error occurred.Please try again later(Invalid Application ID: The provided Application ID is invalid.) -


i made demo following tutorial "use facebook login".

i have setted code in mainfragment:

loginbutton authbutton = (loginbutton) view.findviewbyid(r.id.authbutton); authbutton.setfragment(this); authbutton.setloginbehavior(sessionloginbehavior.suppress_sso); authbutton.setreadpermissions(arrays.aslist("user_likes", "user_status")); 

i encountered error when logging in second account. meant logged in account before. logged out, , tried log in second account.

it showed error dialog showed message, "an error occurred. please try again later," title "error" , "okay" button on right.

i tried see error add below code.i got it,but still didn't understand how now.

authbutton.setonerrorlistener(new onerrorlistener() {         @override         public void onerror(facebookexception error) {             log.e("test", "error: "+error.getmessage());         }     }); 

it show:

error: kerror 1349040: invalid application id: provided application id invalid. 

but when tried log in account before, successful again.

before error,i have encountered error:

remote_app_id not match stored id 

i changed key hash in setting "getting started facebook sdk android " recommended. add code:

 // add code print out key hash     try {         packageinfo info = getpackagemanager().getpackageinfo(                 "com.facebook.samples.hellofacebook",                  packagemanager.get_signatures);         (signature signature : info.signatures) {             messagedigest md = messagedigest.getinstance("sha");             md.update(signature.tobytearray());             log.d("keyhash:", base64.encodetostring(md.digest(), base64.default));             }     } catch (namenotfoundexception e) {      } catch (nosuchalgorithmexception e) {      } 

so logged in successful.

also,i tried use release key , sign apk.the result same.one account can ,another can not.

now,these day ,i tried again.the error disappeared.only show white dialog nothing delete button on left top.

note: use facebook sdk android v3.01.

[problem resolved]

two factors led problem.

firstly,it's openssl utility wrong.then download doc recommended in use facebook login

secondly, sandbox checked default.i unchecked sandbox mode in dashboard anton roy said in answer.

have unchecked sandbox mod on facebook application ?

it's enabled default, had same problem , has resolved issue.


Comments

Popular posts from this blog

Why does Ruby on Rails generate add a blank line to the end of a file? -

keyboard - Smiles and long press feature in Android -

node.js - Bad Request - node js ajax post -