Comments (21)
For sure @mohitCodepy. Essentially, it is a datetime field which updates automatically with a new datetime everytime an FCMDevice entry is updated
from fcm-django.
Seems that date_created
is enough for tracking expired tokens. Or @nachov99 is there specific case where that field could be helpful to have updated_at
?
Maybe better instead of bloating models for all users that use that app, we could allow override models to users who needs that? It could be done with swapper. In the same way as it was done for django-cities
from fcm-django.
If you name the fields
created
andupdated
they will even be the same as TimeStampedModel from django-model-utils!
But is there's a reason for that? I though:
- there's no needs to everyone who would like to use that package to pay extra to store data that not required in their DB.
- and shouldn't be a limitation to store extra data if it's required according their business requirements
from fcm-django.
Yes, that would be a welcome addition. Pull requests welcome
from fcm-django.
@xtrinch , May I work on this ? If yes, please assign this issue to me and provide some description about the issue.
from fcm-django.
Tracking in #239, let's go with an override-able device model
from fcm-django.
On the other hand, it takes one param to DatetimeField to save the model creation date or modification date automatically: https://docs.djangoproject.com/en/4.2/ref/models/fields/#django.db.models.DateField
If you name the fields created
and updated
they will even be the same as TimeStampedModel from django-model-utils!
from fcm-django.
The official docs even recommend tracking the last activity of that token:
When stale tokens reach 270 days of inactivity, FCM will consider them expired tokens. Once a token expires, FCM marks it as invalid and rejects sends to it. However, FCM issues a new token for the app instance in the rare case that the device connects again and the app is opened.
Using the token prevents that inactivity and thus seems to be a valid use case to update the timestamp imo.
And another passage:
Retrieve registration tokens from FCM and store them on your server. An important role for the server is to keep track of each client's token and keep an updated list of active tokens. We strongly recommend implementing a token timestamp in your code and your servers, and updating this timestamp at regular intervals.
The last words in the last sentence explicitly recommend an update timestamp.
from fcm-django.
Related Issues (20)
- Setting `content_available: True` HOT 2
- is_cool=True from the docs HOT 1
- user and device type filters in admin dashboard HOT 1
- `InvalidArgumentError` should not cause deactivation of token HOT 8
- Celery and FCM-django HOT 1
- Problem with sending notifications to topic in bulk HOT 7
- Sound and Badge not working when notification arrives in IOS HOT 4
- Documentation about installing with pip seems to be broken on readthedocs HOT 3
- Can this package be compatible with firebase-admin 6? HOT 5
- Backward compatible Updates!!!!! HOT 3
- unique registration_id as textfield broken on mysql HOT 11
- USER_MODEL configuration in FCM_DJANGO_SETTINGS not working HOT 5
- Compatibility with Python 3.11 and Django 4.2 HOT 1
- Deprecated send_all() and send_multicast() methods HOT 6
- set badge count dynamically by user HOT 3
- Issue in migration HOT 5
- Changes related to the firebase API migration (batch send) HOT 2
- OperationalError: "max key length is 3072 bytes" when running tests w/ MySQL w/o migrations
- Incorrectly marking devices as inactive HOT 6
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from fcm-django.