About Delay Push Notifications Only on Android Phones

tambiua year ago

Hi, can anybody help me, Iam getting delay for push notifications on Android phones, I was looking about it on the web, and I have found that I need to set Priority and Urgency to fix it.

 "registration_ids": ["Token"],
  "webpush": {
    "headers": {
      "Urgency": "high"
    }
  },
  "android": {
    "priority": "high"
  },
  "priority": 10
}

Where to I need to do this ? on traccar source code ?

Juankahera year ago

We are experiencing same issue..where do you find that ......Is it related to firebase ?

tambiua year ago

I have found this, I think is about firebase, but I dont know where do I need to change this parameters

https://stackoverflow.com/questions/70979624/delayed-push-notification-on-android-phone

tambiu2 months ago

I have found, It needs to compile traccar source code, change file NotificatorFirebase.java

add the line

.setPriority(AndroidConfig.Priority.HIGH)

See my code

setAndroidConfig(AndroidConfig.builder()
                            .setPriority(AndroidConfig.Priority.HIGH)
                            .setNotification(AndroidNotification.builder()
                                    .setSound("default")
                                    .build())