{"id":15025202,"url":"https://github.com/sasa-b/apns","last_synced_at":"2026-03-01T05:35:28.350Z","repository":{"id":57047942,"uuid":"290791578","full_name":"sasa-b/apns","owner":"sasa-b","description":"APNS - Apple Push Notification Service PHP Client","archived":false,"fork":false,"pushed_at":"2024-01-31T15:26:25.000Z","size":90,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-08-08T02:42:32.566Z","etag":null,"topics":["apns","apns2","apple","client","client-library","ios","php","php-7","php-library","php7","push-notifications"],"latest_commit_sha":null,"homepage":"","language":"PHP","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/sasa-b.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-08-27T14:05:16.000Z","updated_at":"2022-02-12T13:04:53.000Z","dependencies_parsed_at":"2024-09-28T19:40:34.983Z","dependency_job_id":null,"html_url":"https://github.com/sasa-b/apns","commit_stats":{"total_commits":23,"total_committers":2,"mean_commits":11.5,"dds":0.4782608695652174,"last_synced_commit":"0a53ea64c93232bcd8a1161dd1486d62d1235b47"},"previous_names":[],"tags_count":11,"template":false,"template_full_name":null,"purl":"pkg:github/sasa-b/apns","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sasa-b%2Fapns","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sasa-b%2Fapns/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sasa-b%2Fapns/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sasa-b%2Fapns/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sasa-b","download_url":"https://codeload.github.com/sasa-b/apns/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sasa-b%2Fapns/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29960442,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-01T01:47:18.291Z","status":"online","status_checked_at":"2026-03-01T02:00:07.437Z","response_time":124,"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":["apns","apns2","apple","client","client-library","ios","php","php-7","php-library","php7","push-notifications"],"created_at":"2024-09-24T20:01:43.573Z","updated_at":"2026-03-01T05:35:23.609Z","avatar_url":"https://github.com/sasa-b.png","language":"PHP","readme":"# apns\nAPNS - Apple Push Notification Service PHP Client\n\n[![PHP \u003e= 7.0](https://img.shields.io/badge/php-%3E%3D%207.0-8892BF.svg?style=flat-square)](https://php.net/)\n![](https://img.shields.io/packagist/v/sasa-b/apns2)\n![](https://img.shields.io/packagist/l/sasa-b/apns2)\n\n## Requirements\n```\nPHP \u003e= 7.0\nlib-curl \u003e= 7.46.0 (with http/2 support enabled)\nlib-openssl \u003e= 1.0.2e\n```\n\nIn case of PHP 7.0 you will need to compile PHP from source with the newer lib-curl which supports HTTP2 requests:\n```\n./configure --with-curl=/usr/local/include/curl --with-libdir=lib64 --with-openssl ...\n\n./make\n```\n\n\n## Installation\n```\ncomposer require sasa-b/apns2\n```\n\n## Getting Started\n\n### Certificate Provider Trust\n\n```php\nrequire '/vendor/autoload.php';\n\nuse SasaB\\Apns\\Client;\nuse SasaB\\Apns\\Provider\\Certificate;\n\nuse SasaB\\Apns\\Payload\\Aps;\nuse SasaB\\Apns\\Payload\\Alert;\nuse SasaB\\Apns\\Notification;\n\n$certificate = Certificate::fromFile('/PushCert.pem');\n\n$client = Client::auth($certificate);\n\n$notification = new Notification(\"{device_token}\");\n\n$notification-\u003esetAps(new Aps(new Alert('Hello World')));\n\n$response = $client-\u003esend($notification);\n\necho (string) $response-\u003egetApnsId().\"\\n\";\necho $response;\n```\n\n### Token Key Provider Trust\n\n```php\nrequire '/vendor/autoload.php';\n\nuse SasaB\\Apns\\Client;\nuse SasaB\\Apns\\Provider\\JWT;\nuse SasaB\\Apns\\Provider\\TokenKey;\n\nuse SasaB\\Apns\\Payload\\Aps;\nuse SasaB\\Apns\\Payload\\Alert;\nuse SasaB\\Apns\\Notification;\n\n$tokenKey = new TokenKey('{token_key}');\n$tokenKey-\u003eloadFromFile('/AuthKey.p8');\n\n$jwt = JWT::new('{team_id}', $tokenKey);\n\nif ($jwt-\u003ehasExpired()) {\n    $jwt-\u003erefresh($tokenKey);\n}\n\n$client = Client::auth($jwt);\n\n$notification = new Notification(\"{device_token}\");\n\n$notification-\u003esetPushTopic('com.vendor.app');\n\n$notification-\u003esetAps(new Aps(new Alert('Hello World')));\n\n$response = $client-\u003esend($notification);\n\necho (string) $response-\u003egetApnsId().\"\\n\";\necho $response;\n```","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsasa-b%2Fapns","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsasa-b%2Fapns","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsasa-b%2Fapns/lists"}