You receive loyalty points (the purple hearts) by contributing to the projects of your guild. By successfully finishing the project each contributor gets loyalty points. The amount of loyalty points depends on the amount of needed produce you contributed.

To collect your loyalty points, tap on the button showing the envelope in the upper left corner next to the settings button. This is your inbox. Here you get notified when a project was successfully finished and by tapping on the message you can see how many points you got and also collect them.