Skip to content
This repository was archived by the owner on Dec 1, 2022. It is now read-only.

permit non-String args for title and body args #222

Open
wants to merge 10 commits into
base: master
Choose a base branch
from
Open

permit non-String args for title and body args #222

wants to merge 10 commits into from

Conversation

ghost
Copy link

@ghost ghost commented Aug 29, 2016

There needs to be a way to send non-Strings to client. This is especially important with Dates, which cannot be formatted on Server, as the server doesn't know the client device's locale. American formatted dates on other locales will look awful, especially in RTL languages.

Numbers are also important, some cultures group numbers differently, and use different symbols for decimal and grouping symbols.

With my change, you can send Arrays.asList({"asbc",new Date().getTime(), 1251212.0}), and the client firebase will automatically read the object as String, Long and double. The number can also be formatted as a date:

(from java.util.Formatter code)
```
if (arg instanceof Long) {
date = new Date(((Long) arg).longValue());
}

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants