2016-03-17 18 views
5

codesign/paketin sonra thats başarısız ama App store validation/codesign gerektiren bir yapı ağa bağlandığında bir kez başarısız olur. Uygulama ve yapım süreci o kadar uzun sürmedi, ancak şimdi başarısız oluyor.OSX Mac mağazası uygulaması ağ uygulama mağazası için ben Unity ve kurulumunda yerleşik bir uygulama bir OS X yapı içinde sadece iyi çalışır görevleri ağ olan Mac App Store'da yayınlanacak olan

Ben yetkiler izinleri ağ ve sisteme Konsol'unda bir kum hatasının herhangi bir iz göremiyorum dahil değilim. Uygulama satın alma ağı aramalarında başarılı oluyor, ancak terminalde başka herhangi bir şey için trafiği kontrol edersem hiçbir veri içeri veya dışarı taşımıyor.

Yani herkes bu yoksa sorunun ne olabileceğini anlamaya kullanabilirsiniz ileri testler neden oluyor olabilir ne herhangi bir fikir vardı merak oldu.

+0

Hangi eklentileri kullanıyorsunuz? ve xcode'a hangi çerçeveyi ekliyorsunuz? ağ görevleri nelerdir? Basit json sorguları veya prizleri veya ne? lütfen destek alma şansınızı arttırın ve size yardım etmemizi kolaylaştırın. – DeyaEldeen

+0

sadece eklentisi Birlik IAP, (hiç gerçekten Xcode kullanarak değil) Xcode ile eklenmiş hiçbir çerçeveler olduğunu. Networking Parse'ye bağlanmaya çalışıyorum ama aynı zamanda test sitelerine WWW çağrılarını denedim ve hiçbir şey geçmiyor. – AlexTheMighty

+0

@AlexTheMighty Unity 5.3.4p1 kullanarak aynı sorunu yaşıyorum. Herhangi bir çözüm bulabildin mi? –

cevap

0

Yanlış Unity WWW sınıfı ne çözemedim ama System.Net.WebClient sınıfını kullanarak soruna elde edebildi. Unity'nin WWW sınıfına benzer bir arayüze sahip basit bir sarıcı uyguladım. İşte kullandığım kod:

using System; 
using System.Net; 
using System.Net.Security; 
using System.Text; 

/// <summary> 
/// Web request using the WebClient class. 
/// </summary> 
/// <seealso cref="Assets.Scripts.WebRequest" /> 
internal class WebRequest 
{ 
    /// <summary> 
    /// The web client. 
    /// </summary> 
    private WebClient _client; 

    /// <summary> 
    /// The error message. 
    /// </summary> 
    private string _error; 

    /// <summary> 
    /// The is done flag. 
    /// </summary> 
    private bool _isDone; 

    /// <summary> 
    /// The progress. 
    /// </summary> 
    private float _progress; 

    /// <summary> 
    /// The text. 
    /// </summary> 
    private string _text; 

    /// <summary> 
    /// Initializes a new instance of the <see cref="WebRequest"/> class. 
    /// </summary> 
    /// <param name="url">The URL.</param> 
    public WebRequest(string url) 
    { 
     this._client = new System.Net.WebClient(); 
     this._client.DownloadProgressChanged += this.WebClientProgressChanged; 
     this._client.DownloadStringCompleted += this.WebClientDownloadCompleted; 
     this._client.DownloadStringAsync(new Uri(url)); 
    } 

    /// <summary> 
    /// Initializes a new instance of the <see cref="WebRequestDotNet"/> class. 
    /// </summary> 
    /// <param name="url">The URL.</param> 
    /// <param name="form">The form.</param> 
    public WebRequest(string url, UnityEngine.WWWForm form) 
    { 
     this._client = new System.Net.WebClient(); 
     this._client.UploadProgressChanged += this.WebClientUploadProgressChanged; 
     this._client.UploadDataCompleted += this.WebClientUploadCompleted; 

     this._client.Headers[HttpRequestHeader.ContentType] = "application/x-www-form-urlencoded"; 

     // Try to get the header from the Unity form 
     foreach (var header in form.headers) 
     { 
     const string ContentType = "Content-Type"; 
     if (header.Key == ContentType) 
     { 
      string contentType = header.Value; 
      this._client.Headers.Remove(ContentType); 
      this._client.Headers[ContentType] = contentType; 
     } 
     } 

     this._client.UploadDataAsync(new Uri(url), form.data); 
    } 

    /// <summary> 
    /// Gets the error message. Returns null if there is no error. 
    /// </summary> 
    /// <value> 
    /// The error message. 
    /// </value> 
    public string Error 
    { 
     get 
     { 
     return this._error; 
     } 
    } 

    /// <summary> 
    /// Gets a value indicating whether this request is done. 
    /// </summary> 
    /// <value> 
    /// <c>true</c> if this instance is done; otherwise, <c>false</c>. 
    /// </value> 
    public bool IsDone 
    { 
     get 
     { 
     return this._isDone; 
     } 
    } 

    /// <summary> 
    /// Gets the progress, 0 to 1. 
    /// </summary> 
    /// <value> 
    /// The progress. 
    /// </value> 
    public float Progress 
    { 
     get 
     { 
     return this._progress/100.0f; 
     } 
    } 

    /// <summary> 
    /// Gets the resulting text. 
    /// </summary> 
    /// <value> 
    /// The text. 
    /// </value> 
    public string Text 
    { 
     get 
     { 
     return this._text; 
     } 
    } 

    /// <summary> 
    /// Called when the download is complete. 
    /// </summary> 
    /// <param name="sender">The sender.</param> 
    /// <param name="e">The <see cref="DownloadStringCompletedEventArgs"/> instance containing the event data.</param> 
    private void WebClientDownloadCompleted(object sender, DownloadStringCompletedEventArgs e) 
    { 
     if (e.Error != null) 
     { 
     this._error = e.Error.ToString(); 
     } 
     else 
     { 
     this._text = e.Result; 
     } 

     this._isDone = true; 
    } 

    /// <summary> 
    /// Called when the progress changes. 
    /// </summary> 
    /// <param name="sender">The sender.</param> 
    /// <param name="e">The <see cref="DownloadProgressChangedEventArgs"/> instance containing the event data.</param> 
    private void WebClientProgressChanged(object sender, DownloadProgressChangedEventArgs e) 
    { 
     this._progress += e.ProgressPercentage; 
    } 

    /// <summary> 
    /// Called when the upload is complete. 
    /// </summary> 
    /// <param name="sender">The sender.</param> 
    /// <param name="e">The <see cref="UploadValuesCompletedEventArgs"/> instance containing the event data.</param> 
    private void WebClientUploadCompleted(object sender, UploadDataCompletedEventArgs e) 
    { 
     if (e.Error != null) 
     { 
     this._error = e.Error.ToString(); 
     } 
     else 
     { 
     this._text = Encoding.UTF8.GetString(e.Result); 
     } 

     this._isDone = true; 
    } 

    /// <summary> 
    /// Called when the upload progress changes. 
    /// </summary> 
    /// <param name="sender">The sender.</param> 
    /// <param name="e">The <see cref="UploadProgressChangedEventArgs"/> instance containing the event data.</param> 
    private void WebClientUploadProgressChanged(object sender, UploadProgressChangedEventArgs e) 
    { 
     this._progress += e.ProgressPercentage; 
    } 
}