Chat Bubble for chatting App


#21

I was chating yesterday…I saved my chat on TinyDB properly…and when I return to read it again…data will be showed with a loop on the webview …but somthing is not running properly…the same blocks wich are running fine on chating on live , now, webview only shows one data…maybe two data…but never 7 or 9 messages…or more.
I try to use a clock but doesn’t find the solution…any idea?.

Thanks to all.

G1


#22

it’s a time issue. use a clock.time event to add chat message one by one. Set the interval to a 'bigger ’ number.


#23

This is just what i did, with all combinations i can do on two or three days fighting with it…but i’ll try again…sometimes you’ll find the form never imagine…thanks Kevinkun…I’ll tell how was it…

Thanks a lot


#24

I tried again all combinations of TimerEnabled True/False and increasing (and changing) value to Timer Interval block…like if i play tetris…:sweat_smile:
But i don’t get all messages on the webview…only one or two.
I’ve set a counter into the loop and counts the right number of messages…for example: “4 messages”…but when counter is on the Timer block only counts 1 action, not 4…why?
Here you can see all these unabled blocks for testing combinations…and more erased before…the blocks shown before are the main…or like this ones…

G5

Any idea?..


#25

I have update the chat.html: chat.zip (1.2 KB)
Remember to unzip it first.
Now it’s no need to use clock and webviewstring any more.

HOW TO USE:
2019-05-04_210112

Set the global variable ‘messages’ to : (single message)
[{
“position”: “left”,
“photo”: “2.jpg”,
“name”: “lee”,
“message”: “hello”,
“time”: “2019-05-03”
}]

or batch messages:
[{
“position”: “left”,
“photo”: “1.jpg”,
“name”: “zhang”,
“message”: “how are you”,
“time”: “2019-05-03”
}, {
“position”: “right”,
“photo”: “2.jpg”,
“name”: “lee”,
“message”: “I am fine”,
“time”: “2019-05-04”
},

]

The String is a standard JSON string, start with [ and end with ].
Hope this helps


#26

Hi @kevinkun…first say thanks again to you by your nice attention…
…but my first question is …i look for this block you show me…but it maybe is from an extension …even, maybe is your’s…hihihi…sorry my ignorance but how can i find this block?..and then i’ll try it. (if i understand all your explanation, :wink: )…

Thanks a lot again!!!


#27

you may use above extension’s RunJS method.
for my block, it’s from a Chinese version app inventor, since I can not use Thunkable due to some reason.


#28

:smiley:
I love you…hihihi

I’ll tell how it was…


#29

Does this help?


#30

Hi @kevinkun…i don’t know where you find this block on that extension…WebViewer Interact Ext…???

Thanks!


#31

As I said in floor 26#, you may use that extension’s RunJS method.


#32

And this…?
This is not on that extension…
Thanks Kevin


#33

call WebViewer.EvaluateJavascript is a build-in block from a Chinese version AI. If you can not find it at your server, you should use that extionsion 's RUNJS block.


#34

AH!!..ok Thank you very much…


#35

What is the address of the Chinese version AI


#37

App Inventor 2 for Chinese
Log in as guest , you can create any visible component at runtime, enjoy it :slight_smile:


#38

Hi. @kevinkun , i could not make It Works using your extension. Is there another way?


#39

how about this, without using extension
2019-05-20_125200

sorry the chinese, its webviewer.gotourl


#40

Hi, @kevinkun…unfortunately It did not work out


#42

Hello, I need help on something oo