android Facebook SDK cannot share image -
i developing app can share image facebook. can share image, other people cannot share. have fab , calling activity on onclick()
method. don't know do, app live when click on app name on shared photo get
"misconfigured app
sorry, myapp hasn't been approved display in app centre."
what reason others cannot share images? need answer. thanks.
public class shareactivity extends appcompatactivity { private callbackmanager callbackmanager; private loginmanager manager; @override protected void oncreate(bundle savedinstancestate) { { super.oncreate(savedinstancestate); setcontentview(r.layout.activity_main); facebooksdk.sdkinitialize(getapplicationcontext()); callbackmanager = callbackmanager.factory.create(); list<string> permissionneeds = arrays.aslist("publish_actions"); //this loginmanager helps eliminate adding loginbutton ui manager = loginmanager.getinstance(); manager.loginwithpublishpermissions(this, permissionneeds); manager.registercallback(callbackmanager, new facebookcallback<loginresult>() { @override public void onsuccess(loginresult loginresult) { sharephototofacebook(); toast.maketext(shareactivity.this, "success", toast.length_long).show(); finish(); } @override public void oncancel() { toast.maketext(shareactivity.this, "cancel", toast.length_long).show(); finish(); } @override public void onerror(facebookexception error) { toast.maketext(shareactivity.this, "error", toast.length_long).show(); finish(); } }); } } private void sharephototofacebook(){ try { url url = new url("http://burakakyalcin.site/image.png"); bitmap image = bitmapfactory.decodestream(url.openconnection().getinputstream()); sharephoto photo = new sharephoto.builder() .setbitmap(image) .setcaption("hello") .build(); sharephotocontent content = new sharephotocontent.builder() .addphoto(photo) .build(); shareapi.share(content, null); } catch(ioexception e) { system.out.println(e); } } @override protected void onactivityresult(int requestcode, int responsecode, intent data) { super.onactivityresult(requestcode, responsecode, data); callbackmanager.onactivityresult(requestcode, responsecode, data); }
}
Comments
Post a Comment