# TJLocalPush **Repository Path**: TJONE/TJLocalPush ## Basic Information - **Project Name**: TJLocalPush - **Description**: No description available - **Primary Language**: Objective-C - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2021-10-29 - **Last Updated**: 2021-10-29 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # TJLocalPush /* * iOS10及以上通知方法 ************************************************************ */ #if __IPHONE_OS_VERSION_MAX_ALLOWED >= IPHONE_10_0 /** 获取通知中心权限 * @return 通知中心对象 */ + (UNUserNotificationCenter *)PushCenter; /** 注册通知中心 * @param delegate 代理回调 * @param completionHandler 回调授权结果 */ + (void)registLocalNotificationWithDelegate:(id)delegate withCompletionHandler:(void(^)(BOOL granted, NSError *error))completionHandler; /** 发起推送 * @param title 推送标题 * @param body 推送内容 * @param sound 推送声音文件 * @param alertTime 推送时间 * @param completionHandler 结果 */ + (void)PushLocalNotificationTitle:(NSString *)title Body:(NSString *)body Sound:(NSString *)sound AlertTime:(NSInteger)alertTime withCompletionHandler:(void(^)(NSError *error))completionHandler; /** 获取当前推送对象属性设置,只读,不能更改。 */ + (void)getNotificationSettingsWithCompletionHandler:(void(^)(UNNotificationSettings *settings))completionHandler; #endif //endif ************************************************************ /* * iOS10以下通知方法 ************************************************************ */ #if __IPHONE_OS_VERSION_MAX_ALLOWED < __IPHONE_10_0 /** 注册本地通知 * @param success 注册结果 */ + (BOOL)registLocalNotificationSuccess:(void(^)(BOOL success, NSError *error))success; /** 添加本地通知 * @param message 推送内容 * @param info 添加结果 */ + (void)PushLocalNotificationMessage:(NSString *)message FireDate:(NSDate *)fireDate UserInfo:(NSDictionary *)userInfo NotificationInfo:(void(^)(BOOL success, UILocalNotification *localNotification))info; /** 移除指定的本地通知 */ + (void)removeLocalNotification:(UILocalNotification *)sender; /** 移除所有本地通知 */ + (void)removeAllLocalNotification; #endif //endif ************************************************************