{"id":22642646,"url":"https://github.com/scthakuri/onesignal-send-notification","last_synced_at":"2025-08-17T11:07:07.373Z","repository":{"id":57062587,"uuid":"471347113","full_name":"scthakuri/onesignal-send-notification","owner":"scthakuri","description":"Simple PHP Library to list and send Push Notification with OneSignal Service","archived":false,"fork":false,"pushed_at":"2022-03-18T14:10:10.000Z","size":4,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-08-13T19:06:59.921Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://packagist.org/packages/sureshchand/onesignal-notification","language":"PHP","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/scthakuri.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}},"created_at":"2022-03-18T11:47:42.000Z","updated_at":"2022-06-28T17:09:54.000Z","dependencies_parsed_at":"2022-08-24T14:00:57.151Z","dependency_job_id":null,"html_url":"https://github.com/scthakuri/onesignal-send-notification","commit_stats":null,"previous_names":["scthakuri/onesignal-send-notification"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/scthakuri/onesignal-send-notification","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/scthakuri%2Fonesignal-send-notification","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/scthakuri%2Fonesignal-send-notification/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/scthakuri%2Fonesignal-send-notification/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/scthakuri%2Fonesignal-send-notification/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/scthakuri","download_url":"https://codeload.github.com/scthakuri/onesignal-send-notification/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/scthakuri%2Fonesignal-send-notification/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":270378759,"owners_count":24573437,"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-08-14T02:00:10.309Z","response_time":75,"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-12-09T05:07:41.398Z","updated_at":"2025-08-17T11:07:07.349Z","avatar_url":"https://github.com/scthakuri.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Simple PHP Library to list and send Push Notification with OneSignal Service\n\n## Installation\n```php\ncomposer require sureshchand/onesignal-notification\n```\n\n# Examples\n\n### Initial Setup\n```php\n\u003c?php\nrequire \"vendor/autoload.php\";\n\n$api_id = 'API_ID';\n$rest_api_key = 'REST_API_KEY';\n\n$pushNotification = new \\Suresh\\Onesignal\\Notification($api_id, $rest_api_key);\n```\n### Create notification\n#### Send to all subscribers\n```php\n\u003c?php\n$pushNotification-\u003esetBody('English Message')\n                 -\u003esetSegments('All')\n                 -\u003eprepare()\n                 -\u003esend();\n```\n#### Send to a specific segment\n```php\n\u003c?php\n$pushNotification-\u003esetBody('English Message')\n                 -\u003esetSegments('Active Users')\n                 -\u003eprepare()\n                 -\u003esend();\n```\n#### Send based on filters/tags\n```php\n\u003c?php\n$pushNotification-\u003esetBody('English Message')\n                 -\u003esetFilter([\n                     ['field' =\u003e 'tag', 'key' =\u003e 'level', 'relation' =\u003e '\u003e', 'value' =\u003e '10'],\n                     ['operator' =\u003e 'OR'],\n                     ['field' =\u003e 'amount_spent', 'relation' =\u003e '\u003e', 'value' =\u003e '0']\n                 ])\n                 -\u003eprepare()\n                 -\u003esend();\n```\n#### Send based on OneSignal PlayerIds\n```php\n\u003c?php\n$pushNotification-\u003esetBody('English Message')\n                 -\u003esetPlayersId([\n                    'PLAYER_ID',\n                    'ANOTHER_PLAYER_ID' \n                 ])\n                 -\u003eprepare()\n                 -\u003esend();\n```\n\n## Reference guideline\n[OneSignal API Reference](https://documentation.onesignal.com/reference)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fscthakuri%2Fonesignal-send-notification","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fscthakuri%2Fonesignal-send-notification","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fscthakuri%2Fonesignal-send-notification/lists"}