{"id":20675040,"url":"https://github.com/zwczou/jpush","last_synced_at":"2025-04-19T20:34:05.822Z","repository":{"id":49114878,"uuid":"106515818","full_name":"zwczou/jpush","owner":"zwczou","description":"极光推送go客户端，支持定时推送，推送，设备标签别名更改等","archived":false,"fork":false,"pushed_at":"2021-09-18T08:12:31.000Z","size":20,"stargazers_count":27,"open_issues_count":2,"forks_count":10,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-03-29T13:04:18.832Z","etag":null,"topics":["go","jiguang","jpush"],"latest_commit_sha":null,"homepage":"https://godoc.org/github.com/zwczou/jpush","language":"Go","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/zwczou.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":"2017-10-11T06:44:39.000Z","updated_at":"2024-02-29T08:31:18.000Z","dependencies_parsed_at":"2022-09-26T20:30:47.996Z","dependency_job_id":null,"html_url":"https://github.com/zwczou/jpush","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/zwczou%2Fjpush","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zwczou%2Fjpush/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zwczou%2Fjpush/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zwczou%2Fjpush/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zwczou","download_url":"https://codeload.github.com/zwczou/jpush/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249794882,"owners_count":21326776,"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":["go","jiguang","jpush"],"created_at":"2024-11-16T21:08:22.693Z","updated_at":"2025-04-19T20:34:05.800Z","avatar_url":"https://github.com/zwczou.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"极光推送Golang客户端\n===\n\n\n目前支持\n\n* Push API v3\n* Schedule API v3\n* Device API v3\n\n\n### 安装\n\n    go get github.com/zwczou/jpush\n\n### 使用\n\n1. 初始化客户端\n\n```go\n    client := jpush.New(\"key\", \"secret\")\n```\n\n2. 获取推送唯一标识符 cid\n\n```go\n    cidList, err = client.PushCid(1, \"push\")\n```\n\n3. 推送消息\n\n```go\n    payload := \u0026jpush.Payload{\n        Platform: jpush.NewPlatform().All(),\n        Audience: jpush.NewAudience().All().SetTag(\"abc\", \"ef\").SetTagAnd(\"filmtest\"),\n        Notification: \u0026jpush.Notification{\n            Alert: \"test\",\n        },\n        Options: \u0026jpush.Options{\n             TimeLive:       60,\n             ApnsProduction: false,\n        },\n    }\n    msgId, err = client.Push(payload)\n    // msgId, err = client.PushValidate(payload)\n```\n\n\n4. 创建计划任务\n\n```\n    client.ScheduleCreate\n```\n\n5. 方便扩展\n\n如果库没有实现你想使用的方法，可以使用`client.Do`扩展\n\n```go\n// 获取任务的所有msg_id\nvar out struct {\n  MsgIds []struct {\n    MsgId string `json:\"msg_id\"`\n  } `json:\"msgids\"`\n}\nerr := client.Do(http.MethodGet, \"/schedules/\"+scheduleId+\"/msg_ids\", nil, \u0026out)\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzwczou%2Fjpush","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzwczou%2Fjpush","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzwczou%2Fjpush/lists"}