Facebook SDK 3.0 android code works by starting from eclipse but not in playstore app? -
in our app integrated facebook new facebook sdk version 3.0.
if start app on test device eclipse works fine. facebook app (or webview if native app isn't installed) opens, logs in facebook calls , publishes post.
but if relaease code apk in google playstore, download there , test it, facebook app starts, user logs in , allows publishing, nothing happens, no post wall o_o.
here's code:
private void facebooklogin() { session.openactivesession(this, true, new session.statuscallback() { @override public void call(session session, sessionstate state, exception exception) { // todo auto-generated method stub if(session.isopened()) { performpublish(pendingaction.post_photo); } } }); } private void performpublish(pendingaction action) { session session = session.getactivesession(); if (session != null) { pendingaction = action; if (haspublishpermission()) { // can action right away. handlependingaction(); } else { // need new permissions, complete action when called back. session.requestnewpublishpermissions(new session.newpermissionsrequest(this, permissions)); } } } private void handlependingaction() { pendingaction previouslypendingaction = pendingaction; // these actions may re-set pendingaction if still pending, assume // succeed. pendingaction = pendingaction.none; switch (previouslypendingaction) { case post_photo: postphoto(); break; case post_status_update: poststatusupdate(); break; } } private void postphoto() { if (haspublishpermission()) { bitmap logo = g.getlevelbitmaps()[0]; request request = request.newuploadphotorequest(session.getactivesession(), logo, new request.callback() { @override public void oncompleted(response response) { poststatusupdate(); if(g.isachievementsactivated()) { swarm.init(logoquestion,3777,"831e03485c37444f9b94de8fdf2e676f"); swarmachievement.unlock(10093); } //toast.maketext(logoquestion, "posted", toast.length_short).show(); performpublish(pendingaction.post_status_update); } }); bundle params = new bundle(); params.putstring("description", "who know's logo? \n" + hintquestiontext+ " posted videogames logoquiz available android , ios"); //request.setparameters(params); request.executeasync(); } else { pendingaction = pendingaction.post_photo; } } private void poststatusupdate() { if (haspublishpermission()) { string question = "who know's logo? "+hintquestiontext+" videogames logoquiz. it's available ios , android."; request request = request .newstatusupdaterequest(session.getactivesession(), question, new request.callback() { @override public void oncompleted(response response) { toast.maketext(logoquestion, "posted", toast.length_short).show(); } }); request.executeasync(); } else { pendingaction = pendingaction.post_status_update; } }
the haspublishpermission function:
private boolean haspublishpermission() { session session = session.getactivesession(); return session != null && session.getpermissions().contains("publish_actions"); }
the permissions iam asking are:
private static final list<string> permissions = arrays.aslist("publish_actions","user_photos");
in android manifest have following permissions integrate facebook:
<uses-permission android:name="android.permission.internet"/> <uses-permission android:name="android.permission.access_network_state"/>
i'dont understand why it's working testing not on same release version.
anybody know's solution?
thank all!
Comments
Post a Comment