android - Social Network Plugin doesn't login -


i use socialnetwork plugin android prime31 (here) in project facebook.
if use demo scene - work good. if in single window create 3 buttons (init, login, share) work good. if use facebookandroid.init() in first update (or awake or start) , login in window of game - after login fb window session isn't valid , can't share anything.

list of facebook controller:

public class facebookcontroller : monobehaviour {     public static facebookcontroller instance;      void awake ()     {         instance = this;     }      private bool isfirst = true;     void update ()      {         if (isfirst)         {             isfirst = false; #if unity_android             facebookandroid.init(); #endif         }     }      public void login()     { #if unity_android         var permissions = new string[] { "publish_actions", "publish_stream" };   facebookandroid.setsessionloginbehavior(facebooksessionloginbehavior.suppress_sso);         facebookandroid.loginwithpublishpermissions(permissions);  #endif     }      public void logoff()     { #if unity_android         facebookandroid.logout(); #endif     }      public bool islogged()     { #if unity_android         facebookandroid.issessionvalid(); #endif         return false;     }      public void share(string name, string message)     { #if unity_android         if (facebookandroid.issessionvalid())         {             var parameters = new dictionary<string, object>             {                 { "link", "http://prime31.com" },                 { "name", name },                 { "picture", "http://prime31.com/assets/images/prime31logo.png" },                 { "caption", message }             };             facebookandroid.showfacebooksharedialog(parameters);         } #endif     } } 


Comments

Popular posts from this blog

php - failed to open stream: HTTP request failed! HTTP/1.0 400 Bad Request -

java - How to filter a backspace keyboard input -

java - Show Soft Keyboard when EditText Appears -