B4J Question [abmaterial]how to know which emoji is clicked in Facebook post?

liulifeng77

Active Member
Licensed User
Longtime User
hi,
I am not very familiar with js , I want to Calculate the number of each emoji which is clicked by users.
thanks!
 

Mashiane

Expert
Licensed User
Longtime User
There is a FaceBook demo in ABM that you can check out, open it and explore.

There are some methods in the TimeLinePage code related to that e.g.

B4X:
public Sub LikeComponent_Liked(value As Map)   
    Log(value.Get("like") & " ----> " & value.Get("target"))
End Sub

public Sub LikeComponent_UnLiked(value As Map)
    Log("Unliked ----> " & value.Get("target"))
End Sub

public Sub Reactions_Clicked(Target As String)
    Dim postNum As Int = Target.SubString(13)
    Dim NewPost As FacebookPost = Posts.Get(postNum)
    Dim CardReacts As ABMContainer = NewPost.myCard.Component("post" & postNum & "reactions")
    If NewPost.IsOpen Then
        CardReacts.CloseContent
    Else
        CardReacts.OpenContent
    End If
    NewPost.IsOpen = Not(NewPost.IsOpen)
End Sub

This provides the emoji clicked... I presume CardReacts will return the number of those likes etc.

Ta!

PS: What I want to know though is how do you set the selected emoji from code? i.e. a user clicks it, it gets saved and when the post is opened the last saved emoji is shown.
 
Upvote 0

liulifeng77

Active Member
Licensed User
Longtime User
thank you ! solved
I saved the emoji(json format) into mssql.(eg {"0901170247":"Like","0901170212":"Like"})
I think it is easy to find the last saved emoji!
 
Upvote 0
Top