コード例 #1
0
        public override IMParticleTask <IdentityApiResult> Login(IdentityApiRequest request = null)
        {
            BaseTaskWrapper             task     = new BaseTaskWrapper();
            MPIdentityApiResultCallback callback = (MPIdentityApiResult apiResult, Foundation.NSError error) =>
            {
                if (error != null)
                {
                    task.Failure = new IdentityHttpResponseWrapper(error);
                }
                if (apiResult != null && apiResult.User != null)
                {
                    task.Result = new IdentityApiResult()
                    {
                        User = apiResult != null ? new MParticleUserWrapper(apiResult.User) : null
                    };
                }
            };

            _identityApi.Login(Utils.ConvertToMpIdentityRequest(request), callback);
            return(task);
        }
コード例 #2
0
        public override IMParticleTask <IdentityApiResult> Identify(IdentityApiRequest request = null)
        {
            BaseTaskWrapper             task     = new BaseTaskWrapper();
            MPIdentityApiResultCallback callback = (MPIdentityApiResult apiResult, Foundation.NSError error) =>
            {
                if (error != null)
                {
                    task.Failure = new IdentityHttpResponseWrapper(error);
                }
                if (apiResult != null && apiResult.User != null)
                {
                    task.Result = new IdentityApiResult()
                    {
                        User = new MParticleUserWrapper(apiResult.User)
                    };
                }
            };

            iOSBinding.MParticle.SharedInstance.Identity.Identify(Utils.ConvertToMpIdentityRequest(request), callback);
            return(task);
        }