Two Questions: Follow System & Referral Rewards
-
Hi BrainCloud team, we have two questions about features we're trying to build.
1. One-Way Follow
We want Player A to follow Player B, but B doesn't have to follow back.
The Friend API requires both players to agree, so it doesn't work for us.
Is there a BrainCloud API designed for one-way follow relationships?Also — can
GetPresenceOfUsers(profileIds[])fetch profile data for any player,
or does a Friend relationship need to exist first?
2. Referral Rewards for Both Players
Our referral flow:
- Player A shares their referral code
- Player B enters the code
- When B reaches level 3, both A and B receive a diamond reward
The challenge is rewarding A (the referrer). We store A's profile ID in a
Custom Entity when B registers the code, so we always know who referred whom.Two questions:
a) Does BrainCloud support running a CloudCode script when a Milestone is
completed? If yes, we could use a Milestone to reward B automatically at
level 3, and use that script to look up A's profile ID and reward A as well —
no client-side trigger needed.b) If not, is there any other server-side mechanism in BrainCloud that can
reward a different player when a specific event occurs?
Thanks!
-
Hi @gyutaelee,
-
For one-way follow: brainCloud doesn’t have a built-in one-way “follow” graph, so you’ll need to implement your own follower/following system using one of the user data mechanisms (e.g. global or entity data) to track who follows whom. This keeps it independent of the Friends API, which is designed around mutual relationships.
GetPresenceOfUsers()works with any valid profile IDs, it does not require a Friend relationship between the players to return presence info. -
For the referral rewards question: I’m going to forward this to our team to review the best server-side approach for triggering rewards for both the referrer and referee once the milestone (like reaching level 3) is reached.
Thanks for the detailed explanation of your use cases.
-