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); }
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); }