Code Monkey home page Code Monkey logo

Comments (21)

xtrinch avatar xtrinch commented on June 26, 2024 1

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.

Akay7 avatar Akay7 commented on June 26, 2024 1

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.

Akay7 avatar Akay7 commented on June 26, 2024 1

If you name the fields created and updated they will even be the same as TimeStampedModel from django-model-utils!

But is there's a reason for that? I though:

  1. 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.
  2. and shouldn't be a limitation to store extra data if it's required according their business requirements

from fcm-django.

xtrinch avatar xtrinch commented on June 26, 2024

Yes, that would be a welcome addition. Pull requests welcome

from fcm-django.

mohitCodepy avatar mohitCodepy commented on June 26, 2024

@xtrinch , May I work on this ? If yes, please assign this issue to me and provide some description about the issue.

from fcm-django.

xtrinch avatar xtrinch commented on June 26, 2024

Tracking in #239, let's go with an override-able device model

from fcm-django.

merwok avatar merwok commented on June 26, 2024

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.

Eraldo avatar Eraldo commented on June 26, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.