diff --git a/Pod/Classes/PNClasses/PNInstallation.h b/Pod/Classes/PNClasses/PNInstallation.h index 60bd6d5..760ec56 100644 --- a/Pod/Classes/PNClasses/PNInstallation.h +++ b/Pod/Classes/PNClasses/PNInstallation.h @@ -41,6 +41,10 @@ typedef NS_ENUM(NSInteger, PNInstallationType) { */ - (void) resetBadge; +- (void) setRegistered; + +- (void) setUpdated; + ///-------------------------------------- #pragma mark - PNInstallation Properties ///-------------------------------------- @@ -80,6 +84,14 @@ typedef NS_ENUM(NSInteger, PNInstallationType) { /** * <#Description#> */ -@property (nonatomic, strong, readonly, nullable) NSDate *lastUpdate; +@property (nonatomic, strong, readonly, nullable) NSDate *registeredAt; +/** + * <#Description#> + */ +@property (nonatomic, strong, readonly, nullable) NSDate *updatedAt; +/** + * <#Description#> + */ +@property (nonatomic, strong, readonly, nullable) NSDate *lastTokenUpdate; @end diff --git a/Pod/Classes/PNClasses/PNInstallation.m b/Pod/Classes/PNClasses/PNInstallation.m index 2844afd..b876f98 100644 --- a/Pod/Classes/PNClasses/PNInstallation.m +++ b/Pod/Classes/PNClasses/PNInstallation.m @@ -37,7 +37,9 @@ static bool isFirstAccess = YES; @"oldDeviceToken":@"oldDeviceToken", @"badge":@"badge", @"localeIdentifier":@"localeIdentifier", - @"lastUpdate":@"lastUpdate", + @"registeredAt":@"registeredAt", + @"updatedAt":@"updatedAt", + @"lastTokenUpdate":@"lastTokenUpdate", }; return mapping; } @@ -95,7 +97,7 @@ static bool isFirstAccess = YES; _oldDeviceToken = _deviceToken; _deviceToken = ptoken; if (response != PNInstallationTypeNone) { - _lastUpdate = [NSDate date]; + _lastTokenUpdate = [NSDate date]; } return response; @@ -113,6 +115,14 @@ static bool isFirstAccess = YES; [[UIApplication sharedApplication] setApplicationIconBadgeNumber:0]; } +- (void) setRegistered { + _registeredAt = [NSDate date]; +} + +- (void) setUpdated { + _updatedAt = [NSDate date]; +} + #pragma mark - #pragma mark Private Methods