Facebook Android SDK Session openForPublish not creating a new session -


in facebook android sdk when call

session tempsession = new builder(this).build(); session.setactivesession(tempsession); tempsession.openforread(new openrequest(this).setpermissions(fb_permissions)); 

it gets fb session , every thing runs normal. when replace read publish. i.e. follows

session tempsession = new builder(this).build(); session.setactivesession(tempsession); tempsession.openforpublish(new openrequest(this).setpermissions(fb_permissions)); 

it gives error saying, session empty, , cannot publish permissions empty session.

can please tell why , best way handle this?

the short answer is, don't call openforpublish. call openforread, , requestnewpublishpermissions later if need publish permissions.

the long answer is, can't request publish permissions (on user who's never connected facebook before via app) unless have basic or default permissions (what if call openforread empty permission set). openforpublish handles specific niche use case apps don't have.


Comments

Popular posts from this blog

monitor web browser programmatically in Android? -

Shrink a YouTube video to responsive width -

wpf - PdfWriter.GetInstance throws System.NullReferenceException -