- Home /
[U3DXT] Bug? SocialXT.PostCompleted called with completed=true even if posting was unsuccessful
In an iOS project I have a SocialXT.Post call, and a delegate that responds to the PostCompleted event.
This setup works well, but I have found one case where the PostCompletedEventArgs parameter of the delegate gets a wrong result.
Environment:
- Unity 3.5.7 
- U3DXT Pro Version 1.6.4.0 
To reproduce:
- make sure the device cannot get on the net (disable WIFI/3G, or just turn on airplane mode) 
- in the iOS app initiate the SocialXT.Post call, and press the Send button in the message composition dialog 
- another dialog will show up stating "Cannot Send Tweet", press Cancel 
In the process of this you'll see multiple warnings asking you to turn on WIFI / turn off airplane mode, disregard those.
Result: The PostCompleted delegate will be called with a PostCompletedEventArgs object, where completed=true, even though posting didn't work.
Answer by u3dxt · Jan 13, 2014 at 06:21 PM
Hi attilam, this is an issue in the native iOS API. Other people have reported the same thing: http://stackoverflow.com/questions/16766406/slcomposeviewcontrollerresultdone-when-no-network. A solution as suggested in that link is to check network reachability first. Unity comes with a call for that, Application.internetReachability.
 if (Application.internetReachability == NetworkReachability.NotReachable)
   GUIXT.ShowAlert("No network", "Can't post without network access.", "OK", new string[]{});
 else
   SocialXT.Post(...);
 
Thanks, this solution works. Strange why they implemented it this way, seems like broken API to me.
Your answer
 
 
             Follow this Question
Related Questions
U3DXT StoreProductViewController behaves strange 0 Answers
unity 5 u3dxt xCode errors 0 Answers
U3DXT Game Crashes when calling SocialXT.Share 1 Answer
U3DXT: ResetAchievements method not visible? 1 Answer
U3DXT access LaunchImage/Splash screen? 2 Answers
 koobas.hobune.stream
koobas.hobune.stream 
                       
                
                       
			     
			 
                