private void IsFollowing()
 {
     Communities.IsFollowing(UserId.CurrentUser(), FollowQuery.Users(FormUserList()), follows =>
     {
         _console.LogD("Current user is following: " + follows.ToDebugString());
     }, OnError);
 }
    private void OpenMyCustomFeed()
    {
#pragma warning disable 0618
        ActivityFeedViewBuilder.Create(ActivitiesQuery.FeedOf(UserId.CurrentUser()))
        .SetWindowTitle("My Custom Feed")
        .SetActionListener(OnAction)
        .Show();
#pragma warning restore 0618
    }
 protected void ShowActions(User user)
 {
     Communities.IsFollowing(UserId.CurrentUser(), FollowQuery.Users(UserIdList.Create(user.Id)), result =>
     {
         var isFollower = result.ContainsKey(user.Id) && result[user.Id];
         Communities.IsFriend(UserId.Create(user.Id), isFriend =>
         {
             ShowActions(user, isFollower, isFriend);
         }, error => _console.LogE(error.ToString()));
     }, error => _console.LogE(error.ToString()));
 }
Exemplo n.º 4
0
    protected override void OnDataChanged(List <User> list)
    {
        if (list.Count == 0)
        {
            return;
        }
        var users = UserIdList.Create(list.ConvertAll(it => it.Id));

        Communities.AreFriends(users, areFriends =>
        {
            _areFriends.AddAll(areFriends);
        }, error => _console.LogE(error.Message));
        Communities.IsFollowing(UserId.CurrentUser(), FollowQuery.Users(users), follows =>
        {
            _follows.AddAll(follows);
        }, error => _console.LogE(error.Message));
    }
Exemplo n.º 5
0
 void DrawMainView()
 {
     GUILayout.Label("API", GSStyles.NormalLabelText);
     if (GetSocial.IsInitialized)
     {
         Button("User Management", ShowMenuSection <AuthSection>);
     }
     else
     {
         Button("Init with anonymous", () => GetSocial.Init());
         if (_enterIdentityData)
         {
             DemoGuiUtils.DrawRow(() =>
             {
                 _identityId    = GUILayout.TextField(_identityId, GSStyles.TextField);
                 _identityToken = GUILayout.TextField(_identityToken, GSStyles.TextField);
             });
             DemoGuiUtils.DrawRow(() =>
             {
                 Button("Init", InitWithCustom);
                 Button("Cancel", () => { _enterIdentityData = false; });
             });
         }
         else
         {
             Button("Init with custom identity", () => { _enterIdentityData = true; });
         }
         Button("Init with FB", InitWithFacebook);
     }
     Button("InApp Purchase Api", ShowMenuSection <InAppPurchaseApiSection>);
     Button("Promo Codes", ShowMenuSection <PromoCodesSection>);
     Button("Custom Analytics Events", ShowMenuSection <CustomAnalyticsEventSection>);
     GUILayout.Space(30f);
     GUILayout.Label("Invites", GSStyles.NormalLabelText);
     Button("Smart Invites", ShowMenuSection <SmartInvitesApiSection>);
     Button("Set Referrer", ShowMenuSection <SetReferrerSection>);
     Button("Referred Users", ShowMenuSection <ReferredUsersSection>);
     Button("Referrer Users", ShowMenuSection <ReferrerUsersSection>);
     GUILayout.Space(30f);
     GUILayout.Label("Notification", GSStyles.NormalLabelText);
     Button("Send Notification", ShowMenuSection <SendNotificationSection>);
     Button("Notifications", ShowMenuSection <NotificationsSection>);
     GUILayout.Space(30f);
     GUILayout.Label("Communities", GSStyles.NormalLabelText);
     Button("Timeline", () => PushMenuSection <ActivitiesSection>(section => section.Query = ActivitiesQuery.Timeline()));
     Button("Find Tags", ShowMenuSection <TagsSection>);
     Button("Post to Timeline", () => PushMenuSection <PostActivitySection>(section => section.Target = PostActivityTarget.Timeline()));
     Button("My Friends", () => PushMenuSection <FriendsSection>(section => section.User = UserId.CurrentUser()));
     Button("Suggested Friends", ShowMenuSection <SuggestedFriendsSection>);
     Button("My Followers", () => PushMenuSection <FollowersSection>(section =>
     {
         section.Name  = "Me";
         section.Query = FollowersQuery.OfUser(UserId.CurrentUser());
     }));
     Button("Followed By Me", () => PushMenuSection <FollowingSection>(section =>
     {
         section.Name = "Me";
         section.User = UserId.CurrentUser();
     }));
     Button("Search Topics", ShowMenuSection <TopicsSearchSection>);
     Button("My Topics", () => PushMenuSection <FollowedTopicsSection>(section =>
     {
         section.User = UserId.CurrentUser();
     }));
     Button("Search Users", ShowMenuSection <UsersSearchSection>);
     GUILayout.Space(30f);
     GUILayout.Label("UI", GSStyles.NormalLabelText);
     Button("Activity Feed", ShowMenuSection <ActivityFeedUiSection>);
     Button("Notification Center", ShowMenuSection <NotificationUiSection>);
     Button("UI Customization", ShowMenuSection <UiCustomizationSection>);
     GUILayout.Space(30f);
     GUILayout.Label("Other", GSStyles.NormalLabelText);
     DrawSettings();
 }