Commit 259e0acb06944996457d71396c77b139d54f7f6f

Authored by Zambom
1 parent ac4c176a

Adding FCM to handle message/notification interaction between django and app

Showing 2 changed files with 15 additions and 0 deletions   Show diff stats
amadeus/settings.py
... ... @@ -57,6 +57,7 @@ INSTALLED_APPS = [
57 57 'django_cron',
58 58 'channels',
59 59 'resubmit', # Utilizado para salvar arquivos na cache, para caso o formulario não seja preenchido corretamente o usuário não precise fazer o upload outra vez dos arquivos
  60 + 'fcm_django',
60 61  
61 62 'amadeus',
62 63 'users',
... ... @@ -223,6 +224,17 @@ CHANNEL_LAYERS = {
223 224 },
224 225 }
225 226  
  227 +FCM_DJANGO_SETTINGS = {
  228 + "FCM_SERVER_KEY": "AAAA9XnDjxo:APA91bF-Cpz-GxeNBwHwWVq17reoCpEtQcX_3okZ0BU5qUdbyQ9QCamQfy0XQTkY74ksdEnQB0xLBiyNo99es0a0U5C-SmZd3oGt75nHpg3iVtXUc_mcqlSq4p9hBhG7BWXvzBVFdGt_",
  229 + # true if you want to have only one active device per registered user at a time
  230 + # default: False
  231 + "ONE_DEVICE_PER_USER": False,
  232 + # devices to which notifications cannot be sent,
  233 + # are deleted upon receiving error response from FCM
  234 + # default: False
  235 + "DELETE_INACTIVE_DEVICES": False,
  236 +}
  237 +
226 238 #SECURITY
227 239 SECURE_PROXY_SSL_HEADER = ('HTTP_X_FORWARDED_PROTO','https')
228 240  
... ...
requirements.txt
... ... @@ -62,3 +62,6 @@ whitenoise==3.2.2
62 62 xlrd==1.0.0
63 63 xlwt==1.2.0
64 64 zope.interface==4.3.3
  65 +fcm-django==0.2.11
  66 +pyfcm==1.3.1
  67 +requests-toolbelt==0.8.0
65 68 \ No newline at end of file
... ...