Push notification failed on IOS with : No valid 'aps-environment' entitlement string found for application

Hello,

I am trying to add push notification on generated IOS ipa .
I am working with linux and I am using openssl to generate the certificates adn I have registered my app in firebase FCM (Push notification is working fine in android Platform).
But In IOS it’s not working and when I run :
idevicesyslog
I get this error message in syslog : "No valid ‘aps-environment’ entitlement string found for application ".
no valid \M-b\M^@\M^\aps-environment\M-b\M^@\M^] entitlement string found for application

In app developer I have followed the step below :

  • Create appId adn activate push notification service
  • Generate 2 cer files one for the application and the other one for push notification (Apns Developer)
  • Add device
  • Generate .p12 files for both certificates.
  • Generate provisionning profiles for the appId

My app is working fine and I can get my development IPA but the push is not working.

Here are the commands I am using :

For app :
-Key generation
openssl genrsa -des3 -out key-file.key 2048
-CSR file generation
openssl req -new -key key-file.key -out CSR-file.csr
-Upload csr in apple developer and download .cer file

  • Generate .pem file
    openssl x509 -inform DER -outform PEM -in ios_development.cer -out ios_development.cer.pem
  • Generate .p12
    openssl pkcs12 -export -inkey keyname.key -in ios_development.cer.pem -out Certificates.p12

For push notification :
-Upload csr in apple developer and download .cer for push notification

  • Generate .pem file
    openssl x509 -inform DER -outform PEM -in aps_development.cer -out aps_development.cer.pem
  • Generate .p12
    openssl pkcs12 -export -inkey keyname.key -in aps_development.cer.pem -out PushCertificates.p12

The app is generated and works fine but without push notification.

I have a feeling that in some way I need to merge both .pem files, If it’s the case How can I to do so.

Thanks in advance