mirror of
https://github.com/binwiederhier/ntfy-android.git
synced 2024-06-13 16:14:34 +12:00
put sendEndpoint on register back in
This commit is contained in:
parent
b341956413
commit
61f57dd997
|
@ -93,12 +93,14 @@ class BroadcastReceiver : android.content.BroadcastReceiver() {
|
||||||
try {
|
try {
|
||||||
// Note, this may fail due to a SQL constraint exception, see https://github.com/binwiederhier/ntfy/issues/185
|
// Note, this may fail due to a SQL constraint exception, see https://github.com/binwiederhier/ntfy/issues/185
|
||||||
repository.addSubscription(subscription)
|
repository.addSubscription(subscription)
|
||||||
/* We don't send the endpoint here anymore, the foreground service will do that after
|
distributor.sendEndpoint(appId, connectorToken, endpoint)
|
||||||
registering with the push server. This avoids a race condition where the application server
|
/* We need to stop sending the endpoint here once everyone has the new server,
|
||||||
|
the foreground service will do that after registering with the server.
|
||||||
|
That will avoid a race condition where the application server
|
||||||
is rejected before ntfy even establishes that this topic exists.
|
is rejected before ntfy even establishes that this topic exists.
|
||||||
This is fine from an application perspective, because other distributors can't even register
|
This is fine from an application perspective, because other distributors can't even register
|
||||||
without a connection to the push server.
|
without a connection to the push server.
|
||||||
Unless the app sends registration twice. Then it'll get the endpoint.*/
|
Unless the app registers twice. Then it'll get the endpoint anyway.*/
|
||||||
|
|
||||||
// Refresh (and maybe start) foreground service
|
// Refresh (and maybe start) foreground service
|
||||||
SubscriberServiceManager.refresh(app)
|
SubscriberServiceManager.refresh(app)
|
||||||
|
|
Loading…
Reference in a new issue