-
Notifications
You must be signed in to change notification settings - Fork 139
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
'Incorrect padding' on APNS notification request #129
Comments
Plainly, your device token seems to be wrong. Oddly, I get a different error to you: >>> pk = "APA91bHPRgkF3JUikC4ENAHEeMrd41Zxv3hVZjC9KtT8OvPVGJ-hQMRKRrZuJAEcl7B338qju59zJMjw2DELjzEvxwYv7hH5Ynpc1ODQ0aT4U4OFEeco8ohsN5PjL1iC2dNtk2BAokeMCg2ZXKqpc8FXKmhX94kIxQ"
>>> base64.b64decode(pk)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/lib/python3.7/base64.py", line 87, in b64decode
return binascii.a2b_base64(s)
binascii.Error: Invalid base64-encoded string: number of data characters (161) cannot be 1 more than a multiple of 4
Invalid base64-encoded string: number of data characters (161) cannot be 1 more than a multiple of 4 Without knowing specifics about how you're getting your device tokens, it's hard to offer any advice. Something is going wrong with your base64 encoding... |
are you sending it to Sygnal as a string or encoded? |
@myoussef89 the above pk is 'fcmToken' srting that i got from Firebase ,and i send it as a string not b64decode. |
I'm afraid I'm rather confused, are you two related in some way?
Firebase FCM (once known as GCM, typically used for Android) and APNs (used for iOS) are two different systems. If you give Sygnal a FCM token, it needs to be for a FCM app ID. i.e. |
yes, we are working together on the same project. Does that mean IOS is only working with APNS, Not supported on firebase ? |
You are using iOS with FCM? |
we tried to use it for FCM because we are having trouble receiving notification with APNS. before IOS 13.3 it was working after Apple's last updates we are not receiving VOIP notifications or text notifications anymore. |
OK so my understanding is:
I don't know if going through FCM will help your problem, though. |
yes, that exactly what we are trying to do. |
Your error message indicates that Sygnal is configured with |
yes, I think we messed up the tokens when we were trying on APNS. |
Is this now resolved? :) |
I think for the current error yes |
how did you finally resolve it ?, can you share the structure of your sygnal.yaml ? i seem to have the same problem |
it was working on Sygnal v0.6.0 , although I send the token as a string, what is wrong with it ?
{
"notification": {
"event_id": "$hUG6SS47Lgms90h363Iwji7g6EJDMAe8SuNgtO-MnLU",
"room_id": "!DxDVMhkbmjTMTdbHsJ:friends-groups.com",
"type": "m.room.message",
"sender": "@xxxxxxxxxx:xxxxxxxxxx.com",
"sender_display_name": "Major Tom",
"room_name": "Mission Control",
"room_alias": "@xxxxxxxxxx:xxxxxxxxxx.com",
"prio": "high",
"content": {
"msgtype": "m.text",
"body": "I'm floating in a most peculiar way."
},
"counts": {
"unread": 2,
"missed_calls": 1
},
"devices": [
{
"app_id": "com.xxxxxxxxxx:xxxxxxxxxx.matrix",
"pushkey": "APA91bHPRgkF3JUikC4ENAHEeMrd41Zxv3hVZjC9KtT8OvPVGJ-hQMRKRrZuJAEcl7B338qju59zJMjw2DELjzEvxwYv7hH5Ynpc1ODQ0aT4U4OFEeco8ohsN5PjL1iC2dNtk2BAokeMCg2ZXKqpc8FXKmhX94kIxQ",
"pushkey_ts": 12345678,
"data": {
"payload": "hello"
},
"tweaks": {
"sound": "bing"
}
}
]
}
}
version: Sygnal v0.7.0
The text was updated successfully, but these errors were encountered: