connorlacombe / safari-push-notifications Goto Github PK
View Code? Open in Web Editor NEWDemo showing Safari 7.0's native push notifications on Mac OS X 10.9 (Mavericks)
Demo showing Safari 7.0's native push notifications on Mac OS X 10.9 (Mavericks)
Do not waste your time. The php file is outdated. You can see this in the manifest function which uses sha1 instead of sha512.
Don't waste your time. I'm still searching for the updated file...
EDIT: Here it is: https://developer.apple.com/library/archive/documentation/NetworkingInternet/Conceptual/NotificationProgrammingGuideForWebsites/CompanionFile.zip
I am working on your code from yesterday but it did not worked for me can you please suggest me for some steps.
Hello,
I need help here
1)how to create pushpackage? what will be the URL to create push package?
i am using https://www.domain.com/safari/index.php/pushPackages
and changed code and set $function = $path[2];
but here whats the $version = $path[0] ?
$body = json_decode($body, true); is empty
$userid = $body["id"]; is empty too
2)how to use log?
I'm having an issue that I can't track down.
What's working:
Safari correctly prompts to enable notifications from the host site
The push service correctly logs the device id to mysql, and removes it as needed
So arguably the trickiest part is all ok.
I've checked that your own test site is working for me perfectly.
I've modified your code to push data to all devices, rather than by id. Again this seems to be ok.
Triggering a push notification however is not working.
I've verified that the server is able to talk to the APNS server with
openssl s_client -connect gateway.push.apple.com:2195 -CAfile apns-cert.pem
No errors are returned by stream_socket_client
I've dumped the output of the json data sent, and it looks ok:
"{"aps":{"alert":{"title":"Test notification","body":"This is a test push notification","action":"View"},"url-args":[""]}}"
Not sure what else to check
I'm prompted to opt in on push messages.
In mysql the id = 0 but the device id looks OK
When i try to send push message no message arrives to my mac.
I suspect this has to do with certificates. My website is on a hosted server at domeneshop.no
trying to connect in terminal:
openssl s_client -connect gateway.push.apple.com:2195 -cert apns-cert.pem -debug -showcerts -CAfile priv.p12
------Snip------
depth=1 /C=US/O=Entrust, Inc./OU=www.entrust.net/rpa is incorporated by reference/OU=(c) 2009 Entrust, Inc./CN=Entrust Certification Authority - L1C
verify error:num=20:unable to get local issuer certificate
verify return:0
------Snip------
Server certificate
subject=/C=US/ST=California/L=Cupertino/O=Apple Inc./OU=iTMS Engineering/CN=gateway.push.apple.com
New, TLSv1/SSLv3, Cipher is AES256-SHA
Server public key is 2048 bit
Secure Renegotiation IS supported
Compression: NONE
Expansion: NONE
SSL-Session:
Protocol : TLSv1
Cipher : AES256-SHA
Session-ID:
Session-ID-ctx:
Master-Key: *_Removed by me_
Key-Arg : None
Start Time: 1383316814
Timeout : 300 (sec)
The function apache_request_headers()
throws an error (function already exists), but the script works if I comment it out
I run the code and get the error "Signature verification of push package failed"
I refer to the issues saying "Signature verification of push package failed" but it is not helping me
Can you tell me why I am getting the above error and how to fix it
Just thought I should let you know that your apns-cert file is publicly visible…
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.