{"id":15038126,"url":"https://github.com/apdevzhang/pushnotificationmanager","last_synced_at":"2025-10-04T03:31:56.930Z","repository":{"id":62451296,"uuid":"104764297","full_name":"apdevzhang/PushNotificationManager","owner":"apdevzhang","description":"Convenient and comprehensive api for push notification,provide 6 stems and 20 branchs' function,offer examples written by Objective-C and Swift respectively","archived":true,"fork":false,"pushed_at":"2018-05-05T07:55:05.000Z","size":51585,"stargazers_count":344,"open_issues_count":1,"forks_count":72,"subscribers_count":9,"default_branch":"master","last_synced_at":"2025-01-01T04:41:46.936Z","etag":null,"topics":["cocoapods","objective-c","pushnotification","swift4"],"latest_commit_sha":null,"homepage":"","language":"Objective-C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/apdevzhang.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-09-25T14:56:56.000Z","updated_at":"2024-12-06T01:17:36.000Z","dependencies_parsed_at":"2022-11-01T23:45:27.223Z","dependency_job_id":null,"html_url":"https://github.com/apdevzhang/PushNotificationManager","commit_stats":null,"previous_names":["greenbanyan/pushnotificationmanager"],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/apdevzhang%2FPushNotificationManager","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/apdevzhang%2FPushNotificationManager/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/apdevzhang%2FPushNotificationManager/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/apdevzhang%2FPushNotificationManager/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/apdevzhang","download_url":"https://codeload.github.com/apdevzhang/PushNotificationManager/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":235216194,"owners_count":18954252,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cocoapods","objective-c","pushnotification","swift4"],"created_at":"2024-09-24T20:37:13.230Z","updated_at":"2025-10-04T03:31:50.344Z","avatar_url":"https://github.com/apdevzhang.png","language":"Objective-C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# PushNotificationManager \n![License](https://img.shields.io/badge/License-MIT-orange.svg)\u0026nbsp;\n![Platform](https://img.shields.io/badge/Platform-iOS-yellowgreen.svg)\u0026nbsp;\n![Support](https://img.shields.io/badge/Support-iOS%208%2B-lightgrey.svg)\u0026nbsp;\n![Cocoapods](https://img.shields.io/badge/cocoapods-support-red.svg)\u0026nbsp;\n![Language](https://img.shields.io/badge/language-Objective--C-B9D3EE.svg)\u0026nbsp;\n![Language](https://img.shields.io/badge/language-Swift-red.svg)\u0026nbsp;\n\n\u0026emsp;\u0026emsp;Convenient and comprehensive api for push notification ,provide 6 stems and 20 branchs' function,offer examples written by Objective-C and Swift respectively\u003cbr/\u003e\n\n## Index\n- [Asset](./Asset)\u003cbr/\u003e\n   project assets for local push notification,include picture、image and video\n- [PushNotificationManager](./PushNotificationManager)\u003cbr/\u003e\n   push notification API\n- [PushNotificationManagerExample-ObjC](./PushNotificationManagerExample-ObjC)\u003cbr/\u003e\n   the example for API usage written by Objective-C\n- [PushNotificationManagerExample-Swift](./PushNotificationManagerExample-Swift)\u003cbr/\u003e\n   the example for API usage written by Swift\n- [screenshot](./screenshot)\u003cbr/\u003e\n   project operation screenshot \n\n## Catalog\n- [API](#API) \n- [Brief](#Brief)\n- [Preview](#Preview) \n- [License](#License) \n- [Installation with cocoapods](#Installation) \n- [Examples both Objective-C and Swift](#Examples)\n \n\u003ca name=\"API\"\u003e\u003c/a\u003e\n### API\n \u003cpre\u003e\n PushNotificationManager.h\n PushNotificationManager.m\n\u003c/pre\u003e\n\n\u003ca name=\"Brief\"\u003e\u003c/a\u003e\n### Brief\n 1. push notification style of normal\n    - normal with default alert sound\n    - provide a customized alert sound\n 2. push notification style of graphics\n    - normal with default alert sound\n    - provide a customized alert sound\n    - provide a graphics download from internet\n    - provide a graphics download from internet and a customized alert sound\n 3. push notification style of video\n    - normal with default alert sound\n    - provide a customized alert sound\n    - provide a video download from internet\n    - provide a video download from internet and a customized alert sound\n 4. push notification style of timing(Chinses Time)\n    - normal with default alert sound(weekday、hour、minute、second)\n    - provide a customized alert sound(weekday、hour、minute、second)\n    - push notification style of timing like `2017-10-1`(year、month、day、hour、minute、second)\n    - push notification style of timing like `2017-10-1`(year、month、day、hour、minute、second) and a customized alert sound\n    - push notification style of timing,the fire date is included in a dictionary\n    - push notification style of timing,the fire date is included in a dictionary,provide a customized alert sound\n 5. push notification style of interactive(the max action is four)\n    - normal with default alert sound\n    - provide a customized alert sound\n 6. push notification style of location\n    - normal with default alert sound\n    - provide a customized alert sound\n\n\u003ca name=\"Preview\"\u003e\u003c/a\u003e\n### Preview\n mainpage screenshot1  | mainpage screenshot2 | mainpage screenshot3 | mainpage screenshot4\n -----|-----|-----|-----\n ![screenshot/screenshot1.png](screenshot/screenshot1.png) |  ![screenshot/screenshot2.png](screenshot/screenshot2.png) |  ![screenshot/screenshot3.png](screenshot/screenshot3.png) |  ![screenshot/screenshot4.png](screenshot/screenshot4.png)\n \n push notification style of normal | push notification style of graphics | push notification style of video\n -----|-----|-----\n![screenshot/screenshot6.png](screenshot/screenshot6.png) | ![screenshot/screenshot7.png](screenshot/screenshot7.png) | ![screenshot/screenshot9.png](screenshot/screenshot9.png) \n\n interactive setp1 | interactive setp2 | interactive setp3\n -----|-----|-----\n ![screenshot/screenshot11.png](screenshot/screenshot11.png) | ![screenshot/screenshot12.png](screenshot/screenshot12.png) |  ![screenshot/screenshot13.png](screenshot/screenshot13.png)\n \n  interactive gif | video gif \n -----|-----\n  ![screenshot/gif1.gif](screenshot/gif1.gif) | ![screenshot/gif2.gif](screenshot/gif2.gif) \n\n\u003ca name=\"License\"\u003e\u003c/a\u003e\n### License\n`PushNotificationManager`use [__MIT license__][1]\n\n\u003ca name=\"Installation\"\u003e\u003c/a\u003e\n### Installation with cocoapods\n\u003cpre\u003e\n pod 'PushNotificationManager'\n\u003c/pre\u003e\n ![screenshot/cocoapods.png](screenshot/cocoapods1.0.3.png)\n \n\u003ca name=\"Examples\"\u003e\u003c/a\u003e\n### Examples\n\u0026emsp;\u0026emsp;make sure you install the`PushNotificationManager`with cocoapods or import the files of`PushNotificationManager`before use\n#### Apply the push notification permission\n - Objective-C\n```\n    if (@available(iOS 10.0, *)) {\n        UNUserNotificationCenter *center = [UNUserNotificationCenter currentNotificationCenter];\n        center.delegate = self;\n        UNAuthorizationOptions types=UNAuthorizationOptionBadge|UNAuthorizationOptionAlert|UNAuthorizationOptionSound;\n        [center requestAuthorizationWithOptions:types completionHandler:^(BOOL granted, NSError * _Nullable error) {\n            if (granted) {\n                [center getNotificationSettingsWithCompletionHandler:^(UNNotificationSettings * _Nonnull settings) {\n                    //\n                }];\n            } else {\n                [[UIApplication sharedApplication]openURL:[NSURL URLWithString:UIApplicationOpenSettingsURLString] options:@{UIApplicationOpenURLOptionUniversalLinksOnly:@\"\"} completionHandler:^(BOOL success) { }];\n            }\n        }];\n    } else {\n#pragma clang diagnostic push\n#pragma clang diagnostic ignored\"-Wdeprecated-declarations\"\n        [application registerUserNotificationSettings:[UIUserNotificationSettings settingsForTypes:UIUserNotificationTypeAlert | UIUserNotificationTypeSound | UIUserNotificationTypeBadge categories:nil]];\n    }\n  #pragma clang diagnostic pop\n```\n- Swift\n```\n        if #available(iOS 10.0, *) {\n            let notificationCenter = UNUserNotificationCenter.current()\n            notificationCenter.delegate = self\n            let types = UNAuthorizationOptions([.alert,.badge,.sound])\n            notificationCenter.requestAuthorization(options: types, completionHandler: { (flag, error) in\n                if flag {\n                    print(\"注册成功\")\n                } else {\n                    print(\"注册失败:\\(error.debugDescription)\")\n                }\n            })\n        } else {\n            let setting = UIUserNotificationSettings.init(types: [.alert, .badge, .sound], categories: nil)\n            application.registerUserNotificationSettings(setting)\n        }\n        UIApplication.shared.registerForRemoteNotifications()\n```\n---\n#### push notification style of normal\n - function\n```\n-(void)normalPushNotificationWithTitle:(NSString *)title \n                              subTitle:(NSString *)subTitle  \n                                  body:(NSString *)body \n                            identifier:(NSString *)identifier \n                          timeInterval:(NSInteger)timeInterval \n                                repeat:(BOOL)repeat;\n```\n - Objective-C usage\n```\n [[PushNotificationManager sharedInstance]normalPushNotificationWithTitle:@\"John Winston Lennon\" subTitle:@\"《Imagine》\" body:@\"You may say that I'm a dreamer, but I'm not the only one\" identifier:@\"1-1\" timeInterval:3 repeat:NO];   //`repeat` if you pick the repeat property 'YES',you require to set the timeInterval value \u003e= 60second -\u003e是否重复,若要重复-\u003e时间间隔应\u003e=60s\n```\n - Swift usage\n```\nPushNotificationManager().normalPushNotification(withTitle: \"John Winston Lennon\", subTitle: \"《Imagine》\", body: \"You may say that I'm a dreamer, but I'm not the only one\", identifier: \"1-1\", timeInterval: 3, repeat: false)\n```\n---\n#### push notification style of normal,provide a customized alert sound,e.g. @\"intro.mp3\"\n - function\n```\n-(void)normalPushNotificationWithTitle:(NSString *)title \n                              subTitle:(NSString *)subTitle \n                                  body:(NSString *)body \n                            identifier:(NSString *)identifier \n                             soundName:(NSString *)soundName \n                          timeInterval:(NSInteger)timeInterval \n                                repeat:(BOOL)repeat;\n```\n - Objective-C usage\n ```\n[[PushNotificationManager sharedInstance]normalPushNotificationWithTitle:@\"John Winston Lennon\" subTitle:@\"《Imagine》\" body:@\"You may say that I'm a dreamer, but I'm not the only one\" identifier:@\"1-2\" soundName:@\"tmp.mp3\" timeInterval:3 repeat:NO];\n ```\n - Swift usage\n ```\n PushNotificationManager().normalPushNotification(withTitle: \"John Winston Lennon\", subTitle: \"《Imagine》\", body: \"You may say that I'm a dreamer, but I'm not the only one\", identifier: \"1-2\", soundName: \"tmp.mp3\", timeInterval: 3, repeat: false)\n ```\n ---\n#### push notification style of graphics,include the format of png、jpg、gif and other graphics formats\n - function\n```\n-(void)graphicsPushNotificationWithTitle:(NSString *)title\n                                subTitle:(NSString *)subTitle \n                                    body:(NSString *)body \n                              identifier:(NSString *)identifier \n                                fileName:(NSString *)fileName \n                            timeInterval:(NSInteger)timeInterval \n                                  repeat:(BOOL)repeat;\n```\n - Objective-C usage\n ```\n[[PushNotificationManager sharedInstance]graphicsPushNotificationWithTitle:@\"John Winston Lennon\" subTitle:@\"《Imagine》\" body:@\"You may say that I'm a dreamer, but I'm not the only one\" identifier:@\"2-1\" fileName:@\"Graphics.jpg\" timeInterval:3 repeat:NO];\n ```\n - Swift usage\n```\nPushNotificationManager().graphicsPushNotification(withTitle: \"John Winston Lennon\", subTitle: \"《Imagine》\", body: \"You may say that I'm a dreamer, but I'm not the only one\", identifier: \"2-1\", fileName: \"Graphics.jpg\", timeInterval: 3, repeat: false)\n```\n ---\n#### push notification style of graphics,provide a customized alert sound,e.g. @\"intro.mp3\"\n  - function\n```\n-(void)graphicsPushNotificationWithTitle:(NSString *)title \n                                subTitle:(NSString *)subTitle \n                                    body:(NSString *)body \n                              identifier:(NSString *)identifier \n                                fileName:(NSString *)fileName \n                               soundName:(NSString *)soundName \n                            timeInterval:(NSInteger)timeInterval \n                                  repeat:(BOOL)repeat;\n```\n - Objective-C usage\n```\n[[PushNotificationManager sharedInstance]graphicsPushNotificationWithTitle:@\"John Winston Lennon\" subTitle:@\"《Imagine》\" body:@\"You may say that I'm a dreamer, but I'm not the only one\" identifier:@\"2-2\" fileName:@\"Graphics.jpg\" soundName:@\"tmp.mp3\" timeInterval:3 repeat:NO];\n```\n - Swift usage\n```\nPushNotificationManager().graphicsPushNotification(withTitle: \"John Winston Lennon\", subTitle: \"《Imagine》\", body: \"You may say that I'm a dreamer, but I'm not the only one\", identifier: \"2-2\", fileName: \"Graphics.jpg\", soundName: \"tmp.mp3\", timeInterval: 3, repeat: false)\n```\n---\n#### push notification style of graphics,provide a graphics download from internet\n - function\n```\n-(void)graphicsPushNotificationWithTitle:(NSString *)title \n                                subTitle:(NSString *)subTitle\n                                    body:(NSString *)body \n                              identifier:(NSString *)identifier \n                               urlString:(NSString *)urlString\n                            timeInterval:(NSInteger)timeInterval \n                                  repeat:(BOOL)repeat;\n```\n - Objective-C usage\n ```\n[[PushNotificationManager sharedInstance]graphicsPushNotificationWithTitle:@\"John Winston Lennon\" subTitle:@\"《Imagine》\" body:@\"You may say that I'm a dreamer, but I'm not the only one\" identifier:@\"2-3\" urlString:@\"https://i.loli.net/2017/09/30/59cf8056a1e21.jpg\" timeInterval:3 repeat:NO];\n ```\n - Swift usage\n ```\n PushNotificationManager().graphicsPushNotification(withTitle: \"John Winston Lennon\", subTitle: \"《Imagine》\", body: \"You may say that I'm a dreamer, but I'm not the only one\", identifier: \"2-3\", urlString: \"https://i.loli.net/2017/09/30/59cf8056a1e21.jpg\", timeInterval: 3, repeat: false)\n ```\n ---\n#### push notification style of graphics,provide a graphics download from internet and a customized alert sound,e.g. @\"intro.mp3\"\n - function\n```\n-(void)graphicsPushNotificationWithTitle:(NSString *)title \n                                subTitle:(NSString *)subTitle\n                                    body:(NSString *)body \n                              identifier:(NSString *)identifier \n                               urlString:(NSString *)urlString \n                               soundName:(NSString *)soundName \n                            timeInterval:(NSInteger)timeInterval\n                                  repeat:(BOOL)repeat;\n```\n - Objective-C usage\n```\n[[PushNotificationManager sharedInstance]graphicsPushNotificationWithTitle:@\"John Winston Lennon\" subTitle:@\"《Imagine》\" body:@\"You may say that I'm a dreamer, but I'm not the only one\" identifier:@\"2-4\" urlString:@\"https://i.loli.net/2017/09/30/59cf8056a1e21.jpg\" soundName:@\"tmp.mp3\" timeInterval:3 repeat:NO];\n```\n - Swift usage\n```\nPushNotificationManager().graphicsPushNotification(withTitle: \"John Winston Lennon\", subTitle: \"《Imagine》\", body: \"You may say that I'm a dreamer, but I'm not the only one\", identifier: \"2-4\", urlString: \"https://i.loli.net/2017/09/30/59cf8056a1e21.jpg\", soundName: \"tmp.mp3\", timeInterval: 3, repeat: false)\n```\n---\n#### push notification style of video\n - function\n```\n-(void)videoPushNotificationWithTitle:(NSString *)title \n                             subTitle:(NSString *)subTitle \n                                 body:(NSString *)body \n                           identifier:(NSString *)identifier \n                             fileName:(NSString *)fileName \n                         timeInterval:(NSInteger)timeInterval\n                               repeat:(BOOL)repeat;\n```\n - Objective-c usage\n```\n[[PushNotificationManager sharedInstance]videoPushNotificationWithTitle:@\"John Winston Lennon\" subTitle:@\"《Imagine》\" body:@\"You may say that I'm a dreamer, but I'm not the only one\" identifier:@\"3-1\" fileName:@\"Raining.mp4\" timeInterval:3 repeat:NO];\n```\n - Swift usage\n```\nPushNotificationManager().videoPushNotification(withTitle: \"John Winston Lennon\", subTitle: \"《Imagine》\", body: \"You may say that I'm a dreamer, but I'm not the only one\", identifier: \"3-1\", fileName: \"Raining.mp4\", timeInterval: 3, repeat: false)\n```\n---\n#### push notification style of video,provide a customized alert sound,e.g. @\"intro.mp3\"\n - function\n```\n-(void)videoPushNotificationWithTitle:(NSString *)title \n                             subTitle:(NSString *)subTitle\n                                 body:(NSString *)body \n                           identifier:(NSString *)identifier \n                             fileName:(NSString *)fileName \n                            soundName:(NSString *)soundName\n                         timeInterval:(NSInteger)timeInterval \n                               repeat:(BOOL)repeat;\n```\n - Objective-c usage\n```\n[[PushNotificationManager sharedInstance]videoPushNotificationWithTitle:@\"John Winston Lennon\" subTitle:@\"《Imagine》\" body:@\"You may say that I'm a dreamer, but I'm not the only one\" identifier:@\"3-2\" fileName:@\"Raining.mp4\" soundName:@\"tmp.mp3\" timeInterval:3 repeat:NO];\n```\n - Swift usage\n```\nPushNotificationManager().videoPushNotification(withTitle: \"John Winston Lennon\", subTitle: \"《Imagine》\", body: \"You may say that I'm a dreamer, but I'm not the only one\", identifier: \"3-2\", fileName: \"Raining.mp4\", soundName: \"tmp.mp3\", timeInterval: 3, repeat: false)\n```\n---\n#### push notification style of video,provide a video download from internet\n - function\n```\n-(void)videoPushNotificationWithTitle:(NSString *)title\n                             subTitle:(NSString *)subTitle \n                                 body:(NSString *)body \n                           identifier:(NSString *)identifier\n                            urlString:(NSString *)urlString \n                         timeInterval:(NSInteger)timeInterval \n                               repeat:(BOOL)repeat; \n```\n - Objective-c usage\n```\n[[PushNotificationManager sharedInstance]videoPushNotificationWithTitle:@\"John Winston Lennon\" subTitle:@\"《Imagine》\" body:@\"You may say that I'm a dreamer, but I'm not the only one\" identifier:@\"3-3\" urlString:@\"http://mvideo.spriteapp.cn/video/2017/0929/043c1392-a527-11e7-8f71-1866daeb0df1cutblack_wpcco.mp4\" timeInterval:5 repeat:NO]; //it need some time to download the video from internet,so set the `timeInterval` as 5s\n```\n - Swift usage\n```\nPushNotificationManager().videoPushNotification(withTitle: \"John Winston Lennon\", subTitle: \"《Imagine》\", body: \"You may say that I'm a dreamer, but I'm not the only one\", identifier: \"3-3\", urlString: \"http://mvideo.spriteapp.cn/video/2017/0929/043c1392-a527-11e7-8f71-1866daeb0df1cutblack_wpcco.mp4\", timeInterval: 5, repeat: false)\n```\n---\n#### push notification style of video,provide a video download from internet and a customized alert sound,e.g. @\"intro.mp3\"\n - function\n```\n-(void)videoPushNotificationWithTitle:(NSString *)title \n                             subTitle:(NSString *)subTitle\n                                 body:(NSString *)body \n                           identifier:(NSString *)identifier \n                            urlString:(NSString *)urlString\n                            soundName:(NSString *)soundName\n                         timeInterval:(NSInteger)timeInterval \n                               repeat:(BOOL)repeat;\n```\n - Objective-C usage\n```\n[[PushNotificationManager sharedInstance]videoPushNotificationWithTitle:@\"John Winston Lennon\" subTitle:@\"《Imagine》\" body:@\"You may say that I'm a dreamer, but I'm not the only one\" identifier:@\"3-4\" urlString:@\"http://mvideo.spriteapp.cn/video/2017/0929/043c1392-a527-11e7-8f71-1866daeb0df1cutblack_wpcco.mp4\" soundName:@\"tmp.mp3\" timeInterval:5 repeat:NO];\n```\n - Swift usage\n```\nPushNotificationManager().videoPushNotification(withTitle: \"John Winston Lennon\", subTitle: \"《Imagine》\", body: \"You may say that I'm a dreamer, but I'm not the only one\", identifier: \"3-4\", urlString: \"http://mvideo.spriteapp.cn/video/2017/0929/043c1392-a527-11e7-8f71-1866daeb0df1cutblack_wpcco.mp4\", soundName: \"tmp.mp3\", timeInterval: 5, repeat: false)\n```\n---\n#### push notification style of timing\n - function\n```\n-(void)timingPushNotificationWithTitle:(NSString *)title \n                              subTitle:(NSString *)subTitle\n                                  body:(NSString *)body \n                            identifier:(NSString *)identifier \n                               weekday:(NSString *)weekday\n                                  hour:(NSString *)hour \n                                minute:(NSString *)minute \n                                second:(NSString *)second \n                          timeInterval:(NSInteger)timeInterval\n                                repeat:(BOOL)repeat;\n```\n - Objective-C usage\n```\n[[PushNotificationManager sharedInstance]timingPushNotificationWithTitle:@\"2017-10-1\" subTitle:@\"Happy National Day\" body:@\"World Peace Hooray!\" identifier:@\"4-1\" weekday:@\"1\" hour:@\"2\" minute:@\"49\" second:@\"50\" timeInterval:3 repeat:NO]; // 星期一2:49:50 -\u003eTuesday 2:33:10\n```\n - Swift usage\n```\nPushNotificationManager().timingPushNotification(withTitle: \"2017-10-27\", subTitle: \"little tired\", body: \"want to go home\", identifier: \"4-1\", weekday: \"1\", hour: \"2\", minute: \"49\", second: \"50\", timeInterval: 3, repeat: false)\n```\n---\n#### push notification style of timing,provide a customized alert sound,e.g. @\"intro.mp3\"\n - function\n```\n-(void)timingPushNotificationWithTitle:(NSString *)title \n                              subTitle:(NSString *)subTitle\n                                  body:(NSString *)body\n                            identifier:(NSString *)identifier \n                               weekday:(NSString *)weekday \n                                  hour:(NSString *)hour \n                                minute:(NSString *)minute \n                                second:(NSString *)second \n                             soundName:(NSString *)soundName \n                          timeInterval:(NSInteger)timeInterval \n                                repeat:(BOOL)repeat;\n```\n - Objective-C usage\n```\n[[PushNotificationManager sharedInstance]timingPushNotificationWithTitle:@\"2017-10-1\" subTitle:@\"Happy National Day\" body:@\"World Peace Hooray!\" identifier:@\"4-2\" weekday:@\"1\" hour:@\"2\" minute:@\"49\" second:@\"50\" soundName:@\"tmp.mp3\" timeInterval:3 repeat:NO];  // 星期一2:49:50 -\u003eTuesday 2:33:10\n```\n - Swift usage\n```\nPushNotificationManager().timingPushNotification(withTitle: \"2017-10-27\", subTitle: \"little tired\", body: \"want to go home\", identifier: \"4-2\", weekday: \"1\", hour: \"2\", minute: \"49\", second: \"50\", soundName: \"tmp.mp3\", timeInterval: 3, repeat: false)\n```\n---\n#### push notification style of timing(ex.2017-10-1 5:12)\n - function\n```\n-(void)timingPushNotificationWithTitle:(NSString *)title \n                              subTitle:(NSString *)subTitle\n                                  body:(NSString *)body \n                            identifier:(NSString *)identifier \n                                  year:(NSString *)year \n                                 month:(NSString *)month \n                                   day:(NSString *)day\n                                  hour:(NSString *)hour\n                                minute:(NSString *)minute \n                                second:(NSString *)second \n                          timeInterval:(NSInteger)timeInterval\n                                repeat:(BOOL)repeat;\n```\n - Objective-C usage\n```\n[[PushNotificationManager sharedInstance]timingPushNotificationWithTitle:@\"王菲\" subTitle:@\"《单行道》\" body:@\"春眠不觉晓,庸人偏自扰\" identifier:@\"4-3\" year:@\"2017\" month:@\"10\" day:@\"2\" hour:@\"2\" minute:@\"51\" second:@\"40\" timeInterval:3 repeat:NO]; //2017-10-2 2:51:40\n```\n - Swift usage\n```\nPushNotificationManager().timingPushNotification(withTitle: \"王菲\", subTitle: \"《单行道》\", body: \"春眠不觉晓,庸人偏自扰\", identifier: \"4-3\", year: \"2017\", month: \"10\", day: \"2\", hour: \"2\", minute: \"0\", second: \"0\", timeInterval: 3, repeat: false)\n```\n---\n#### push notification style of timing(ex.2017-10-1 5:12),provide a customized alert sound,e.g. @\"intro.mp3\"\n - function\n```\n-(void)timingPushNotificationWithTitle:(NSString *)title \n                              subTitle:(NSString *)subTitle \n                                  body:(NSString *)body \n                            identifier:(NSString *)identifier \n                                  year:(NSString *)year\n                                 month:(NSString *)month \n                                   day:(NSString *)day \n                                  hour:(NSString *)hour\n                                minute:(NSString *)minute \n                                second:(NSString *)second \n                             soundName:(NSString *)soundName \n                          timeInterval:(NSInteger)timeInterval \n                                repeat:(BOOL)repeat;\n```\n - Objective-C usage\n```\n[[PushNotificationManager sharedInstance]timingPushNotificationWithTitle:@\"王菲\" subTitle:@\"《单行道》\" body:@\"春眠不觉晓,庸人偏自扰\" identifier:@\"4-4\" year:@\"2017\" month:@\"10\" day:@\"11\" hour:@\"12\" minute:@\"0\" second:nil soundName:@\"tmp.mp3\" timeInterval:3 repeat:NO];\n```\n - Swift usage\n```\nPushNotificationManager().timingPushNotification(withTitle: \"王菲\", subTitle: \"《单行道》\", body: \"春眠不觉晓,庸人偏自扰\", identifier: \"4-4\", year: \"2017\", month: \"10\", day: \"2\", hour: \"2\", minute: \"0\", second: \"0\", soundName: \"tmp.mp3\", timeInterval: 3, repeat: false)\n```\n---\n```\n//    NSDictionary *dict = @{@\"weekday\":@1, //the `1` said Monday in China -\u003e`1`等于中国周一\n//                           @\"hour\":@2,\n//                           @\"minute\":@20,\n//                           @\"second\":@10\n//                           }; // this meaning the fire date is \"2:20:10 Monday\" -\u003e字典的内容表示\"周一 2:20:10\"\n```\n#### push notification style of timing,the fire date is included in a dictionary,the fireDate usage is as follows\n - function\n```\n-(void)timingPushNotificationWithTitle:(NSString *)title \n                              subTitle:(NSString *)subTitle \n                                  body:(NSString *)body \n                            identifier:(NSString *)identifier\n                              fireDate:(NSDictionary *)fireDate \n                          timeInterval:(NSInteger)timeInterval \n                                repeat:(BOOL)repeat;   // the fire date include the properities,such as era,year,month,day,hour,minute,second,nanosecond,weekday,weekdayOrdinal,quarter,weekOfMonth,weekOfYear,yearForWeekOfYear\n```\n - Objective-C usage\n```\n[[PushNotificationManager sharedInstance]timingPushNotificationWithTitle:@\"Bang Gang\" subTitle:@\"《Forever Now》\" body:@\"You can see her in the distance\\n Where she walks alone\\n Thenyou follow her direction\\n To your second home\" identifier:@\"4-5\" fireDate:@{@\"year\":@2017,@\"month\":@10,@\"day\":@2,@\"hour\":@2,@\"minute\":@55} timeInterval:3 repeat:NO];\n```\n - Swift usage\n```\nPushNotificationManager().timingPushNotification(withTitle: \"Bang Gang\", subTitle: \"《Forever Now》\", body: \"You can see her in the distance\\n Where she walks alone\\n Thenyou follow her direction\\n To your second home\", identifier: \"4-5\", fireDate: [\"year\":2017,\"month\":10,\"day\":2,\"hour\":2,\"minute\":55], timeInterval: 3, repeat: false)\n```\n---\n#### push notification style of timing,the fire date is included in a dictionary,provide a customized alert sound,e.g. @\"intro.mp3\"\n - function\n```\n-(void)timingPushNotificationWithTitle:(NSString *)title\n                              subTitle:(NSString *)subTitle \n                                  body:(NSString *)body \n                            identifier:(NSString *)identifier \n                              fireDate:(NSDictionary *)fireDate \n                             soundName:(NSString *)soundName \n                          timeInterval:(NSInteger)timeInterval \n                                repeat:(BOOL)repeat;\n```\n - Objective-C usage\n```\n[[PushNotificationManager sharedInstance]timingPushNotificationWithTitle:@\"Bang Gang\" subTitle:@\"《Forever Now》\" body:@\"You can see her in the distance\\n Where she walks alone\\n Thenyou follow her direction\\n To your second home\" identifier:@\"4-6\" fireDate:@{@\"year\":@2017,@\"month\":@10,@\"weekday\":@1,@\"hour\":@3,@\"minute\":@3} soundName:@\"tmp.mp3\" timeInterval:3 repeat:NO]; //2017-10 每周1 早上3点 -\u003e 2017-10 every Monday 3:00 in China\n```\n - Swift usage\n```\nPushNotificationManager().timingPushNotification(withTitle: \"Bang Gang\", subTitle: \"《Forever Now》\", body: \"You can see her in the distance\\n Where she walks alone\\n Thenyou follow her direction\\n To your second home\", identifier: \"4-6\", fireDate: [\"year\":2017,\"month\":10,\"day\":2,\"hour\":2,\"minute\":55], soundName: \"tmp.mp3\", timeInterval: 3, repeat: false)\n```\n---\n#### push notification style of interactive\n - function\n```\n-(void)interactivePushNotificationWithTitle:(NSString *)title \n                                   subTitle:(NSString *)subTitle \n                                       body:(NSString *)body \n                                 identifier:(NSString *)identifier\n                            identifierArray:(NSArray\u003cNSString *\u003e *)identifierArray \n                                actionArray:(NSArray\u003cUNNotificationAction *\u003e *)actionArray \n                               timeInterval:(NSInteger)timeInterval \n                                     repeat:(BOOL)repeat;\n```\n - Objective-C usage\n```\nUNTextInputNotificationAction *action1 = [UNTextInputNotificationAction actionWithIdentifier:@\"reply\" title:NSLocalizedString(@\"评论\", nil) options:UNNotificationActionOptionNone textInputButtonTitle:NSLocalizedString(@\"发送\", nil) textInputPlaceholder:NSLocalizedString(@\"说点什么\", nil)]; //reply action\n\nUNNotificationAction *action2 = [UNNotificationAction actionWithIdentifier:@\"enter\" title:NSLocalizedString(@\"进入\", nil) options:UNNotificationActionOptionForeground]; //enter action\n\nUNNotificationAction *action3 = [UNNotificationAction actionWithIdentifier:@\"cancel\" title:NSLocalizedString(@\"销毁\", nil) options:UNNotificationActionOptionDestructive]; //cancel action\n\n[[PushNotificationManager sharedInstance]interactivePushNotificationWithTitle:@\"Bang Gang\" subTitle:@\"《Forever Now》\" body:@\"You can see her in the distance\\n Where she walks alone\\n Then you follow her direction\\n To your second home\" identifier:@\"5-1\" identifierArray:@[@\"reply\",@\"enter\",@\"cancel\"] actionArray:@[action1,action2,action3] timeInterval:3 repeat:NO];\n```\n - Swift usage\n```\nlet inputAction = UNTextInputNotificationAction(\n                    identifier: \"reply\",\n                    title: \"评论\",\n                    options: [.foreground],\n                    textInputButtonTitle: \"发送\",\n                    textInputPlaceholder: \"说点什么\")\n                    \n let enterAction = UNNotificationAction(\n                    identifier: \"enter\",\n                    title: \"进入\",\n                    options: [.foreground])\n                    \n let cancelAction = UNNotificationAction(\n                    identifier: \"cancel\",\n                    title: \"销毁\",\n                    options: [.destructive])\n                    \nPushNotificationManager().interactivePushNotification(withTitle: \"Bang Gang\", subTitle: \"《Forever Now》\", body: \"You can see her in the distance\\n Where she walks alone\\n Then you follow her direction\\n To your second home\", identifier: \"5-1\", identifierArray: [inputAction.identifier,enterAction.identifier,cancelAction.identifier], actionArray:[inputAction,enterAction,cancelAction], timeInterval: 3, repeat: false);\n```\n---\n#### push notification style of interactive,provide a customized alert sound,e.g. @\"intro.mp3\"\n - function\n```\n-(void)interactivePushNotificationWithTitle:(NSString *)title \n                                   subTitle:(NSString *)subTitle\n                                       body:(NSString *)body\n                                 identifier:(NSString *)identifier \n                            identifierArray:(NSArray\u003cNSString *\u003e *)identifierArray \n                                actionArray:(NSArray\u003cUNNotificationAction *\u003e *)actionArray \n                                  soundName:(NSString *)soundName \n                               timeInterval:(NSInteger)timeInterval \n                                     repeat:(BOOL)repeat;\n```\n - Objective-C usage\n```\nUNTextInputNotificationAction *action1 = [UNTextInputNotificationAction actionWithIdentifier:@\"reply\" title:NSLocalizedString(@\"评论\", nil) options:UNNotificationActionOptionNone textInputButtonTitle:NSLocalizedString(@\"发送\", nil) textInputPlaceholder:NSLocalizedString(@\"说点什么\", nil)]; //reply action\n\nUNNotificationAction *action2 = [UNNotificationAction actionWithIdentifier:@\"enter\" title:NSLocalizedString(@\"进入\", nil) options:UNNotificationActionOptionForeground]; //enter action\n\nUNNotificationAction *action3 = [UNNotificationAction actionWithIdentifier:@\"cancel\" title:NSLocalizedString(@\"销毁\", nil) options:UNNotificationActionOptionDestructive]; //cancel action\n\n[[PushNotificationManager sharedInstance]interactivePushNotificationWithTitle:@\"Bang Gang\" subTitle:@\"《Forever Now》\" body:@\"You can see her in the distance\\n Where she walks alone\\n Then you follow her direction\\n To your second home\" identifier:@\"5-2\" identifierArray:@[@\"reply\",@\"enter\",@\"cancel\"] actionArray:@[action1,action2,action3] soundName:@\"tmp.mp3\" timeInterval:3 repeat:NO];\n```\n - Swift usage\n```\nlet inputAction = UNTextInputNotificationAction(\n                    identifier: \"reply\",\n                    title: \"评论\",\n                    options: [.foreground],\n                    textInputButtonTitle: \"发送\",\n                    textInputPlaceholder: \"说点什么\")\n                    \n let enterAction = UNNotificationAction(\n                    identifier: \"enter\",\n                    title: \"进入\",\n                    options: [.foreground])\n                    \n let cancelAction = UNNotificationAction(\n                    identifier: \"cancel\",\n                    title: \"销毁\",\n                    options: [.destructive])\n                    \n PushNotificationManager().interactivePushNotification(withTitle: \"Bang Gang\", subTitle: \"《Forever Now》\", body: \"You can see her in the distance\\n Where she walks alone\\n Then you follow her direction\\n To your second home\", identifier: \"5-2\", identifierArray: [inputAction.identifier,enterAction.identifier,cancelAction.identifier], actionArray: [inputAction,enterAction,cancelAction], soundName: \"tmp.mp3\", timeInterval: 3, repeat: false)\n```\n---\n#### push notification style of location\n - function\n```\n-(void)locationPushNotificationWithTitle:(NSString *)title \n                                subTitle:(NSString *)subTitle \n                                    body:(NSString *)body \n                              identifier:(NSString *)identifier \n                               longitude:(CGFloat)longitude \n                                latitude:(CGFloat)latitude\n                                  radius:(NSInteger)radius\n                           notifyOnEntry:(BOOL)notifyOnEntey \n                            notifyOnExit:(BOOL)notifyOnExit\n                                  repeat:(BOOL)repeat;\n```\n - Objective-C usage\n ```\n[[PushNotificationManager sharedInstance]locationPushNotificationWithTitle:@\"Pink Floyd\" subTitle:@\"《Wish You Were Here》\" body:@\"How I wish you were here\" identifier:@\"6-1\" longitude:120.030632 latitude:30.288121 radius:1000 notifyOnEntry:YES ontifyOnExit:YES repeat:NO];\n ```\n - Swift usage\n```\nPushNotificationManager().locationPushNotification(withTitle: \"Pink Floyd\", subTitle: \"《Wish You Were Here》\", body: \"How I wish you were here\", identifier: \"6-2\", longitude: 120.030632, latitude: 30.288121, radius: 100, notifyOnEntry: true, ontifyOnExit: true, soundName: \"tmp.mp3\", repeat: false)\n```\n---\n#### push notification style of location,provide a customized alert sound,e.g. @\"intro.mp3\"\n - function\n```\n-(void)locationPushNotificationWithTitle:(NSString *)title \n                                subTitle:(NSString *)subTitle \n                                    body:(NSString *)body \n                              identifier:(NSString *)identifier \n                               longitude:(CGFloat)longitude\n                                latitude:(CGFloat)latitude\n                                  radius:(NSInteger)radius\n                           notifyOnEntry:(BOOL)notifyOnEntey \n                            ontifyOnExit:(BOOL)notifyOnExit \n                               soundName:(NSString *)soundName \n                                  repeat:(BOOL)repeat;\n```\n - Objective-C usage\n```\n[[PushNotificationManager sharedInstance]locationPushNotificationWithTitle:@\"Pink Floyd\" subTitle:@\"《Wish You Were Here》\" body:@\"How I wish you were here\" identifier:@\"6-2\" longitude:120.030632 latitude:30.288121 radius:1000 notifyOnEntry:YES ontifyOnExit:YES soundName:@\"tmp.mp3\" repeat:NO];\n```\n - Swift usage\n```\nPushNotificationManager().locationPushNotification(withTitle: \"Pink Floyd\", subTitle: \"《Wish You Were Here》\", body: \"How I wish you were here\", identifier: \"6-2\", longitude: 120.030632, latitude: 30.288121, radius: 100, notifyOnEntry: true, ontifyOnExit: true, soundName: \"tmp.mp3\", repeat: false)\n```\n---\n#### Receives the push notification in the foreground\n - Objective-C\n```\n// you can see the detail in the project named `PushNotificationManagerExample-ObjC`\n- (void)userNotificationCenter:(UNUserNotificationCenter *)center willPresentNotification:(UNNotification *)notification withCompletionHandler:(void (^)(UNNotificationPresentationOptions options))completionHandler{}\n```\n - Swift\n```\n// you can see the detail in the project named `PushNotificationManagerExample-Swift`\n    func userNotificationCenter(_ center: UNUserNotificationCenter, willPresent notification: UNNotification, withCompletionHandler completionHandler: @escaping (UNNotificationPresentationOptions) -\u003e Void) {}\n```\n---\n#### Receives the push notification in the background\n - Objective-C\n```\n// you can see the detail in the project named `PushNotificationManagerExample-ObjC`\n-(void)userNotificationCenter:(UNUserNotificationCenter *)center didReceiveNotificationResponse:(UNNotificationResponse *)response withCompletionHandler:(void (^)(void))completionHandler{}\n```\n - Swift\n```\n// you can see the detail in the project named `PushNotificationManagerExample-Swift`\n    func userNotificationCenter(_ center: UNUserNotificationCenter, didReceive response: UNNotificationResponse, withCompletionHandler completionHandler: @escaping () -\u003e Void) {}\n```\n---\n\n\n\n[1]: https://github.com/GREENBANYAN/PushNotificationManager/blob/master/LICENSE \"MIT License\"\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fapdevzhang%2Fpushnotificationmanager","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fapdevzhang%2Fpushnotificationmanager","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fapdevzhang%2Fpushnotificationmanager/lists"}