{"id":16702187,"url":"https://github.com/vkatsuba/epns","last_synced_at":"2025-03-23T14:31:48.523Z","repository":{"id":57495661,"uuid":"190030464","full_name":"vkatsuba/epns","owner":"vkatsuba","description":" :iphone: Erlang Push Notifications. APNS(Apple Push Notifications) and FCM(Firebase Cloud Messaging) Push Notifications","archived":false,"fork":false,"pushed_at":"2021-09-01T16:29:36.000Z","size":38,"stargazers_count":13,"open_issues_count":4,"forks_count":4,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-04-29T10:46:04.218Z","etag":null,"topics":["apns","erlang","fcm","gcm","library","notifications","push"],"latest_commit_sha":null,"homepage":"https://github.com/vkatsuba/epns","language":"Erlang","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/vkatsuba.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":"2019-06-03T15:16:08.000Z","updated_at":"2022-05-06T10:19:33.000Z","dependencies_parsed_at":"2022-08-28T17:41:25.494Z","dependency_job_id":null,"html_url":"https://github.com/vkatsuba/epns","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vkatsuba%2Fepns","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vkatsuba%2Fepns/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vkatsuba%2Fepns/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vkatsuba%2Fepns/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/vkatsuba","download_url":"https://codeload.github.com/vkatsuba/epns/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245116013,"owners_count":20563265,"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":["apns","erlang","fcm","gcm","library","notifications","push"],"created_at":"2024-10-12T18:47:08.400Z","updated_at":"2025-03-23T14:31:48.239Z","avatar_url":"https://github.com/vkatsuba.png","language":"Erlang","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Erlang Push Notifications - epns\n**epns** is Erlang Push Notifications. This is a small client library for sending **FCM**/**GCM**/**APNS** Push Notifications\n\n[![Hex.pm Version](https://img.shields.io/hexpm/v/epns.svg?style=flat-square)](https://hex.pm/packages/epns)\n\n## Goals\n**epns**(**Erlang Push Notifications**) library aims to provide a simple way for push **FCM**/**GCM**/**APNS** notifications.\n\n## Documentation\n### Build \u0026 Run\n```sh\n$ git clone https://github.com/vkatsuba/shot.git\n$ cd shot\n$ wget https://s3.amazonaws.com/rebar3/rebar3\n$ chmod u+x ./rebar3\n$ ./rebar3 shell\n```\n### Run `dialyzer`\n```sh\n$ ./rebar3 dialyzer\n```\n### Run `xref`\n```sh\n$ ./rebar3 do xref\n```\n### Clean `epns`\n```sh\n$ ./rebar3 clean\n```\n### Add `epns` to project: [Rebar3](https://www.rebar3.org/)\n* Edit file **rebar.config**:\n```erlang\n{deps, [\n    {epns, \"1.1.0\"},\n]}.\n```\n\n## Send Push Notifications\n### Send FCM by Erlang\n```erlang\n%%% Useful links:\n%%%  * https://firebase.google.com/docs/cloud-messaging/http-server-ref\n%%%  * https://developer.clevertap.com/docs/find-your-fcm-sender-id-fcm-server-api-key\n\nFCMData = #{\n    key =\u003e \"TheFcmServerApiKey\",\n    url =\u003e \"https://fcm.googleapis.com/fcm/send\",\n    playload =\u003e #{\n        to =\u003e \u003c\u003c\"GoogleUserToken\"\u003e\u003e,\n        priority =\u003e \u003c\u003c\"high\"\u003e\u003e,\n        data =\u003e #{\n            \u003c\u003c\"title\"\u003e\u003e =\u003e \u003c\u003c\"Some Title\"\u003e\u003e,\n            \u003c\u003c\"some_custom_field\"\u003e\u003e =\u003e true\n        }\n    }\n}.\n\nepns:push(fcm, FCMData).\n```\n### Send APNS by Erlang\n```erlang\n%%% Useful links:\n%%%  * https://developer.apple.com/library/content/documentation/NetworkingInternet/Conceptual/RemoteNotificationsPG/CreatingtheNotificationPayload.html\n%%%  * https://developer.apple.com/library/content/documentation/NetworkingInternet/Conceptual/RemoteNotificationsPG/BinaryProviderAPI.html\n%%%  * https://developer.apple.com/library/content/documentation/NetworkingInternet/Conceptual/RemoteNotificationsPG/LegacyNotificationFormat.html\n\nAPNSData = #{\n    cert =\u003e \"/full/patch/to/cert.pem\",\n    key =\u003e \"/full/patch/to/key.key\",\n    url =\u003e \"gateway.push.apple.com\",\n    token =\u003e \u003c\u003c\"VoipTokenOfUserDevice\"\u003e\u003e,\n    playload =\u003e #{\n        aps =\u003e #{alert =\u003e \u003c\u003c\"Some Title Of Alert APNS\"\u003e\u003e},\n        data =\u003e #{\n            \u003c\u003c\"title\"\u003e\u003e =\u003e \u003c\u003c\"Some Title\"\u003e\u003e,\n            \u003c\u003c\"custom_field\"\u003e\u003e =\u003e \u003c\u003c\"some_data\"\u003e\u003e\n        }\n    }\n}.\n\nepns:push(apns, APNSData).\n```\n\n# Support\nv.katsuba.dev@gmail.com\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvkatsuba%2Fepns","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvkatsuba%2Fepns","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvkatsuba%2Fepns/lists"}