Пример #1
0
        // TODO: this is irrelevant for now. Will be updated soon.
//		public static void AddAppRequest(Provider provider, string message, string[] to, string extraData, string dialogTitle) {
//			providers[provider].AppRequest(message, to, extraData, dialogTitle,
//			    /* success */	(string requestId, List<string> recipients) => {
//									string requestsStr = KeyValueStorage.GetValue("soomla.profile.apprequests");
//									List<string> requests = new List<string>();
//									if (!string.IsNullOrEmpty(requestsStr)) {
//										requests = requestsStr.Split(',').ToList();
//									}
//									requests.Add(requestId);
//									KeyValueStorage.SetValue("soomla.profile.apprequests", string.Join(",", requests.ToArray()));
//									KeyValueStorage.SetValue(requestId, string.Join(",", recipients.ToArray()));
//									ProfileEvents.OnAddAppRequestFinished(provider, requestId);
//								},
//				/* fail */		(string errMsg) => {
//									ProfileEvents.OnAddAppRequestFailed(provider, errMsg);
//								});
//		}


        /// <summary>
        ///  Will fetch posts from user feed
        ///
        /// </summary>
        /// <param name="provider">Provider.</param>
        /// <param name="reward">Reward.</param>
//		public static void GetFeed(Provider provider, Reward reward) {
//
//			// TODO: implement with FB SDK
//
//		}

        /// <summary>
        /// Likes the page (with the given name) of the given provider.
        /// Supported platforms: Facebook, Twitter, Google+.
        ///
        /// NOTE: This operation requires a successful login.
        /// </summary>
        /// <param name="provider">The provider that the page belongs to.</param>
        /// <param name="pageName">The name of the page to like.</param>
        /// <param name="reward">A <c>Reward</c> to give the user after he/she likes the page.</param>
        public static void Like(Provider provider, string pageName, Reward reward = null)
        {
            SocialProvider targetProvider = GetSocialProvider(provider);

            if (targetProvider != null)
            {
                targetProvider.Like(pageName);

                if (reward != null)
                {
                    reward.Give();
                }
            }
        }