{"id":13989889,"url":"https://github.com/oddnetworks/push-notifications-service","last_synced_at":"2025-07-22T11:32:09.598Z","repository":{"id":100611819,"uuid":"52817239","full_name":"oddnetworks/push-notifications-service","owner":"oddnetworks","description":"Node app to manage iOS and Android device tokens, coordinate with Amazon SNS, and send push notifications","archived":false,"fork":false,"pushed_at":"2016-06-10T19:19:51.000Z","size":44,"stargazers_count":14,"open_issues_count":5,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-08-09T13:16:41.019Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/oddnetworks.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2016-02-29T19:26:17.000Z","updated_at":"2022-09-13T07:21:20.000Z","dependencies_parsed_at":"2023-03-23T22:35:11.819Z","dependency_job_id":null,"html_url":"https://github.com/oddnetworks/push-notifications-service","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oddnetworks%2Fpush-notifications-service","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oddnetworks%2Fpush-notifications-service/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oddnetworks%2Fpush-notifications-service/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oddnetworks%2Fpush-notifications-service/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/oddnetworks","download_url":"https://codeload.github.com/oddnetworks/push-notifications-service/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":227089465,"owners_count":17729469,"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":[],"created_at":"2024-08-09T13:02:08.795Z","updated_at":"2024-11-29T09:30:35.814Z","avatar_url":"https://github.com/oddnetworks.png","language":"JavaScript","funding_links":[],"categories":["JavaScript"],"sub_categories":[],"readme":"# odd-notification-service\n\nThis app uses oddcast to accept formatted notifications and send them to AWS SNS.\n\n## Installation:\n\n```$npm install```\n\n## Usage:\n\nThis service requires a separate web service for recieving device token registration requests and notification requests.\n\nThe API uses the following keys to send notifications:\n\n```json\n\torganizationTopicArn: 'body.organizationTopicArn',\n\tapplicationTopicArn: 'body.applicationTopicArn',\n\tapplicationArn: 'body.applicationArn',\n\tdeviceToken: 'body.deviceToken',\n\tmessage: 'body.message'\n```\nThe organization topic arn is used to send notifications to the entire organization, whereas the application topic arns are used to send notifications to specific applications. The application arn is for when a device is registering, in order for it to subscribe for notifications. The message is the formatted json that contains the message for the push notification.\n\nYou can customize the way this service parses your request in \n```\napi.js\n``` \nbut also feel free to just use the router and customize that however you want:\n```\nroutes/router.js\n```\n\n\n## AWS Setup:\n\nTo use this push notification service you are going to have to set up an AWS SNS Topic for your apps to subscribe to.\n\nDocs are here for configuring SNS:\nhttp://docs.aws.amazon.com/sns/latest/dg/GettingStarted.html\n\nYou are going to need these env variables in your process in order for the AWS sdk to be configured to your account:\n\n- AWS_SECRET_ACCESS_KEY\n- AWS_ACCESS_KEY_ID\n- AWS_DEFAULT_REGION\n\nYou will need the following AWS ARNs from your Amazon SNS setup to get the service working. These need to be attached to requests that you forward to this service. Whether you want to store them in a database or as env variables is totally up to you.\n\n- APPLE_ARN_ID\n- ANDROID_ARN_ID\n- SNS_TOPIC_ARN\n- ANDROID_TOPIC_ARN\n- IOS_TOPIC_ARN\n\nThe ARN variables are what SNS uses to identify where to send the push notification. To get a APPLE and ANDORID ARN you need to setup\nthose projects as Applicaitons on AWS SNS. For help getting your apple and android apps setup you can refer to the AWS docs here:\n\n#### Apple:\nhttp://docs.aws.amazon.com/sns/latest/dg/mobile-push-apns.html\n#### Android:\nhttp://docs.aws.amazon.com/sns/latest/dg/mobile-push-gcm.html\n\nAfter setting up your client application(s), you can then create a topic, which this service subscribes incoming devices to. You can of course tweak whether this service sends to a topic, a particular app, or any other criteria.\n\n## Device Configuration\n\nYou will need to register devices for push notifications. Each device will need to register with the push notification service in order to recieve notifications.\n\nOn iOS you can use:\n\n```swift\nfunc application(application: UIApplication, didRegisterForRemoteNotificationsWithDeviceToken deviceToken: NSData) \n```\n\nYou must then send the device token to wherever your separate web server is hosted, and send to this route on this service:\n```\n/register\n```\nYou will need to send up the device token from the device and then attach that devices application arn in your web service to the request body to register a device with API in this service.\n\n## Sending Notifications\nYour web service can send notifications to this service via the following routes:\n```\n/notify/organization\n```\n\nor \n\n```\n/notify/application\n```\n\nYou can customize the format of the message for both platforms in the json, links to resources for formatting notifications are below:\n\n#####APNS\nhttps://developer.apple.com/library/ios/documentation/NetworkingInternet/Conceptual/RemoteNotificationsPG/Chapters/TheNotificationPayload.html#//apple_ref/doc/uid/TP40008194-CH107-SW1\n\n#####GCM\nhttps://developers.google.com/cloud-messaging/http-server-ref\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foddnetworks%2Fpush-notifications-service","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Foddnetworks%2Fpush-notifications-service","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foddnetworks%2Fpush-notifications-service/lists"}