Dear apple developer community...
I am facing the problem on creating my own pushPacakge and .p12 webpush certificates file for safari push notifications. I follow all steps carefully on an official document here with my team.
And also try to follow some tutorials on some blogs which corresponding to its. But it still doesn't work.
Here's how my problem looks like
I've got .p12 file then I've test to upload it into some push service like oneSignal, truePush and etc. It's able to upload the file but the push service still doesn't work. But if I used a provided .p12 from their service, the notification will working properly.
I try to use my .p12 to generate a push package (pushPackage.zip). But the api log on my webServiceUrl keep showing me "{ logs: ['Signature verification of push package failed'] }". Even if I try all versions of AppleWWDRC (G1-G6) downloaded from here. And even I use an official php script (createPushPackage.php) file from apple apn document downloaded from here on the top right corner at companion file
Here's what I've done so far to get my own .p12 file...
Generate my own CSR file from mac keychain application
Noted1: My appleId on my mac is an Admin role only on apple developer account (Not a Admin, Account Holder role)
Noted2: I've try to enter an apple id with role Admin, Account Holder on a User Email Address field but it still doesn't work
Login into an apple developer account console on apple developer site
Go to identifier tab and create new webPushId identifier
Enter description and webPushId(reverse domain name style which is web.com.herokuapp.kkwebpush)
Come back to certificates tab and create new certificate (select webPushId radio button and click create)
Choose webPushId that already created on step 4 from dropdown list then click on continue
Upload CSR file that generated on step 1 into its
Download .cer file
Click on the downloaded .cer file from step 9 and generate .p12 file by keychain
Here's how I create pushPackage.zip file
Create folder to store all files needed ( reference from here ) which are
AppleWWDRCA.cer
Certificates.p12 (Generated from step 9 above)
createPuchPackage.php (Official script from apple which already edit the path to Certificates.p12 and enter private key match with my Certificates.p12 password)
intermediate.pem (Generated from export AppleWWDRCA.cer on keychain as intermediate.pem)
pushPackage.raw (folder that contain both icon.iconset and website.json that already set matched webPushId and webServiceUrl inside website.json)
So, the folder structure now look like this
Then I start to run php createPushPackage.php inside this folder. After that I've got an unreadable format result on my terminal .But I still get a pushPackage.zip file stored at /tmp folder (At this point I think it might be fine with that unreadable format) .
Head over to my tmp folder to move that pushPackage.zip file into my webServiceUrl endpoint directory for send a pushPackage when apple api model was called on window.safari.pushNotification.requestPermission ( Already set these 4 parameters below)
url as my web service url to my endpoint
websitePushID as my web site id registered on apple developer console
userInfo as empty object {}
callback as function as a callback function
FINALLY MY FINAL QUESTIONS ARE...
Are there any steps that I've missed?
Why I keep getting { logs: ['Signature verification of push package failed'] } on my web service url log errors endpoint?
Does my certificate is invalid? (If yes, what are all possible causes)
Why I can't use my own .p12 file on other push services (oneSignal, truePush and etc.) that support custom upload .p12 file for safari push notification?
* When I used a provided .p12 from their service, everything works fine (safari permission popup can appear). On the other hands, If I use my own .p12, I can upload its to their services but safari permission popup don't show up)?
Any solution please?
Thanks