Open deepak013 opened 4 years ago
I encountered the same problem and solved it by:
Please post the entire error log here and let me help you
from firebase_admin.exception import ApiCallError
This is deprecated now we can no longer import ApiCallError now we have to import
from firebase_admin.exception import FirebaseError
instead
But even after this I was unable to avoid the error so I commented this out
def send_event_via_fcm(user, realtime_event_dict):
token = UserRegistrationToken.objects.get_token_if_exists(user)
print("Firebase: send_event_via_fcm - pre send")
if token is not None and token != "":
message = messaging.Message(
data=realtime_event_dict,
token=token,
)
try:
response = messaging.send(message=message, dry_run=False, app=default_app)
print("Firebase: send_event_via_fcm - post send: " + response)
except:
pass
# except (ApiCallError, ValueError) as e:
# print("Firebase: messaging.send(..) failed: " + str(e))
else:
print("No valid FCM token for user.")
But now I am facing another Issue. After getting both server running from where to start. That is, now how to make users, register, login and then test all this by actual chatting.
Getting error django.core.exceptions.ImproperlyConfigured: Cannot import ASGI_APPLICATION module 'mysite.routing'
I am not able to find any reason for this error. Please help.