Beispiel #1
0
    public void SignUp(string parentEmail, string token)
    {
        try
        {
            Approval approval = _saferize.Signup(parentEmail, token);

            if (approval == null)
            {
                return;
            }
            else
            {
                SaferizeData data = new SaferizeData();

                data.lastLogin   = DateTime.UtcNow;
                data.token       = approval.AppUser.Token;
                data.parentEmail = approval.ParentEmail;
                data.approval    = approval;

                _saferizeData = data;

                SaveFile(data);
            }
        }
        catch (Exception e)
        {
            Debug.Log("error for sign up was: " + e);
        }
    }
Beispiel #2
0
    private void SaveFile(SaferizeData data)
    {
        var saferizeFileName = Application.persistentDataPath + "/saferize.dat";

        using (FileStream filestream = File.Open(saferizeFileName, FileMode.Create))
        {
            BinaryFormatter binaryFormatter = new BinaryFormatter();
            binaryFormatter.Serialize(filestream, data);

            filestream.Dispose();
        }
    }
Beispiel #3
0
    private void loadSaferizeDataIntoMemory()
    {
        var saferizeFileName = Application.persistentDataPath + "/saferize.dat";

        if (File.Exists(saferizeFileName))
        {
            BinaryFormatter binaryFormatter = new BinaryFormatter();
            using (FileStream filestream = File.Open(saferizeFileName, FileMode.Open))
            {
                _saferizeData = binaryFormatter.Deserialize(filestream) as SaferizeData;
                filestream.Dispose();
            }
        }
    }
    void Start()
    {
        _saferizeData = SaferizeService.Instance().getSaferizeData();
        if (_saferizeData != null)
        {
            emailControlText.text = "This app is managed by: \n" + _saferizeData.approval.ParentEmail;
        }

        if (_saferizeData != null && _saferizeData.approval.Status == SaferizeSDK.Approval.StatusEnum.PENDING)
        {
            BackToSignUp.SetActive(true);
        }
        else
        {
            SupportMessage.SetActive(true);
        }
    }