Since the release of the "Itoo 4.1 Sky" version, this extension can interact with the AppInventor component "CloudDB"
We are going to create a Chat application with Push notification relying on this great extension
There is already a manual on how to create a chat with CloudDB
https://appinventor.mit.edu/explore/ai2/clouddb-chat
In this tutorial we will focus on creating a service that allows us to add push notifications to Chat.
In Screen1.Initialize we indicate the following
First we will start the service
Then we will include our chat user in the shared variable "user"
When we start the service we call the "Start" procedure
There we find the itoo procedure "ExecuteInternalScript" with two arguments:
- Code: which is a control number
- Values: there we will include a list with six items, to configure CloudDb
1- The CloudDB Component
2- The ProjectId (by changing this data we could make different chat rooms)
3-RedisPort
4-RedisServer (clouddb.appinventor.mit.edu)
5-Token (Redis server start key)
6-UseSSL (true or false)
This data must match what is indicated in the component properties except RedisServer
In this same "Start" procedure we register the CloudDB1.DataChanged event in the "DataChanged" procedure
DataChanged
The "value" argument, as defined in the program, is a list but for reasons unknown to me, the service identifies it as a string, but there are enough tools in App Inventor to extract the data we need.
What the procedure does is remove the user and the message from the last post and present it to us in a notification, this is done even if the app is closed
When you press the notification, the app will open and the chat will be updated in it.
This is a basic chat, but you can go deeper by creating rooms and users with permissions to enter a certain room, you could even create private one-on-one conversations, it all depends on the imagination we have.
Even with our Driver account, we could share all types of files.
For correct operation on Xiaomi and Samsung devices, it is convenient to set the battery saver to No Restrictions.
The notification would have to be configured for the NotifyBasic channel as Allow floating notifications.
ItooChat.aia (105,6 KB)