public override bool SetUserAttributes(Dictionary <string, string> userAttributes)
        {
            string userAttributeJson = toUtils.SerializeDictionary(userAttributes);
            string result            = MParticleiOS._User_SetUserAttributes(_mpid.ToString(), userAttributeJson);

            return(toUtils.ParseBoolean(result, false));
        }
 public void RemoveIdentityStateListener(OnUserIdentified listener)
 {
     if (_identityStateHandlers.Remove(listener))
     {
         MParticleiOS._Identity_RemoveIdentityStateListener();
     }
 }
        public override bool SetUserTag(string tag)
        {
            string result     = MParticleiOS._User_SetUserTag(_mpid.ToString(), tag);
            bool   resultBool = false;

            Boolean.TryParse(result, out resultBool);
            return(resultBool);
        }
 public void AddIdentityStateListener(OnUserIdentified listener)
 {
     if (!_identityStateHandlers.Contains(listener))
     {
         _identityStateHandlers.Add(listener);
         MParticleiOS._Identity_AddIdentityStateListener();
     }
 }
        public IMParticleTask <IdentityApiResult> Modify(IdentityApiRequest request)
        {
            string userAliasUuid = request.UserAliasHandler != null?getRandomKey() : null;

            string taskUuid    = getRandomKey();
            string requestJSON = toUtils.SerializeDictionary(new IdentityApiRequestDto(request, taskUuid, userAliasUuid));

            MParticleiOS._Identity_Modify(requestJSON);
            BaseTask baseTask = new BaseTask();

            _taskCallbacks.Add(taskUuid, baseTask);
            return(baseTask);
        }
        public IMParticleTask <IdentityApiResult> Logout(IdentityApiRequest request = null)
        {
            string   taskUuid = getRandomKey();
            BaseTask baseTask = new BaseTask();

            _taskCallbacks.Add(taskUuid, baseTask);
            string userAliasUuid = null;

            if (request != null)
            {
                userAliasUuid = addUserAliasHandler(request.UserAliasHandler);
            }
            string requestJSON = toUtils.SerializeDictionary(new IdentityApiRequestDto(request, taskUuid, userAliasUuid));

            MParticleiOS._Identity_Logout(requestJSON);
            return(baseTask);
        }
        public override bool RemoveUserAttribute(string key)
        {
            string result = MParticleiOS._User_RemoveUserAttribute(_mpid.ToString(), key);

            return(toUtils.ParseBoolean(result, false));
        }
        public override bool SetUserAttribute(string key, string val)
        {
            string result = MParticleiOS._User_SetUserAttribute(_mpid.ToString(), key, val);

            return(toUtils.ParseBoolean(result, false));
        }
        public override Dictionary <string, string> GetUserAttributes()
        {
            string result = MParticleiOS._User_GetUserAttributes(_mpid.ToString());

            return(ToCSUtils.toStringDictionary(result));
        }
        public override Dictionary <UserIdentity, string> GetUserIdentities()
        {
            string userIdentitiesJson = MParticleiOS._User_GetUserIdentities(_mpid.ToString());

            return(ToCSUtils.toUserIdentityDictionary(userIdentitiesJson));
        }