- add badge management

This commit is contained in:
giuseppenuc committed 2016-04-29 10:26:42 +02:00
1 parent 052fa21981
commit def9c0fd06
2 files changed
+18 -1

No files matched your search

+6 -1
View File
@@ -36,6 +36,11 @@ typedef NS_ENUM(NSInteger, PNInstallationType) {
*/ */
- (PNInstallationType) setDeviceTokenFromData:(nullable NSData *)deviceTokenData; - (PNInstallationType) setDeviceTokenFromData:(nullable NSData *)deviceTokenData;
/**
* <#Description#>
*/
- (void) resetBadge;
///-------------------------------------- ///--------------------------------------
#pragma mark - PNInstallation Properties #pragma mark - PNInstallation Properties
///-------------------------------------- ///--------------------------------------
@@ -75,6 +80,6 @@ typedef NS_ENUM(NSInteger, PNInstallationType) {
/** /**
* <#Description#> * <#Description#>
*/ */
@property (nonatomic, strong) NSDate *lastUpdate; @property (nonatomic, strong, readonly, nullable) NSDate *lastUpdate;
@end @end
+12
View File
@@ -101,6 +101,18 @@ static bool isFirstAccess = YES;
return response; return response;
} }
- (void) setBadge:(NSInteger)badge {
[[UIApplication sharedApplication] setApplicationIconBadgeNumber:badge];
}
- (NSInteger) badge {
return [[UIApplication sharedApplication] applicationIconBadgeNumber];
}
- (void) resetBadge {
[[UIApplication sharedApplication] setApplicationIconBadgeNumber:0];
}
#pragma mark - #pragma mark -
#pragma mark Private Methods #pragma mark Private Methods