今天是个好日子
挑选一个幸运数字吧
代码如下
for
代码区
+ (void)load
{
// 向 TPNS 上报当前的 APP 未读数
// 1. hook AppDelegate 中监听的 onTotalUnreadMessageCountChanged: 事件,从而设置设置 APP 角标并更新 _unReadCount
id onTPNSBadgeChangedBlock = ^(id aspectInfo, UInt64 totalUnreadCount){
AppDelegate *app = (AppDelegate *)UIApplication.sharedApplication.delegate;
[app onTPNSBadgeChanged:totalUnreadCount];
NSLog(@"[PUSH] onTotalUnreadMessageCountChanged, unReadCount:%zd", app.unReadCount);
};
[AppDelegate aspect_hookSelector:@selector(onTotalUnreadMessageCountChanged:)
withOptions:AspectPositionAfter
usingBlock:onTPNSBadgeChangedBlock
error:nil];
}
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)