/// <summary> /// Login with the social network. /// </summary> /// <remarks> /// If there is already logged in user, perform logout and login with /// credentials given by user. /// </remarks> /// <param name='provider'> /// Social network to use to login KiiCloud. /// </param> /// <param name='callback'> /// callback notifies events asynchronously. must not be null. /// </param> /// <exception cref='ArgumentException'> /// Exception is thrown when one or more arguments are invalid. /// </exception> /// <exception cref='ArgumentNullException'> /// Exception is thrown when one or more arguments are null. /// </exception> /// <exception cref='NotSupportedException'> /// Exception is thrown when the specified provider is not supported. /// </exception> public void LogIn( Provider provider, KiiSocialCallback callback) { if (callback == null) { throw new ArgumentNullException("callback must not be null."); } if (!Enum.IsDefined(typeof(Provider), provider)) { throw new ArgumentException("invalid provider"); } if (provider == Provider.QQ) { throw new NotSupportedException("QQ is not supported."); } this.callback = callback; this.provider = provider; string ua = GetUA(provider); #if UNITY_ANDROID AndroidJavaClass c = new AndroidJavaClass( "com.kii.cloud.storage.social.webview.WebViewDialog"); c.CallStatic("showDialog", this.gameObject.name, GetStartPointUrl(), GetEndPointUrl(), ua); #elif UNITY_IPHONE this.connector = _KiiIOSSocialNetworkConnector_StartAuthentication( this.gameObject.name, GetStartPointUrl(), GetEndPointUrl(), ua, this.DisplayArea.x, this.DisplayArea.y, this.DisplayArea.width, this.DisplayArea.height); #endif }
/// <summary> /// Login with the social network. /// </summary> /// <remarks> /// If there is already logged in user, perform logout and login with /// credentials given by user. /// </remarks> /// <param name='provider'> /// Social network to use to login KiiCloud. /// </param> /// <param name='callback'> /// callback notifies events asynchronously. must not be null. /// </param> /// <exception cref='ArgumentException'> /// Exception is thrown when one or more arguments are invalid. /// </exception> /// <exception cref='ArgumentNullException'> /// Exception is thrown when one or more arguments are null. /// </exception> /// <exception cref='NotSupportedException'> /// Exception is thrown when the specified provider is not supported. /// </exception> public void LogIn( Provider provider, KiiSocialCallback callback) { if (callback == null) { throw new ArgumentNullException("callback must not be null."); } if (!Enum.IsDefined(typeof(Provider), provider)) { throw new ArgumentException("invalid provider"); } if (provider == Provider.QQ) { throw new NotSupportedException("QQ is not supported."); } this.callback = callback; this.provider = provider; #if UNITY_ANDROID AndroidJavaClass c = new AndroidJavaClass( "com.kii.cloud.storage.social.webview.WebViewDialog"); c.CallStatic("showDialog", this.gameObject.name, GetStartPointUrl(), GetEndPointUrl()); #elif UNITY_IPHONE this.connector = _KiiIOSSocialNetworkConnector_StartAuthentication( this.gameObject.name, GetStartPointUrl(), GetEndPointUrl(), this.DisplayArea.x, this.DisplayArea.y, this.DisplayArea.width, this.DisplayArea.height); #endif }