示例#1
0
        public void CheckSocialAccountAuthorizationStatus(NSString accountTypeIdentifier)
        {
            if (accountStore == null)
            {
                accountStore = new ACAccountStore();
            }

            ACAccountType socialAccount = accountStore.FindAccountType(accountTypeIdentifier);

            DataClass dataClass;

            if (accountTypeIdentifier == ACAccountType.Facebook)
            {
                dataClass = DataClass.Facebook;
            }
            else if (accountTypeIdentifier == ACAccountType.Twitter)
            {
                dataClass = DataClass.Twitter;
            }
            else if (accountTypeIdentifier == ACAccountType.SinaWeibo)
            {
                dataClass = DataClass.SinaWeibo;
            }
            else
            {
                dataClass = DataClass.TencentWeibo;
            }

            ShowAlert(dataClass, socialAccount.AccessGranted ? "granted" : "denied");
        }
        void RequestTencentWeiboAccess()
        {
            ACAccountType tencentWeiboAccount = accountStore.FindAccountType(ACAccountType.TencentWeibo);

            AccountStoreOptions options = new AccountStoreOptions();

            options.TencentWeiboAppId = "MY_ID";

            SocialNetworkPrivacyController.accountStore.RequestAccess(tencentWeiboAccount, options, (s, e) => CheckAccess());
        }
        public Task RequestAccess()
        {
            AccountStoreOptions options = GetOptions();
            ACAccountType       account = accountStore.FindAccountType(socialNetwork);

            var tcs = new TaskCompletionSource <object> ();

            accountStore.RequestAccess(account, options, (granted, error) => tcs.SetResult(null));
            return(tcs.Task);
        }
示例#4
0
        public void RequestSinaWeiboAccess()
        {
            if (accountStore == null)
            {
                accountStore = new ACAccountStore();
            }

            ACAccountType sinaWeiboAccount = accountStore.FindAccountType(ACAccountType.SinaWeibo);

            accountStore.RequestAccess(sinaWeiboAccount, null, delegate(bool granted, NSError error) {
                ShowAlert(DataClass.SinaWeibo, granted ? "granted" : "denied");
            });
        }
示例#5
0
        public void RequestTwitterAccess()
        {
            if (accountStore == null)
            {
                accountStore = new ACAccountStore();
            }

            ACAccountType twitterAccount = accountStore.FindAccountType(ACAccountType.Twitter);

            accountStore.RequestAccess(twitterAccount, null, delegate(bool granted, NSError error) {
                ShowAlert(DataClass.Twitter, granted ? "granted" : "denied");
            });
        }
        void RequestFacebookAccess()
        {
            ACAccountType facebookAccount = accountStore.FindAccountType(ACAccountType.Facebook);

            AccountStoreOptions options = new AccountStoreOptions()
            {
                FacebookAppId = "MY_CODE"
            };

            options.SetPermissions(ACFacebookAudience.Friends, new [] {
                "email",
                "user_about_me"
            });

            SocialNetworkPrivacyController.accountStore.RequestAccess(facebookAccount, options, (s, e) => CheckAccess());
        }
		public static Task<bool> RequestAccessAsync (this ACAccountStore store, ACAccountType accountType, AccountStoreOptions options)
		{
			TaskCompletionSource<bool> tcs = new TaskCompletionSource<bool> ();
			store.RequestAccess (accountType, options, delegate (bool granted, NSError error)
			                    {
				if (error != null)
				{
					tcs.SetException (new NSErrorException (error));
				}
				else
				{
					tcs.SetResult (granted);
				}
			});
			return tcs.Task;
		}
示例#8
0
        public void RequestTencentWeiboAccess()
        {
            if (accountStore == null)
            {
                accountStore = new ACAccountStore();
            }

            ACAccountType tencentWeiboAccount = accountStore.FindAccountType(ACAccountType.TencentWeibo);

            AccountStoreOptions options = new AccountStoreOptions();

            options.TencentWeiboAppId = "MY_ID";

            accountStore.RequestAccess(tencentWeiboAccount, options, delegate(bool granted, NSError error) {
                ShowAlert(DataClass.TencentWeibo, granted ? "granted" : "denied");
            });
        }
        public static Task <bool> RequestAccessAsync(this ACAccountStore store, ACAccountType accountType, AccountStoreOptions options)
        {
            TaskCompletionSource <bool> tcs = new TaskCompletionSource <bool> ();

            store.RequestAccess(accountType, options, delegate(bool granted, NSError error)
            {
                if (error != null)
                {
                    tcs.SetException(new NSErrorException(error));
                }
                else
                {
                    tcs.SetResult(granted);
                }
            });
            return(tcs.Task);
        }
示例#10
0
        public void RequestFacebookAccess()
        {
            if (accountStore == null)
            {
                accountStore = new ACAccountStore();
            }

            ACAccountType facebookAccount = accountStore.FindAccountType(ACAccountType.Facebook);

            AccountStoreOptions options = new AccountStoreOptions()
            {
                FacebookAppId = "MY_CODE"
            };

            options.SetPermissions(ACFacebookAudience.Friends, new [] { "email", "user_about_me" });

            accountStore.RequestAccess(facebookAccount, options, delegate(bool granted, NSError error) {
                ShowAlert(DataClass.Facebook, granted ? "granted" : "denied");
            });
        }
        void RequestSinaWeiboAccess()
        {
            ACAccountType sinaWeiboAccount = accountStore.FindAccountType(ACAccountType.SinaWeibo);

            SocialNetworkPrivacyController.accountStore.RequestAccess(sinaWeiboAccount, null, (s, e) => CheckAccess());
        }
        void RequestTwitterAccess()
        {
            ACAccountType twitterAccount = accountStore.FindAccountType(ACAccountType.Twitter);

            SocialNetworkPrivacyController.accountStore.RequestAccess(twitterAccount, null, (s, e) => CheckAccess());
        }
        protected override string CheckAccess()
        {
            ACAccountType socialAccount = accountStore.FindAccountType(socialNetwork);

            return(socialAccount.AccessGranted ? "granted" : "denied");
        }
示例#14
0
 /// <summary> U3DXT internal. </summary>
 protected DirectRequestService(string accountType, string serviceType)
 {
     _service = new ACAccountStore();
     _accountType = _service.FindAccountType(accountType);
     _serviceType = serviceType;
 }
示例#15
0
 /// <summary> U3DXT internal. </summary>
 protected DirectRequestService(string accountType, string serviceType)
 {
     _service     = new ACAccountStore();
     _accountType = _service.FindAccountType(accountType);
     _serviceType = serviceType;
 }
示例#16
0
        public string CheckSocialAccountAuthorizationStatus(string accountTypeIdentifier)
        {
            ACAccountType socialAccount = accountStore.FindAccountType(accountTypeIdentifier);

            return(socialAccount.AccessGranted ? "granted" : "denied");
        }