機能の詳細については公式をみて。
公式サイト → http://mb.cloud.nifty.com/
正式名は「NIFTY Cloud mobile backend」略して「NCMB」
呼びづらい、覚えづらい、書きづらい…どうにかならんもんか。
・プッシュ通知やユーザー管理、データストレージなどが使える
・プラットフォームに依存しないランキング実装とかに使える
・国内サーバー
・海外サーバーに比べレスポンスが速い
・無料でもかなり使える
・最大でも月3万円
こんな感じ。
かなり便利そうなので試してみる事にした。
ここのクイックスタートを見ながら試してみたんだけど
http://mb.cloud.nifty.com/doc/quickstart_unity.html
下記エラーが出た。
Error occurred: Error: ConnectFailure (Unexpected error while trying to call method_GetSecurityPolicyBlocking : System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.Net.WebException: The remote server returned an error: (404) Not Found. at System.Net.HttpWebRequest.CheckFinalStatus (System.Net.WebAsyncResult result) [0x00000] in <filename unknown>:0 at System.Net.HttpWebRequest.SetResponseData (System.Net.WebConnectionData data) [0x00000] in <filename unknown>:0 --- End of inner exception stack trace --- at System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x000eb] in /Users/builduser/buildslave/monoAndRuntimeClassLibs/build/mcs/class/corlib/System.Reflection/MonoMethod.cs:232 at System.Reflection.MethodBase.Invoke (System.Object obj, System.Object[] parameters) [0x00000] in /Users/builduser/buildslave/monoAndRuntimeClassLibs/build/mcs/class/corlib/System.Reflection/MethodBase.cs:115 at UnityEngine.UnityCrossDomainHelper+WebRequestPolicyProvider.GetPolicy (System.String policy_url) [0x00000] in <filename unknown>:0 at UnityEngine.UnityCrossDomainHelper.GetSecurityPolicy (System.String requesturi_string, IPolicyProvider policyProvider) [0x00000] in <filename unknown>:0 at UnityEngine.UnityCrossDomainHelper.GetSecurityPolicyForDotNetWebRequest (System.String requesturi_string, System.Reflection.MethodInfo policyProvidingMethod) [0x00000] in <filename unknown>:0 at (wrapper managed-to-native) System.Reflection.MonoMethod:InternalInvoke (object,object[],System.Exception&) at System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x000d0] in /Users/builduser/buildslave/monoAndRuntimeClassLibs/build/mcs/class/corlib/System.Reflection/MonoMethod.cs:222 --- End of inner exception stack trace --- at System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x000eb] in /Users/builduser/buildslave/monoAndRuntimeClassLibs/build/mcs/class/corlib/System.Reflection/MonoMethod.cs:232 at System.Reflection.MethodBase.Invoke (System.Object obj, System.Object[] parameters) [0x00000] in /Users/builduser/buildslave/monoAndRuntimeClassLibs/build/mcs/class/corlib/System.Reflection/MethodBase.cs:115 at System.Net.WebConnection.CheckUnityWebSecurity (System.Net.HttpWebRequest request) [0x00000] in <filename unknown>:0 ) with: System.Collections.Hashtable ; at System.Net.HttpWebRequest.EndGetRequestStream (IAsyncResult asyncResult) [0x00000] in <filename unknown>:0 at System.Net.HttpWebRequest.GetRequestStream () [0x00000] in <filename unknown>:0 at NCMB.Internal.NCMBConnection._sendRequest (System.Net.HttpWebRequest req, NCMB.NCMBException& error) [0x00000] in <filename unknown>:0まさかの404エラー。
でも「method_GetSecurityPolicyBlocking」みたいに書かれてる。
WebPlayer向けに設定してるしもしやと思ってAndroid向けに変えてみたらこのエラーは消えて通信成功した。
案の定WebPlayerのセキュリティポリシーによるものみたいやなぁ…
http://docs-jp.unity3d.com/Documentation/Manual/SecuritySandbox.html
ランキングロジックとかをWebPlayer、iOS、Androidで全て統一できないかと考えたんだけどなぁ。うーむ。
→Unity系記事まとめ