{"id":19614883,"url":"https://github.com/leancloud/java-apns","last_synced_at":"2026-05-15T15:32:28.762Z","repository":{"id":8260957,"uuid":"9711365","full_name":"leancloud/java-apns","owner":"leancloud","description":"java-apns fork","archived":false,"fork":false,"pushed_at":"2014-04-11T08:28:16.000Z","size":539,"stargazers_count":2,"open_issues_count":1,"forks_count":3,"subscribers_count":42,"default_branch":"master","last_synced_at":"2025-01-09T10:33:23.585Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/leancloud.png","metadata":{"files":{"readme":"README.markdown","changelog":"CHANGELOG","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":"2013-04-27T07:57:44.000Z","updated_at":"2023-08-01T10:27:46.000Z","dependencies_parsed_at":"2022-08-07T00:01:02.177Z","dependency_job_id":null,"html_url":"https://github.com/leancloud/java-apns","commit_stats":null,"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/leancloud%2Fjava-apns","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/leancloud%2Fjava-apns/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/leancloud%2Fjava-apns/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/leancloud%2Fjava-apns/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/leancloud","download_url":"https://codeload.github.com/leancloud/java-apns/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240906866,"owners_count":19876684,"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":[],"created_at":"2024-11-11T10:54:22.262Z","updated_at":"2026-05-15T15:32:23.738Z","avatar_url":"https://github.com/leancloud.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"Build status: [![Build Status](https://travis-ci.org/notnoop/java-apns.png)](https://travis-ci.org/notnoop/java-apns)\n\nIntroduction\n------------\n\njava-apns is a Java client for Apple Push Notification service (APNs).\nThe library aims to provide a highly scalable interface to the Apple\nserver, while still being simple and modular.\n\nThe interface aims to require very minimal code to achieve the most common\ncases, but have it be reconfigurable so you can even use your own networking\nconnections or JSON library if necessary.\n\nLinks: [Installation](http://wiki.github.com/notnoop/java-apns/installation)\n- [Javadocs](http://notnoop.github.com/java-apns/apidocs/index.html)\n- [Changelog](java-apns/blob/master/CHANGELOG)\n\nFeatures:\n--------------\n  *  Easy to use, high performance APNS Service API\n  *  Supports Apple Feedback service\n  *  Support Enhanced Apple Push Notification\n  *  Support MDM and Newstand Notifications\n  *  Easy to use with Apple certificates\n  *  Easy to extend and reuse\n  *  Easy to integrate with dependency injection frameworks\n  *  Easy to setup custom notification payloads\n  *  Supports connection pooling\n  *  Supports re-transmission of Notifications after error\n\nSample Code\n----------------\n\nTo send a notification, you can do it in two steps:\n\n1. Setup the connection\n\n        ApnsService service =\n            APNS.newService()\n            .withCert(\"/path/to/certificate.p12\", \"MyCertPassword\")\n            .withSandboxDestination()\n            .build();\n\n2. Create and send the message\n\n        String payload = APNS.newPayload().alertBody(\"Can't be simpler than this!\").build();\n        String token = \"fedfbcfb....\";\n        service.push(token, payload);\n\n3. To query the feedback service for inactive devices:\n\n        Map\u003cString, Date\u003e inactiveDevices = service.getInactiveDevices();\n        for (String deviceToken : inactiveDevices.keySet()) {\n            Date inactiveAsOf = inactiveDevices.get(deviceToken);\n            ...\n        }\n\nThat's it!\n\nCustom Payloads\n----------------\n\nYou can send a message payload, but providing custom fields and\nlocalizable alert:\n\n    String payload = APNS.newPayload()\n                .badge(3)\n                .customField(\"secret\", \"what do you think?\");\n                .localizedKey(\"GAME_PLAY_REQUEST_FORMAT\")\n                .localizedArguments(\"Jenna\", \"Frank\")\n                .actionKey(\"Play\").build();\n\n    service.push(token, payload);\n\n\nEnhanced Notification Format\n----------------\n\nYou can use the enhanced notification format to get feetback from Apple about notifications that were unable to be processed.\n\n     String payload = APNS.newPayload()\n                .badge(3)\n                .customField(\"secret\", \"what do you think?\");\n                .localizedKey(\"GAME_PLAY_REQUEST_FORMAT\")\n                .localizedArguments(\"Jenna\", \"Frank\")\n                .actionKey(\"Play\").build();\n\n     EnhancedApnsNotification notification = new EnhancedApnsNotification(EnhancedApnsNotification.INCREMENT_ID() /* Next ID */,\n         new Date().getTime() + 60 * 60 /* Expire in one hour */,\n         token /* Device Token */,\n         payload);\n\n     service.push(notification);\n\n\nLicense\n----------------\n\nLicensed under the [New 3-Clause BSD License](http://www.opensource.org/licenses/BSD-3-Clause).\n\n    Copyright 2009, Mahmood Ali.\n    All rights reserved.\n\n    Redistribution and use in source and binary forms, with or without\n    modification, are permitted provided that the following conditions are\n    met:\n\n      * Redistributions of source code must retain the above copyright\n        notice, this list of conditions and the following disclaimer.\n      * Redistributions in binary form must reproduce the above\n        copyright notice, this list of conditions and the following disclaimer\n        in the documentation and/or other materials provided with the\n        distribution.\n      * Neither the name of Mahmood Ali. nor the names of its\n        contributors may be used to endorse or promote products derived from\n        this software without specific prior written permission.\n\n    THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n    \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n    LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n    A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n    OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n    SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n    LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n    DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n    THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n    (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n    OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n\n\nContact\n---------------\nSupport mailing list: http://groups.google.com/group/java-apns-discuss\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fleancloud%2Fjava-apns","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fleancloud%2Fjava-apns","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fleancloud%2Fjava-apns/lists"}