Conversation
|
Are notifications queued? What happens if the app is not immediately available for the notification from firebase? |
|
Are there any constraints on firebase usage (No.of. notifications we can send, No.of. notifications we can send at a time etc.)? |
|
What are the steps required to test your changes on my phone?
|
| val token = task.result?.token | ||
|
|
||
| // Log and toast | ||
| val msg = "[Firebase] Instance ID token: " + token |
There was a problem hiding this comment.
val token = task.result?.token
i.e. token can be null
Check if token is null here.
| msg = "Failed to subscribe to topic 'weather'" | ||
| } | ||
| logger.info("[Firebase] Subscribe to topic 'weather': " + msg) | ||
| Toast.makeText(baseContext, msg, Toast.LENGTH_SHORT).show() |
There was a problem hiding this comment.
Do you think we should use toast only for failure cases?
There was a problem hiding this comment.
Yes. This was only for quick debugging.
Yes, see Lifetime of a message:
|
Stackoverflow says its unlimited. |
On your laptop, open the Firebase Console and login as 'dotbugfix' (not your Google account). I've registered WittyApp as a project there. You can then follow the screenshots above to send a new notification and it should show up on your phone after the app is opened at least once (to subscribe to the topic). Logcat on Android will print the unique instance ID for your phone - you can use that to send a 'test message' from Firebase. This is not required as we can send a message on the 'weather' topic instead of a particular device. |
New features
Log messages from testing
Get Instance ID
Receive direct message from Firebase Console
Receive message on subscribed topic
Screenshots