Unity iOS, Android composer callback



when sharing, how can I receive the callback? And if you can not, will it be implemented?
In android works me fine, but in iOS I login but when I send a part, but it gives an error (Tweer failed to send, tweet not sent)



Currently there is no callback for the composer.

Can you paste the code you are using to call the Composer in CSharp?

Also paste the full stack trace from Xcode of the error.


My code is:


rong text

type or paste code here

void Start () { 		
  instance = this; 		
  urlLocal = Application.persistentDataPath; 		
  nameURLLocal = "/Screenshot.png"; 	
public void LoginTW () { 		
  Twitter.Init (); 		
  Twitter.LogIn (AuthCallback, (ApiError error) => { 			
  UnityEngine.Debug.Log (error.message); 		
  } ); 	
public void LoginCompleteWithCompose (int num) { 		
  METODO = num; 		
  Twitter.Init (); 		
  if (Twitter.Session != null) { 			
    TwitterSession session = Twitter.Session; 			
    string title = DataBaseLanguage.shareTitle [METODO]; 			
    string text = DataBaseLanguage.shareText [METODO]; 			
    string urlImagen = "https://pbs.twimg.com/media/DE7k80IXYAA_pgn.jpg"; 			
    listaDowloaderImagen = 1; 			
    downloadImage (urlImagen, urlLocal); 			
    StartCoroutine (esperandoDescargarImagen (title, text));  		
  } else { 			
    Twitter.LogIn (AuthCallback, (ApiError error) => { 				
      UnityEngine.Debug.Log (error.message); 			
    } ); 		
  Preformatted text} 	

IEnumerator esperandoDescargarImagen (string title, string text) { 
  while (listaDowloaderImagen != 0) { 
    yield return null; 
  Twitter.Compose (Twitter.Session, "file://" + urlLocal + nameURLLocal, title, new string[]{ text, URL });
public void downloadImage (string url, string pathToSaveImage) { 		
  WWW www = new WWW (url); 		
  StartCoroutine (_downloadImage (www, pathToSaveImage)); 	
private IEnumerator _downloadImage (WWW www, string savePath) { 		
  yield return www; 		
  //Check if we failed to send 		
  if (string.IsNullOrEmpty (www.error)) { 			
    //Save Image
    saveImage (savePath, www.bytes); 		
void saveImage (string path, byte [] imageBytes) { 		
  //Create Directory if it does not exist 		
  if (!Directory.Exists (Path.GetDirectoryName (path))) { 			
    Directory.CreateDirectory (Path.GetDirectoryName (path)); 		
  try { 	
    File.WriteAllBytes (path + nombreURLLocal, imageBytes); 			
  }catch (Exception e) { 			

The Xcode error is:
Did encounter error sending Tweet: Error Domain=TWTRNetworkingErrorDomain Code=-1011 “Request failed: unauthorized (401)” UserInfo={NSLocalizedFailureReason=, NSLocalizedDescription=Request failed: unauthorized (401), NSErrorFailingURLKey=https://api.twitter.com/1.1/statuses/update.json, TWTRNetworkingStatusCode=401}

Will the callback ever be? And you know when roughly?



It looks like you might have similar issues to Unity Fabric Compose Tweets in Android
Have you tried the items mentioned there?


I’ve tried it, but it still does not work.


Have you tried creating a new test app (apps.twitter.com) to see if that works? (set callback url)


Hi, I’ve tried it and it still does not work


I need help with this.


Callbacks have now been added to the Tweet Composer, please upgrade to v.3.2.0