From 052fa21981b5143c76bc6fbaebe3b9373e7cbc17 Mon Sep 17 00:00:00 2001 From: Giuseppe Nucifora Date: Fri, 29 Apr 2016 10:13:10 +0200 Subject: [PATCH] - add last update in PNInstallation object --- PNObject.podspec | 2 +- Pod/Classes/PNClasses/PNInstallation.h | 4 ++++ Pod/Classes/PNClasses/PNInstallation.m | 4 ++++ 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/PNObject.podspec b/PNObject.podspec index 3014ea5..760ad39 100644 --- a/PNObject.podspec +++ b/PNObject.podspec @@ -8,7 +8,7 @@ Pod::Spec.new do |s| s.name = "PNObject" -s.version = "0.7.6" +s.version = "0.7.7" s.summary = "PNObject is a simple replica of the more complex ParseObject" # This description is used to generate tags and improve search results. diff --git a/Pod/Classes/PNClasses/PNInstallation.h b/Pod/Classes/PNClasses/PNInstallation.h index c750019..73b1278 100644 --- a/Pod/Classes/PNClasses/PNInstallation.h +++ b/Pod/Classes/PNClasses/PNInstallation.h @@ -72,5 +72,9 @@ typedef NS_ENUM(NSInteger, PNInstallationType) { * <#Description#> */ @property (nonatomic, assign) NSInteger badge; +/** + * <#Description#> + */ +@property (nonatomic, strong) NSDate *lastUpdate; @end diff --git a/Pod/Classes/PNClasses/PNInstallation.m b/Pod/Classes/PNClasses/PNInstallation.m index 0add7ea..a5e099e 100644 --- a/Pod/Classes/PNClasses/PNInstallation.m +++ b/Pod/Classes/PNClasses/PNInstallation.m @@ -37,6 +37,7 @@ static bool isFirstAccess = YES; @"oldDeviceToken":@"oldDeviceToken", @"badge":@"badge", @"localeIdentifier":@"localeIdentifier", + @"lastUpdate":@"lastUpdate", }; return mapping; } @@ -93,6 +94,9 @@ static bool isFirstAccess = YES; */ _oldDeviceToken = _deviceToken; _deviceToken = ptoken; + if (response != PNInstallationTypeNone) { + _lastUpdate = [NSDate date]; + } return response; }