8
8

More than 5 years have passed since last update.

Unity5.0系+Parse+iOSで発生するエラーを取る方法

Last updated at Posted at 2015-04-05

こちらを参考に1つのファイルを作成すれば解決できます。
http://forum.unity3d.com/threads/unity-5-parse-ios-nsurlerrordomain-error-1012.308569/

引用
"Assets/Plugins/iOS/CustomConnection.mm" を作成する
これだけでUnity5.0系+Parse+iOSで発生するエラーがなくなる。

include "Unity/WWWConnection.h"

@interface UnityWWWCustomRequestProvider : UnityWWWRequestDefaultProvider
{
}
+ (NSMutableURLRequest*)allocRequestForHTTPMethod:(NSString*)method url:(NSURL*)url headers:(NSDictionary*)headers;
@end

@implementation UnityWWWCustomRequestProvider
+ (NSMutableURLRequest*)allocRequestForHTTPMethod:(NSString*)method url:(NSURL*)url headers:(NSDictionary*)headers
{
NSMutableURLRequest* request = [super allocRequestForHTTPMethod:method url:url headers:headers];

// let's pretend for security reasons we dont want ANY cache nor cookies
request.cachePolicy = NSURLRequestReloadIgnoringLocalCacheData;
[request setHTTPShouldHandleCookies:NO];

return request;

}
@end

@interface UnityWWWCustomConnectionDelegate : UnityWWWConnectionSelfSignedCertDelegate
{
}
@end

@implementation UnityWWWCustomConnectionDelegate
- (NSCachedURLResponse*)connection:(NSURLConnection*)connection willCacheResponse:(NSCachedURLResponse*)cachedResponse
{
// we dont want caching
return nil;
}
- (void)connection:(NSURLConnection*)connection didReceiveResponse:(NSURLResponse*)response
{
[super connection:connection didReceiveResponse:response];
}
@end

IMPL_WWW_DELEGATE_SUBCLASS(UnityWWWCustomConnectionDelegate);
IMPL_WWW_REQUEST_PROVIDER(UnityWWWCustomRequestProvider);

8
8
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
8
8