Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- override fun onMessageReceived(message: RemoteMessage) {
- (applicationContext as App).appComponent.inject(this)
- val shipmentNumber = message.data["shipment_number"]
- val notificationMessage = message.data["body"]
- val title = message.data["title"]
- if (shipmentNumber != null) {
- disposable += workManagerShipmentService.downloadShipmentAndRestartGeofencing(shipmentNumber) // metoda zwraca completable, jej błąd jest mało prawdopodobny, gdyby jednak wystapił mielibyśmy zalogowane crash z tego miejsca, jednak żadnego nie mamy
- .subscribe {
- val id = System.currentTimeMillis().toInt()
- showNotification(applicationContext, id, title, notificationMessage, createNotificationShipmentPendingIntent(applicationContext, id, shipmentNumber))
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement