Push Notifications, Episode 12: Notification Service Extension | Kodeco

Learn how to set up a notification service extension to decrypt an encrypted payload before presenting the notification to your user.


This is a companion discussion topic for the original entry at https://www.kodeco.com/1258151-push-notifications/lessons/12

Hello. I have a doubt related with the PHP file that is included in the lesson to send the encrypted notifications.
When I run the script and error appears indicating that the Key passed is null? Find the error below.
Do you know how can I solve this issue?

Warning: openssl_sign(): Supplied key param cannot be coerced into a private key in /Users/ana.rebollo/Downloads/2 ModifyingThePayload/Beginning/sendEncrypted.php on line 30
PHP Deprecated: base64_encode(): Passing null to parameter #1 ($string) of type string is deprecated in /Users/ana.rebollo/Downloads/2 ModifyingThePayload/Beginning/sendEncrypted.php on line 32

hi schdevios! it’s a deprecation warning β€” it should still work…

to stop the warning, try adding the nil coalescing code inside the parentheses: base64_encode(... ?? '')

@gargoyle have you seen this?