This is a simple Java or Python server for puhing remote notifications to iOS devices using apple push notification server(APNS).
prepare the following:
- A valid APNS certificate
- A valid APNS key
- A valid APNS topic (not necessary)
- A valid APNS device token
- A valid Apple Developer Team ID
more information about the APNS can be found here
- Clone the project
git clone https://github.com/TLSMars/Java-Python-server-for-APNS.git
- Install the required packages
cd Python pip install -r requirements.txt
- change the
AuthKey.p8
file to your key file - open
config.json
and change the following variables:key_id
team_id
APNS_TOPIC
device_token
- open
Java/src/com/apple.properties
file and change the following variables:key_id
team_id
APNS_TOPIC
- change the
Java/src/com/AuthKey.p8
file to your key file - open
Java/src/com/Main.java
and change the following variables:deviceToken
! Important: Requests to APNS must be made using a secure connection (HTTPS over HTTP/2). Therefore, if any issues arise, they may be attributed to the usage of HTTP/2.
cd Python
python sendNotificationToAPNS.py
I am sorry, I am not familiar with Java, but you can run it using any Java IDE. I can run it using vscode If you know how to run it using the terminal, please let me know.
if you find it useful, please give me a Star ⭐️