Example #1
0
        public void CheckContacts()
        {
            var status = ISN_CNContactStore.GetAuthorizationStatus(ISN_CNEntityType.Contacts);

            if (status == ISN_CNAuthorizationStatus.Authorized)
            {
                OpenContacts();
            }
            else
            {
                ISN_CNContactStore.RequestAccess(ISN_CNEntityType.Contacts, (result) => {
                    if (result.IsSucceeded)
                    {
                        OpenContacts();
                    }
                    else
                    {
                        ContactSelectButton.SetActive(false);
                        ErrorInvites.SetActive(true);
                        ErrorInvitesText.GetComponent <TMPro.TextMeshProUGUI>().text = "Contact permission denied. You can go to settings and give spaces access to your contacts so you can send them invitations!";
                        StartCoroutine(CloseModal(6));
                    }
                });
            }
        }
Example #2
0
        // clear cache in untiy and start over (see why Im getting stuck in loading window in create group)

        void OpenContacts()
        {
            FriendsPhones friendsPhones = new FriendsPhones()
            {
                numbers = new List <string>()
            };

            ISN_CNContactStore.ShowContactsPickerUI((result) => {
                ContactSelectButton.SetActive(false);
                LoadingInvites.SetActive(true);
                if (result.IsSucceeded)
                {
                    foreach (var contact in result.Contacts)
                    {
                        string fullNumber = contact.Phones[0].FullNumber;
                        friendsPhones.numbers.Add(fullNumber);
                    }
                    FriendManagerScript FMScript = FriendManager.GetComponent <FriendManagerScript>();
                    StartCoroutine(FMScript.SendGroupRequest(groupName, true, friendsPhones, () => { GroupSuccessCreation(); }, () => { GroupFailCreation(); }));
                }
                else
                {
                    LoadingInvites.SetActive(false);
                    ErrorInvites.SetActive(true);
                    ErrorInvitesText.GetComponent <TMPro.TextMeshProUGUI>().text = "Hmmmm... server error! Try again from the main menu!";
                    StartCoroutine(CloseModal(3));
                }
            });
        }
Example #3
0
 void GroupFailCreation()
 {
     LoadingInvites.SetActive(false);
     ErrorInvites.SetActive(true);
     ErrorInvitesText.GetComponent <TMPro.TextMeshProUGUI>().text = "There was an error with the numbers you sent the invites to, try again from the main menu!";
     StartCoroutine(CloseModal(6));
 }