Giter Site home page Giter Site logo

Comments (7)

akhilesh-kk2 avatar akhilesh-kk2 commented on June 18, 2024 1

Hello Minishlink,
I tried to send push using V4, but code throwing new error messages. Please find error message below.

1) Warning: hex2bin(): Hexadecimal input string must have an even length in C:\Users\Admin\Dropbox\phpws\web-push-php-example\vendor\minishlink\web-push\src\Utils.php on line 60

2) Warning: hex2bin(): Hexadecimal input string must have an even length in C:\Users\Admin\Dropbox\phpws\web-push-php-example\vendor\minishlink\web-push\src\Utils.php on line 61

3) Fatal error: Uncaught TypeError: bin2hex() expects parameter 1 to be string, boolean given in C:\Users\Admin\Dropbox\phpws\web-push-php-example\vendor\minishlink\web-push\src\Encryption.php on line 94

4) TypeError: bin2hex() expects parameter 1 to be string, boolean given in C:\Users\Admin\Dropbox\phpws\web-push-php-example\vendor\minishlink\web-push\src\Encryption.php on line 94

from web-push-php.

 avatar commented on June 18, 2024

@kanishkdudeja yeah me too. Tried more than 15+ tokens and their corresponding keys etc didn't get a result. Then switched to google's node.js library and it worked.

from web-push-php.

web-lee avatar web-lee commented on June 18, 2024

Yep, same here. I keep getting:

Fatal error: Uncaught exception 'RuntimeException' with message 'Curve curve(-3, 41058363725152142129326129780047268409114441015993725554835256314039467401291, 115792089210356248762697446949407573530086143415290314195533631308867097853951) does not contain point (4918410515761654444245044766134315055690937175350732461240884756267261219282, 6958983596947047513192093070725538977923166797291921065363057851985837714368)' in....

from web-push-php.

Minishlink avatar Minishlink commented on June 18, 2024

Hi,

Please look at the other open issues before creating a new one. This is the same as #12 and should be resolved by #13, but you can fix this already by correctly using the regular base 64 encoding (MIME spec) instead of the URL-safe variant.
BCXxO8IhPp_PVjnfx7TugJA3gYdQd3jZUzfcinsjiLjtCL_uJf_2Y9fK8HYkAp2ot6FXs5q7ZFOzdiNlttThpdA= is clearly Base64 URL safe encoded and so does your auth tokens.

from web-push-php.

akhilesh-kk2 avatar akhilesh-kk2 commented on June 18, 2024

Hi Minishlink,
I am using https://github.com/Minishlink/web-push-php-example to send push using VAPID.
In 50% cases above code is working fine but in other 50% cases i am getting error. Please find error message below.

Fatal error: Uncaught exception 'RuntimeException' with message 'Curve curve(-3, 41058363725152142129326129780047268409114441015993725554835256314039467401291, 115792089210356248762697446949407573530086143415290314195533631308867097853951) does not contain point (3241839770838454464458762781498604280851602814305279715423694631606457933959, 5171447275398088959133285509003806382170852108135282320327383382674674072772)' in C:\xxxxxxxxx\vendor\mdanter\ecc\src\Primitives\Point.php on line 100

I am using you latest branch from git.
My src/Encryption.php file already using
$userPublicKey = Base64Url::decode($userPublicKey);
$userAuthToken = Base64Url::decode($userAuthToken);

Please find 2 endpoint, key and token below that is throwing error.

==============1st============
'https://fcm.googleapis.com/fcm/send/cpzPHMsiSA0:APA91bEGvnuuYdJXZ3ZBMaDV7xyTm4m4lvWdovaqDCW_-tZokZtiU4ieqJKDuRshbngHYDI_P4NDesbNOPp77q125PzJxH8BrQ2g3kw5pOMZe-tSE_0UnJr6O2d6otgxbtwLzOa574P1',

'BHK tD4LOUcd3K5fmRhMeNiRy22MZrObmqVh1BYxssgh7bu94ayrgR0gP4Vf92HZk6r/sSUxcMY8ErMjws7i8xI=',

'5536inU7PxmfxdshX2DnNQ==',

==============2nd============
'https://fcm.googleapis.com/fcm/send/fiOncCrPinU:APA91bFwNavvta0ZvzuWREmM4FKZ7fT5halVyxOXJ7Z8WuaQeU11fnjwKW_mCTLD754NOXNPyAeV3hjn6iKwWFTWZvt15TYTCy0kd9-XNLYnIF5Lq4dVTE-PVMK4TkItEbq9-sEwpb2J',

'BDtWy4HfhkfyXAJnP51PLsldXvRI8Gyj2OGDQbklvUCFBNBpyU/nJg0ytb4enzQc5DoLIGqllKeFLRpNDvvirgA=',

'F WPP1RQd/nfoDOss rEHQ=='

from web-push-php.

akhilesh-kk2 avatar akhilesh-kk2 commented on June 18, 2024

Hi Spomky,
Your solution is "Closing as it looks like the issue came from a double encoding.", But at what point double encoding is happening ( Link : phpecc/phpecc#235)?
If double encoding is the issue, then why i am getting this issue in 50% cases?

from web-push-php.

Minishlink avatar Minishlink commented on June 18, 2024

Hello @akhilesh-kk2, can you try with v4 (or v3)? If the problem is still there please open a new issue (I totally forgot you commented on this one)

from web-push-php.

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.