{"id":21309967,"url":"https://github.com/lysice/laravel-getui","last_synced_at":"2025-07-11T23:31:03.096Z","repository":{"id":57015851,"uuid":"214144494","full_name":"Lysice/laravel-getui","owner":"Lysice","description":"Laravel个推的集成包,支持单推/多推/全量推送/透传消息等功能。","archived":false,"fork":false,"pushed_at":"2021-07-08T10:15:59.000Z","size":78,"stargazers_count":34,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-11-15T21:51:50.615Z","etag":null,"topics":["composer","getui","laravel","lumen","package"],"latest_commit_sha":null,"homepage":null,"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/Lysice.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":"2019-10-10T09:42:11.000Z","updated_at":"2022-08-20T05:36:32.000Z","dependencies_parsed_at":"2022-08-21T13:20:11.122Z","dependency_job_id":null,"html_url":"https://github.com/Lysice/laravel-getui","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/Lysice%2Flaravel-getui","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Lysice%2Flaravel-getui/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Lysice%2Flaravel-getui/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Lysice%2Flaravel-getui/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Lysice","download_url":"https://codeload.github.com/Lysice/laravel-getui/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":225769372,"owners_count":17521258,"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":["composer","getui","laravel","lumen","package"],"created_at":"2024-11-21T17:11:41.592Z","updated_at":"2024-11-21T17:11:42.410Z","avatar_url":"https://github.com/Lysice.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 欢迎使用 Laravel扩展包 laravel-getui\n[![Latest Stable Version](https://poser.pugx.org/Lysice/laravel-getui/v/stable)](https://packagist.org/packages/Lysice/laravel-getui)\n[![Total Downloads](https://poser.pugx.org/Lysice/laravel-getui/downloads)](https://packagist.org/packages/Lysice/laravel-getui)\n[![Latest Unstable Version](https://poser.pugx.org/Lysice/laravel-getui/v/unstable)](https://packagist.org/packages/Lysice/laravel-getui)\n[![License](https://poser.pugx.org/Lysice/laravel-getui/license)](https://packagist.org/packages/Lysice/laravel-getui)\n\n**网上有一款shaozeming/laravel-getui,自己在lumen下用，无奈报错依赖出问题，于是自己写了一款。**\n\n\n# 主要功能\n\n## 单人推送/多人推送/全量推送/推送任务撤回(待开发)\n\n### 支持模板\n\n#### 透传模板（自定义消息）\n\n#### 通知模板（打开应用首页）\n\n#### 通知模板 （打开浏览器网页）\n\n#### 通知模板 （打开应用内页面）\n\n\n\n### 安装\n\n` composer require lysice/laravel-getui `\n\n\n### 发布配置\n\n`php artisan vendor:publish --provider=\"Lysice/Getui/GetuiServiceProvider\"`\n\n### 给 `config/app.php` 添加服务提供者\nproviders 数组中添加:\n\n    `Lysice\\Getui\\GetuiServiceProvider::class`\n\n### 使用\n#### 1.单推\n##### 1-1单推-通知打开应用首页\n\tprivate function notificationSingle()\n    {\n        $data = [\n            'network_type' =\u003e 0,\n            'client_id' =\u003e 'c3024643a24c11bd3762d437c9103a42',\n            'content' =\u003e '单人推送内容',\n            'title' =\u003e '单人推送标题',\n            'text' =\u003e '单人推送文本',\n            'is_ring' =\u003e true,\n            'is_vibrate' =\u003e true,\n            'logo' =\u003e '',\n            'logo_url' =\u003e ''\n        ];\n        // 第一个参数:\n        Getui::pushToSingle('notification', $data);\n    }\n##### 1-2 单推-通知打开链接\n\t$data = [\n            'title' =\u003e '测试推送',\n            'text' =\u003e '哈哈哈',\n            'content' =\u003e '内容',\n            'is_ring' =\u003e true,\n            'is_vibrate' =\u003e true,\n            'is_clearable' =\u003e true,\n            'url' =\u003e 'http://www.juejin.im',\n            'client_id' =\u003e 'c3024643a24c11bd3762d437c9103a42',\n            'network_type' =\u003e 0\n        ];\n\n        Getui::pushToSingle('link', $data);\n\t\t\n##### 1-3 单推-透传模板\n\t\t$data = [\n            'network_type' =\u003e 0,\n            'transmission_type' =\u003e 2,\n            'client_id' =\u003e 'c3024643a24c11bd3762d437c9103a42',\n            'content' =\u003e '透传内容-单推1'\n        ];\n        Getui::pushToSingle('transmission', $data);\n\n#### 2 多推\n##### 2-1 多推-通知打开应用首页\n\t\t$data = [\n            'client_id_list' =\u003e [\n                'c3024643a24c11bd3762d437c9103a42',\n            ],\n            'network_type' =\u003e 0,\n            'content' =\u003e '多推内容',\n            'title' =\u003e '多推标题',\n            'text' =\u003e '多推文本',\n            'is_ring' =\u003e true,\n            'is_vibrate' =\u003e true,\n            'logo' =\u003e '',\n            'logo_url' =\u003e ''\n        ];\n\n        Getui::pushToList('notification', $data);\n\n##### 2-2 多推-通知模板-打开链接\n\t\t$data = [\n            'client_id_list' =\u003e [\n                'c3024643a24c11bd3762d437c9103a42',\n            ],\n            'network_type' =\u003e 0,\n            'title' =\u003e '多推连接标题',\n            'text' =\u003e '多推连接文本',\n            'is_ring' =\u003e true,\n            'is_vibrate' =\u003e true,\n            'is_clearable' =\u003e true,\n            'url' =\u003e 'https://www.baidu.com'\n        ];\n\n        Getui::pushToList('link', $data);\n\t\t\n##### 2-3 多推-透传消息\n\t\t$data = [\n            'network_type' =\u003e 0,\n            'transmission_type' =\u003e 2,\n            'client_id_list' =\u003e [\n                'c3024643a24c11bd3762d437c9103a42'\n            ],\n            'content' =\u003e '透传内容-多推'\n        ];\n        Getui::pushToList('transmission', $data);\n\t\t\n#### 3 全量推送\n##### 3-1 全量推送-通知模板-打开链接\n\t\t$data = [\n            'title' =\u003e '网页推送',\n            'text' =\u003e '网页推送文本',\n            'is_ring' =\u003e true,\n            'is_vibrate' =\u003e true,\n            'url' =\u003e 'http://www.baidu.com',\n            'is_clearable' =\u003e true\n        ];\n\n        Getui::pushToApp('link', $data);\n\t\t\n##### 3-2 全量推送-通知模板-打开应用首页\n\t\t$data = [\n            'title' =\u003e '测试推送12111',\n            'text' =\u003e '哈哈哈1',\n            'content' =\u003e '内容511121322',\n            'is_ring' =\u003e true,\n            'is_vibrate' =\u003e true,\n            'logo' =\u003e '',\n            'logo_url' =\u003e 'http://wwww.igetui.com/logo.png'\n        ];\n\n        Getui::pushToApp('notification', $data);\n\t\t\n##### 3-3 全量推送-透传-全量\n\t\t$data = [\n            'transmission_type' =\u003e 2,\n            'content' =\u003e '透传内容-全量6'\n        ];\n        $res = Getui::pushToApp('transmission', $data);\n\t\t\n##### 3-4 全量推送-透传模板-多推\n\t\t$data = [\n            'network_type' =\u003e 0,\n            'transmission_type' =\u003e 2,\n            'client_id_list' =\u003e [\n                'c3024643a24c11bd3762d437c9103a42'\n            ],\n            'content' =\u003e '透传内容-多推1'\n        ];\n        Getui::pushToList('transmission', $data);\n\t\t\n#### 4 自定义消息\n##### 4-1 全量推送-自定义消息-透传模板\n\n\t// 自定义数据\n        $content = '自定义消息文本1243';\n        $custom = [\n            'keyId' =\u003e 1,\n            'keyType' =\u003e 111199,\n            'msg' =\u003e $content\n        ];\n        $data = [\n            'title' =\u003e '自定义消息标题-122',\n            'transmission_type' =\u003e 2,\n            'function' =\u003e 'json_encode',\n            'content' =\u003e $content,\n            'custom_data' =\u003e $custom,\n            'custom_fields' =\u003e [\n                'keyId', 'keyType'\n            ],\n            'speed' =\u003e 100, // 可选参数:定速推送 若设置100，则个推控制下发速度在100条/秒左右 默认无表示不定速.\n        ];\n        \n        Getui::pushToApp('transmission', $data);\n\n##### 4-2 单推-自定义消息-透传模板\n\t\t// 自定义数据\n        $content = [\n            'keyId' =\u003e 1,\n            'keyType' =\u003e 111199\n        ];\n        $data = [\n            'title' =\u003e '自定义消息iOS',\n            'network_type' =\u003e 0,\n            'transmission_type' =\u003e 2,\n            'client_id' =\u003e 'c3024643a24c11bd3762d437c9103a42',\n            'content' =\u003e json_encode($content) // 自定义数据加密 接收端需要按照同样方式解密\n        ];\n        Getui::pushToSingle('transmission', $data);\n\t\t\n##### 4-3 多推-自定义消息-透传模板\n\t\t$data = [\n            'title' =\u003e '自定义消息iOS',\n            'network_type' =\u003e 0,\n            'transmission_type' =\u003e 2,\n            'client_id_list' =\u003e [\n                'c3024643a24c11bd3762d437c9103a42'\n            ],\n            'content' =\u003e json_encode($content) // 自定义数据加密 接收端需要按照同样方式解密\n        ];\n        Getui::pushToList('transmission', $data);\n\t\t\n\n### 后续功能待添加\n#### 1 消息撤回\n#### 2 通知消息模板下载\n#### 3 实时设置配置信息等\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flysice%2Flaravel-getui","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flysice%2Flaravel-getui","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flysice%2Flaravel-getui/lists"}