{"id":1682,"url":"https://github.com/acoomans/SimulatorRemoteNotifications","last_synced_at":"2025-08-02T04:32:19.151Z","repository":{"id":6940650,"uuid":"8192207","full_name":"acoomans/SimulatorRemoteNotifications","owner":"acoomans","description":"Library to send mock remote notifications to the iOS simulator","archived":false,"fork":false,"pushed_at":"2021-07-07T02:52:49.000Z","size":1394,"stargazers_count":1372,"open_issues_count":9,"forks_count":118,"subscribers_count":48,"default_branch":"master","last_synced_at":"2025-07-25T11:44:16.953Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Objective-C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-2-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/acoomans.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":"2013-02-14T02:06:38.000Z","updated_at":"2025-07-22T22:24:50.000Z","dependencies_parsed_at":"2022-09-15T16:52:25.097Z","dependency_job_id":null,"html_url":"https://github.com/acoomans/SimulatorRemoteNotifications","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/acoomans/SimulatorRemoteNotifications","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/acoomans%2FSimulatorRemoteNotifications","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/acoomans%2FSimulatorRemoteNotifications/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/acoomans%2FSimulatorRemoteNotifications/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/acoomans%2FSimulatorRemoteNotifications/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/acoomans","download_url":"https://codeload.github.com/acoomans/SimulatorRemoteNotifications/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/acoomans%2FSimulatorRemoteNotifications/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":267029803,"owners_count":24024217,"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","status":"online","status_checked_at":"2025-07-25T02:00:09.625Z","response_time":70,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":[],"created_at":"2024-01-05T20:15:53.207Z","updated_at":"2025-08-02T04:32:18.317Z","avatar_url":"https://github.com/acoomans.png","language":"Objective-C","funding_links":[],"categories":["Notifications","Objective-C  Stars 1000以内排名整理","Objective-C","OOM-Leaks-Crash"],"sub_categories":["Push Notifications","Other free courses","Projects-Demo"],"readme":"# SimulatorRemoteNotifications\n\nSimulatorRemoteNotifications is a library to send mock remote notifications to the iOS simulator.\n\nThe library extends _UIApplication_ by embedding a mini server that listen for UDP packets containing JSON-formated payload, and a service to send notifications to the mini server.\n\nThis project includes the _iOS Simulator Notifications_ MacOSX app to help you send the mock notifications.\n\n\nNote that SimulatorRemoteNotifications does not send notification through Apple's Push Service.\n\n[![Build Status](https://api.travis-ci.org/acoomans/SimulatorRemoteNotifications.svg)](https://travis-ci.org/acoomans/SimulatorRemoteNotifications)\n[![Cocoapods](https://img.shields.io/cocoapods/v/SimulatorRemoteNotifications.svg)](https://cocoapods.org/?q=SimulatorRemoteNotifications)\n\n\n## Install\n\n### Install with [CocoaPods](http://cocoapods.org)\n\nAdd a pod entry to your Podfile:\n\n    pod 'SimulatorRemoteNotifications', '~\u003e 0.0.3'\n\nInstall the pod(s) by running:\n\n    pod install\n\n### Install the static library\n\n1. Copy the project file in your project\n2. Link your binary with the library, under _Target_ \u003e _Build Phases_ \u003e _Link binary with libraries_ then add the _libSimulatorRemoteNotifications.a_\n3. set `OTHER_LINKER_FLAGS=\"-ObjC\"` for your target\n\n    \n### Install manually\n\n1. clone this repository\n2. add the files in the _SimulatorRemoteNotifications_ directory to your project\n3. set `OTHER_LINKER_FLAGS=\"-ObjC\"` for your target\n\n\n## Usage\n\n### Listening for mock remote notifications\n\nFirst add `#import \"UIApplication+SimulatorRemoteNotifications.h\"` to your application delegate.\n\nThen implement either _application:didReceiveRemoteNotification:_ or _application:didReceiveRemoteNotification:fetchCompletionHandler:_ (background notification, iOS7).\n\nFinally call start listening for mock remote notifications:\n\n\t- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {\n\t\n    \t...\n\n\t\t#if DEBUG\n\t\t\t[application listenForRemoteNotifications];\n\t\t#endif\n\t\n    \treturn YES;\n\t}\n\nWhen _listenForRemoteNotifications_ is called, _application:didRegisterForRemoteNotificationsWithDeviceToken:_ receives a token in the following format instead of random characters: `simulator-remote-notification=IP:PORT`\n\nThe default port number is 9930. If you want to change the port, use _setRemoteNotificationsPort_ before calling _listenForRemoteNotifications_:\n\n\tapplication.remoteNotificationsPort = 1234;\n\nNow, to send a remote notification, send an udp packet to localhost:9930.\n\nNote that if you send a notification while the app is in the background, _application:didReceiveRemoteNotification:fetchCompletionHandler:_ will only be called when you bring the app to the foreground.\n\n\n### Sending a mock remote notification with the _iOS Simulator Notifications_  app\n\nThe project comes with a OSX app called _iOS Simulator Notifications_ to help you send notifications to the iOS Simulator.\n\nBuild and run the target and you'll have a nice interface to send notification to your app in the simulator (see screenshots).\n\n\n### Sending a mock remote notification in tests\n\nFirst add `#import \"ACSimulatorRemoteNotificationsService.h\"` to your test\n\nSend you notification with \n\n\t[[ACSimulatorRemoteNotificationsService sharedService] send:@{@\"message\":@\"message\"}];\n\t\nYou can change the host (default: 127.0.0.1) and port (default: 9930) with \n\n\t[[ACSimulatorRemoteNotificationsService sharedService] setRemoteNotificationsPort:1234];\n\t[[ACSimulatorRemoteNotificationsService sharedService] setRemoteNotificationsHost:@\"10.0.0.1\"];\n\n### Sending a mock remote notification from the command line\n\nYou can also send mock remote notifications from the terminal by using netcat:\n\n\techo -n '{\"message\":\"message\"}' | nc -4u -w1 localhost 9930\n\n## Screenshot\n\n![screenshots](Screenshots/screenshot01.png)\n![screenshots](Screenshots/screenshot02.png)\n\n## Examples\n\nYou can look at _SimulatorRemoteNotifications.xcodeproj_ for examples:\n\n- in _SimulatorRemoteNotificationsExample_, the _application:didReceiveRemoteNotification:_ method is called\n- in _SimulatorRemoteNotificationsBackgroundExample_, the _application:didReceiveRemoteNotification:fetchCompletionHandler:_ method is called\n\n## Documentation\n\nIf you have [appledoc](http://gentlebytes.com/appledoc/) installed, you can generate the documentation by running the corresponding target.\n\t\n## Note\n\n(Real) Apple remote notifications are limited to 256 bytes content length.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Facoomans%2FSimulatorRemoteNotifications","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Facoomans%2FSimulatorRemoteNotifications","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Facoomans%2FSimulatorRemoteNotifications/lists"}