- add badge management
This commit is contained in:
parent
052fa21981
commit
def9c0fd06
@ -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
|
||||||
|
|||||||
@ -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
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user