Giter Site home page Giter Site logo

Error in APN about pushnotification HOT 17 CLOSED

edujugon avatar edujugon commented on September 15, 2024
Error in APN

from pushnotification.

Comments (17)

fahadonline avatar fahadonline commented on September 15, 2024 2

@Edujugon

I have resolved the issue.
I think the main problem was with using certificate without any "passPhrase".
I have got new certificate with short "passPhrase" like 123.
Though "passPhrase" is optional, not using it created problems for me.

Other than that I have used short name for ".pem" file like "apn.pem".
Also instead of copying ".pem" files to "iosCertificates" folder,
I created the new blank ".pem" files in "iosCertificates" folder,
edited and pasted the content of downloaded ".pem" to newly created files.
Also played with "dry_run", switching it between true/false before it finally started working.
Can't remember any other weird stuff that I might have tried :)

from pushnotification.

Edujugon avatar Edujugon commented on September 15, 2024

@andresdkm
Hi,

Is the issue related to sending a push notification or trying to get the APNS feedback (getFeedback method) ? or none of those methods work for you?

Aside from that, Could you check your pem file is correctly created? maybe this post helps you.

from pushnotification.

andresdkm avatar andresdkm commented on September 15, 2024

Hi

the issue is related to sending a push notification, provided the error occurred, the pem file is generated correctly, after you add the lines that I showed above works correctly.

from pushnotification.

Edujugon avatar Edujugon commented on September 15, 2024

@andresdkm

Thanks for that bugreport.

I've already updated the code and refactored it a bit.

Please update the package version to v2.1.6.

Could you test it to make sure?

from pushnotification.

Edujugon avatar Edujugon commented on September 15, 2024

@andresdkm
Hi,

Did you have time to try the new version? Did it work for you?

from pushnotification.

Edujugon avatar Edujugon commented on September 15, 2024

@andresdkm
Hi, I suppose you aren't facing that issue any more. So I'm closing this..

Anyway, if you think it hasn't been solved yet or you face the same issue in the future let me know and I'll open it again.

Thanks

from pushnotification.

fahadonline avatar fahadonline commented on September 15, 2024

@Edujugon

I am facing similar issue, my composer.json version is "edujugon/push-notification": "^2.1".

May I add that just yesterday the the same code was working fine.

Any clue ?

My settings

'apn' => [
'certificate' => DIR . '/iosCertificates/'.env('APN_CERTIFICATE', 'apns-dev-cert.pem'),
// 'passPhrase' => '', //Optional
// 'passFile' => DIR . '/iosCertificates/yourKey.pem', //Optional
'dry_run' => true
]

ERROR MESSAGE

{
"message": "stream_socket_client(): SSL operation failed with code 1. OpenSSL Error messages:\nerror:14094438:SSL routines:SSL3_READ_BYTES:tlsv1 alert internal error",
"status_code": 500,
"debug": {
"line": 171,
"file": "/vendor/edujugon/push-notification/src/Apn.php",
"class": "ErrorException",
"trace": [
"#0 [internal function]: Illuminate\Foundation\Bootstrap\HandleExceptions->handleError(2, 'stream_socket_c...', '/opt/lampp/htdo...', 171, Array)",
"#1/vendor/edujugon/push-notification/src/Apn.php(171): stream_socket_client('ssl://gateway.s...', 0, '', 60, 5, Resource id #357)",
"#2 /vendor/edujugon/push-notification/src/Apn.php(212): Edujugon\PushNotification\Apn->openConnectionAPNS()",
"#3 /vendor/edujugon/push-notification/src/PushNotification.php(163): Edujugon\PushNotification\Apn->send(Array, Array)",
"#4 /app/Http/Controllers/API/Traits/PushNotificationTrait.php(13): Edujugon\PushNotification\PushNotification->send()",
"#5 /app/Http/Controllers/API/DateController.php(112): App\Http\Controllers\API\DateController->sendPushNotification(Array, '3ce6925f43af87f...')",

    ]
}

}

from pushnotification.

Edujugon avatar Edujugon commented on September 15, 2024

@fahadonline

Hi,
Was that working fine for you before updating to the last version (2.1.6) ?

from pushnotification.

fahadonline avatar fahadonline commented on September 15, 2024

@Edujugon

Hi,

Thanks for response.
I just integrated it yesterday and tried dry run, which seemed to run and getFeedback.
But today when I executed the same code, it generated above mentioned error.

Any help in resolving it will be very helpful.

BTW I tried with different .pem file and got following errors

{
"message": "stream_socket_client(): Unable to set local cert chain file `config/iosCertificates/aps.pem'; Check that your cafile/capath settings include details of your certificate and its issuer",
"status_code": 500,
"debug": {
"line": 171,
"file": "vendor/edujugon/push-notification/src/Apn.php",
"class": "ErrorException",
"trace": [
"#0 [internal function]: Illuminate\Foundation\Bootstrap\HandleExceptions->handleError(2, 'stream_socket_c...', '/opt/lampp/htdo...', 171, Array)",
"#1 vendor/edujugon/push-notification/src/Apn.php(171): stream_socket_client('ssl://gateway.p...', 0, '', 60, 5, Resource id #357)",
"#2 vendor/edujugon/push-notification/src/Apn.php(212): Edujugon\PushNotification\Apn->openConnectionAPNS()",
"#3 vendor/edujugon/push-notification/src/PushNotification.php(163): Edujugon\PushNotification\Apn->send(Array, Array)",
"#4 app/Http/Controllers/API/Traits/PushNotificationTrait.php(13): Edujugon\PushNotification\PushNotification->send()",
"#5 app/Http/Controllers/API/ProspectController.php(87): App\Http\Controllers\API\ProspectController->sendPushNotification(Array, '17f8ca9cba22c71...')",

    ]
}

}

from pushnotification.

Edujugon avatar Edujugon commented on September 15, 2024

@fahadonline

That's weird because the package hasn't been updated today, it has same code as yesterday..

Today, when you get the error, are you trying same code as yesterday but changing dry_run value? Or also same dry_run value?

Regarding your second error message, that seems to be related to the cert details, no about the package..

In order to be able to reproduce your issue, could you send me the cert file and 1 token you are using? Then I'll try to replicate the issue and check it deeply..

If so, send it to me to [email protected]

from pushnotification.

fahadonline avatar fahadonline commented on September 15, 2024

@Edujugon

Sorry but which by "token" what are you referring to ?
I am using ".pem" certificate without any passPhrase.

from pushnotification.

Edujugon avatar Edujugon commented on September 15, 2024

I mean any device token which you are sending push notifications

from pushnotification.

Edujugon avatar Edujugon commented on September 15, 2024

@fahadonline

Have you changed the dry_run value from yesterday? Or you haven't changed anything and yesterday was working and today doesn't..

from pushnotification.

fahadonline avatar fahadonline commented on September 15, 2024

@Edujugon

Changed no thing, same dry_run value "true"

from pushnotification.

Edujugon avatar Edujugon commented on September 15, 2024

@fahadonline

I've got your mail with the requested details :)

As soon as I have some free time (maybe tomorrow) I'll try to reproduce the issue and give you an update..

from pushnotification.

fahadonline avatar fahadonline commented on September 15, 2024

@Edujugon

Thanks

from pushnotification.

Edujugon avatar Edujugon commented on September 15, 2024

@fahadonline
Thank you for your update. :)
Glad to know you solved the issue and now, it works for you.

Anyway, I'll check all those points you mentioned above..

from pushnotification.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.