Please login to access all of the features of the Community Site.

Follow

M v1.0

The command is used to follow and unfollow specific entities.

Previously, this behavior was only utilized using the Following Icon, but now with this command, you can easily mimic that to create custom follow/unfollow buttons.

When following a person you'll want to use the PersonAlias entity type, not the Person.

Also, be sure to check out the Security Considerations needed to enable following.

Note that this command does not refresh the page. If you have following icons and expect them to be updated from this command, it does not work as such. Consider using SetViewProperty to make visual changes in response to follow and unfollow actions.

Properties

PropertyTypeDescriptions
EntityIdintThe Id of the entity to follow or unfollow.
EntityTypeIdintThe Id of the entity type to follow or unfollow.
PurposeKeystringAn optional parameter that allows you to set a 'Purpose Key' while following or unfollowing.
NotificationTextstringThe text to display on the Toast when an item is successfully followed/unfollowed. Note: Setting this as empty ("") will remove the Toast from ever being displayed, if you wish to do that.
NotificationTypeNotifcationTypeThe notification type of the Toast to be displayed.
IsFollowboolWhether or not the command is used to follow or unfollow, set to false to configure "unfollowing" behavior. Defaults to true.
UseHapticFeedbackbool  If enabled, the command will perform haptic feedback when tapped. Defaults to true.
<HorizontalStackLayout>
    {% assign group = 70 | GroupById %}

    <Button Text="Follow"
        Command="{Binding Follow}">
        <Button.CommandParameter>
            <Rock:FollowParameters EntityId="{{ group.Id }}"
                EntityTypeId="{{ group.TypeId }}" />
        </Button.CommandParameter>
    </Button>

    <Button Text="Unfollow"
        Command="{Binding Follow}">
        <Button.CommandParameter>
            <Rock:FollowParameters IsFollow="False"
                EntityId="{{ group.Id }}"
                EntityTypeId="{{ group.TypeId }}"
                NotificationText="Unfollowed!" />
        </Button.CommandParameter>
    </Button>
</HorizontalStackLayout>