TF-2298 Update expires time when old token has expired
Signed-off-by: dab246 <tdvu@linagora.com> (cherry picked from commit fb26afe8f52df6e16476aea8a68f9f92c5c4b001)
This commit is contained in:
@@ -0,0 +1,22 @@
|
||||
|
||||
import 'package:fcm/model/device_client_id.dart';
|
||||
import 'package:fcm/model/fcm_token.dart';
|
||||
import 'package:fcm/model/firebase_registration.dart';
|
||||
import 'package:fcm/model/type_name.dart';
|
||||
|
||||
extension FirebaseRegistrationExtension on FirebaseRegistration {
|
||||
|
||||
FirebaseRegistration syncProperties({
|
||||
DeviceClientId? newDeviceId,
|
||||
FcmToken? newFcmToken,
|
||||
List<TypeName>? newTypes,
|
||||
}) {
|
||||
return FirebaseRegistration(
|
||||
id: id,
|
||||
token: newFcmToken ?? token,
|
||||
deviceClientId: newDeviceId ?? deviceClientId,
|
||||
expires: expires,
|
||||
types: newTypes ?? types
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -1,16 +0,0 @@
|
||||
|
||||
import 'package:fcm/model/device_client_id.dart';
|
||||
import 'package:fcm/model/firebase_subscription.dart';
|
||||
|
||||
extension FirebaseSubscriptionExtension on FirebaseSubscription {
|
||||
|
||||
FirebaseSubscription fromDeviceId({DeviceClientId? newDeviceId}) {
|
||||
return FirebaseSubscription(
|
||||
id: id,
|
||||
token: token,
|
||||
deviceClientId: newDeviceId ?? deviceClientId,
|
||||
expires: expires,
|
||||
types: types
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user