Sending Request [similar to friend request]

Anyone know of a way to send a request, similar to friend request on facebook.

I want to be able to send a request to another user, and then if approved, other features and information would be provided between users such as the ability to communicate.

Happy new years and all help is appreciated

-Cflux

1 Like

You can create a ā€œfriend requestā€ thing, with a status of pending/accepted/rejected etc.

This will have both a link to the sending user and the receiving user. You could then have a list of friends on the user.

And alternative would be to create another list on the user for pending friend requests.

Then you can use the Custom Events/Workflows to look for changes to this. So that your page would respond (so maybe something in the header that show ā€œFriend Request Waitingā€ when one arrives) as soon as a friend request is received.

Thanks @NigelG,

Iā€™ll try that out and see if I can get it going.

Is that all doable on Bubble?

I havnt seen anyone else mention its doable and this post says that we cant send notifications / requests to other users yet. Although if we can, Thatā€™d be awesome.

Yes, all doable in Bubble.

What you wouldnā€™t be able to do is the push notification, so your phone saying ā€œyou have a message on your bubble appā€. But you can ā€œsendā€ messages between users by storing them and having notifications within the app.

Hi @NigelG, Iā€™ve been trying to figure out how you established a link between the current user and the other user but still no luck. Could you please elaborate on how you did this?

So far this is what I have for a thing:

but after this Iā€™m lost. And if you could also talk more about how you can ā€œsendā€ messages between users and storing them, thatā€™d be awesome too.

Hi,

So on the ā€œFriend Requestā€ ā€¦

I am not quite sure why you have Accepted and Pending as references to other Friend Requests ?

Maybe I am not understanding what you are trying to do, but I would have thought you wanted something likeā€¦

Requestor type : user
Reciever type : user
Status : pending/accepted/rejected.

So when your user selects another user to be a friend (and they arenā€™t already) then you create the thing.

You could then have a custom event that is watching for the logged in user appearing in the thing.

An alternative would be to simply do it on page load (rather than an ā€œinstantā€ action). So have a ā€œPending Friend Requestā€ field appear that is clickable.

If the request is accepted, then you may want to have a new field on the User which is a list of friends.

Here is the way I did this ā€¦

So on friend acceptance, I add the receiver user to my_friend_list on the requestor, and vice versa.

This current implementation doesnā€™t have the pending request function that you are after (i.e. someone requests, then someone accepts). But the logic would be the same. Mine is more like Twitter in that you can friend without them befriending back.

1 Like

The messages would work in much the same way.

Have a ā€œmessageā€ thing.

FromUser : User
ToUser: User
Message : Text
Status : Unread, Read etc

Then you can watch for unread messages (or have a condition in a header that show unread message count).

When you click on the ā€œmessageā€ link it just has a repeating group of messages where ToUser = Current user.

How are you having multiple field Types under one field

ā€œStatus : Unread, Read etcā€

^What do you mean by that? I cant have multiple status like that unless I create Unread and Read as their own individual things.

Same thing with the Status. You have

Status : pending/accepted/rejected.

^How do I achieve that?

So far Iā€™ve created Friend request as a thing

These are fields and their field types under Friend Request
Friend_Receiver: user
Friend_Requester: user

I also created Friend_Request_Status as a thing

The fields and field types I have for that are:
Pending: text
Accepted: text
Rejected: text

I hope I not too far off from where I should be.

So, what you do is store the specific text value in the text field (Pending or Accepted or Rejected) and then you can perform actions against it ā€¦ so Search where Status = ā€œPendingā€.

I think that is going to be easier than having the value on another Thing and then setting it to that, although they way you have done it ensures you are always consistent.

As an example, here I have a status that I am performing certain actions when the status is ā€œNewā€ and I have saved. I have just put ā€œNewā€ in the text field. Obviously I need to make sure I am consistent with naming !

This is along the lines of what Iā€™m trying to do as well with no luckā€¦

Iā€™m trying to figure out how to 1) configure user to user messaging and 2) display those user to use messages in an ā€˜Inboxā€™ fashion within the application.

I have created a thing called ā€˜Messageā€™.

And Iā€™ve created an input box with a SEND button.

Iā€™ve created a From User (current user) and To User (current page X creator) and a Message Text field for the message itself.

But how do I display these in a repeating group so that no EVERYONE sees all messages? Only the people involved in the message threat itself? i.e. the sender/receiver? Just like a standard inbox for email would beā€¦

Well the way youā€™d do it is with a repeating group showing a list which is the result of a search for messages whose to user is the current user. (or from user).

Itā€™d be easier if you have an app and have it opened, so that others can jump in and help. Right now itā€™s a bit theoritical.

3 Likes

Yes, it will be a lot easier to either pop it in the forum app, or use your own public app.

But as emmanuel says, you need to constrain your search on the repeating group.

So ā€œSentā€ messages are where ā€œFrom User = Current Userā€.

So ā€œReceivedā€ messages are where ā€œTo User = Current Userā€.

2 Likes