7 Replies Latest reply: Jul 16, 2014 2:30 PM by Craig Grummitt RSS

    SocialUI does not Trigger Event.COMPLETE

    DavidDragon Community Member

      The SocialUI for Twitter and Facebook do not dispatch events for Event.COMPLETE. They do work for Event.CANCEL, but when you post it does not trigger. What could be the cause? Is the event not handled correctly in the ANE or is it dispatching an event that is different from Event.COMPLETE and the documentation is wrong? Does this feature not work in Sandbox mode?

        • 1. Re: SocialUI does not Trigger Event.COMPLETE
          DavidDragon Community Member

          Can anyone else confirm they get this behavior? I also noticed that the GameCenterController acceptMatch() requires 2 arguments (the invite event and a boolean) while in the documentation it only lists the one parameter (invite event) and I presume the boolean is if you accept or not. I also was unable to trigger the GameCenterMatchEvent matchPlayerConnected (but disconnect does work). Still undergoing testing of GameCenter and match features.

          • 2. Re: Re: SocialUI does not Trigger Event.COMPLETE
            Craig Grummitt Community Member

            I can confirm I'm seeing this as well(re: the . I was following this post hoping for updates, not wanting to post a 'me too' for fear of scaring away potential responderers from not bothering when they notice that someone had already responded! Such a shame, the classes look useful, just missing some key features such as this complete event not triggering or good documentation!

             

            I was curious as to what statusEventHandler() was doing in the SocialUI api docs. The STATUS event never seemed to trigger, so what was the event handler doing there? So I extended the SocialUI class to be able to override this handler and see if it was ever being called, and it turns out it does get called in the following situations:

            FB dialog:

            • user hits Post: "MessageDialogFinishedEvent"
            • user hits Cancel: "MessageDialogCancelledEvent"

            The Twitter dialog doesn't seem to trigger this method and unfortunately - the status event handler doesn't seem to receive an event when the image is successfully posted to facebook.

             

            I also overrode the SocialUI's dispatchEvent method to see if it was dispatching any interesting events, but unfortunately nothing interesting came out of that.

             

            Frustrating - these classes are starting to feel unfinished, and without support - feels like the only solutions available are:

            • accept the frustrating limitations on these classes and work with it
            • use a third party solution like milkman
            • build your own ANE.

             

            If by chance you are interested in extending the SocialUI class to be able to listen for the facebook MessageDialog events, here's my class:

            package  {
              import com.adobe.ane.social.SocialUI;
              import flash.events.StatusEvent;
            
              public class SpecialUI extends SocialUI {
               public static const MESSAGE_DIALOG_FINISHED_EVENT:String="MessageDialogFinishedEvent";
               public static const MESSAGE_DIALOG_CANCELLED_EVENT:String="MessageDialogCancelledEvent";
               public function SpecialUI(arg0:String) {
                super(arg0);
               }
               override protected function statusEventHandler(e:StatusEvent):void {
                dispatchEvent(e);  //
                super.statusEventHandler(e);
               }
              }
            }
            
            //and here is how you could call it:
            sUI = new SpecialUI(SocialServiceType.FACEBOOK);
            sUI.addEventListener(StatusEvent.STATUS,goStatus);
            sUI.launch();
            private function goStatus(event:StatusEvent):void {
                 if (event.code==SpecialUI.MESSAGE_DIALOG_FINISHED_EVENT) {
                      trace("user at least TRIED to post to facebook! this does not guarantee that it posted ok");
            
                 }
            }
            
            • 3. Re: SocialUI does not Trigger Event.COMPLETE
              DavidDragon Community Member

              I noticed the status event method as well but didn't think to make an override for it! I also tried overriding dispatchEvent() to see if I could find any other events that trigger at any point and found none. It might just be some framework meant to get data from Twitter/Facebook that was never implemented. I did find that the statusEventHandler does trigger for "cancel" and "post" for both Twitter and Facebook so I was able to fix the problem I was having (which was an event triggered for cancel but no event was dispatched if they post so I couldn't figure out how to restart the app if they post). Not sure why your test indicated that it didn't work for twitter but it worked for me.

               

              No way to actually tell if something was actually post though (maybe for future implementation). The farthest I could dig was an ExtentionConText object (the target of the statusEventHandler event), but theres no documentation on what functions are available through it. I'm kind of surprised the gaming SDK is not open source but does not even have documentation for native features and function within the native classes. Most of it seems to work great but its problematic that they provide almost no documentation or references to work off of despite the fact they apparently tested these things.

              • 4. Re: SocialUI does not Trigger Event.COMPLETE
                nimitja Employee Hosts

                We are able to reproduce the issue and now investigating on it.

                 

                Thanks for reporting,

                Nimit

                • 5. Re: SocialUI does not Trigger Event.COMPLETE
                  Craig Grummitt Community Member

                  David - you are right, statusEventHandler does get triggered for Twitter as well(I didn't have my event handlers set up correctly for Twitter). Interesting discover with the ExtensionContext - found docs for that here.

                  Nimitja, thanks for looking into it, looking forward to hearing more on this soon.

                  • 6. Re: SocialUI does not Trigger Event.COMPLETE
                    DavidDragon Community Member

                    If there were more transparency with the content of the ANEs wed be able to use the ExtensionContext to call native functions directly. I really like the Gaming SDK and its generally given me few problems, but when it does there's poor documentation, no information on native functions, and I can't explore the native code for solutions. Thanks for replying with a status on the issue Nimitja!

                    • 7. Re: SocialUI does not Trigger Event.COMPLETE
                      Craig Grummitt Community Member

                      FYI I've been researching alternatives and StickSports/Social-ANE · GitHub appears to be very similar, and the complete and cancel events are working for me.