Support for receiving "canonical id" update events from pushserver.
// FREEBIE
This commit is contained in:
parent
456164fc24
commit
e69e395b25
|
@ -11,6 +11,9 @@ public class UnregisteredEvent {
|
||||||
@NotEmpty
|
@NotEmpty
|
||||||
private String registrationId;
|
private String registrationId;
|
||||||
|
|
||||||
|
@JsonProperty
|
||||||
|
private String canonicalId;
|
||||||
|
|
||||||
@JsonProperty
|
@JsonProperty
|
||||||
@NotEmpty
|
@NotEmpty
|
||||||
private String number;
|
private String number;
|
||||||
|
@ -26,6 +29,10 @@ public class UnregisteredEvent {
|
||||||
return registrationId;
|
return registrationId;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public String getCanonicalId() {
|
||||||
|
return canonicalId;
|
||||||
|
}
|
||||||
|
|
||||||
public String getNumber() {
|
public String getNumber() {
|
||||||
return number;
|
return number;
|
||||||
}
|
}
|
||||||
|
|
|
@ -76,7 +76,13 @@ public class FeedbackHandler implements Managed, Runnable {
|
||||||
event.getTimestamp() > device.get().getPushTimestamp())
|
event.getTimestamp() > device.get().getPushTimestamp())
|
||||||
{
|
{
|
||||||
logger.info("GCM Unregister Timestamp matches!");
|
logger.info("GCM Unregister Timestamp matches!");
|
||||||
|
|
||||||
|
if (event.getCanonicalId() != null && !event.getCanonicalId().isEmpty()) {
|
||||||
|
logger.info("It's a canonical ID update...");
|
||||||
|
device.get().setGcmId(event.getCanonicalId());
|
||||||
|
} else {
|
||||||
device.get().setGcmId(null);
|
device.get().setGcmId(null);
|
||||||
|
}
|
||||||
accountsManager.update(account.get());
|
accountsManager.update(account.get());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue