News Prompt
ckrey opened this issue · 4 comments
The endpoint
<URL-to-backend>/check/news?clientHash=<client-hash>&lastSeenNewsID=<int>&newsLanguage=<de or en>
can be used to get news from the backend. The screenshot view of such a news is attached.
clientHash
is calculated like in the uploads.
lastSeenNewsID
is an integer of the last seen news.
newsLanguage
specifies whether the returned news file is in German or English
How does a news file look?
The first line is always a hashtag followed by an integer. The integer is the lastSeenNewsID
.
From the secon line on, each line contains news element. Each news element starts with a "-" or "*" and ends with a line break.
Example for the news file from the screenshot:
#13
-This is a normal news element in #041035 (same color as the ok button).
*This is an important news element in #FF4081.
Each succesful/authorized call is eather responded with an empty ok (200), if the news ID in the first line of the news file in the backend is smaller than or equal to the last seen news ID given by the caller and a text stream (200), otherwise.
Each news element is to be displayed in a new line and the first symbol (a "-" or "*") is not to be displayed.
Any questions or objections?
That's fine.
Add Smartphone specific texts:
There is an update.
It should be possible to display some messages only on android devices and others only in iOS devices. For this, the two starting symbols i
and a
are added. See example below.
#13
-This is a normal news element in #041035 (same color as the ok button).
*This is an important news element in #FF4081.
iThis message is only displayed on iOS devices.
aThis message is only displayed on Android devices.