Giter VIP home page Giter VIP logo

Comments (14)

reivilibre avatar reivilibre commented on July 17, 2024

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...

from sygnal.

myoussef89 avatar myoussef89 commented on July 17, 2024

are you sending it to Sygnal as a string or encoded?

from sygnal.

Mohamed-Ramadan avatar Mohamed-Ramadan commented on July 17, 2024

@myoussef89 the above pk is 'fcmToken' srting that i got from Firebase ,and i send it as a string not b64decode.

from sygnal.

reivilibre avatar reivilibre commented on July 17, 2024

I'm afraid I'm rather confused, are you two related in some way?

@myoussef89 the above pk is 'fcmToken' srting that i got from Firebase ,and i send it as a string not b64decode.

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. "app_id": "com.xxxxxxxxxx:xxxxxxxxxx.matrix", then com.xxxxxxxxxx:xxxxxxxxxx.matrix in your config needs to refer to a GCM/FCM-type app.

from sygnal.

myoussef89 avatar myoussef89 commented on July 17, 2024

yes, we are working together on the same project.

Does that mean IOS is only working with APNS, Not supported on firebase ?

from sygnal.

reivilibre avatar reivilibre commented on July 17, 2024

You are using iOS with FCM?

from sygnal.

myoussef89 avatar myoussef89 commented on July 17, 2024

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.

from sygnal.

reivilibre avatar reivilibre commented on July 17, 2024

OK so my understanding is:

  • When you use FCM on iOS, FCM will talk to APNs on your behalf.
    • so you should not configure Sygnal with APNs
    • You need to give your APNs credentials to FCM
    • then you can try configuring Sygnal to use FCM (GCM) for your iOS app
      • I don't know if anyone has tried this, but after skimming FCM's documentation, it seems like it stands a chance

I don't know if going through FCM will help your problem, though.

from sygnal.

myoussef89 avatar myoussef89 commented on July 17, 2024

yes, that exactly what we are trying to do.

from sygnal.

reivilibre avatar reivilibre commented on July 17, 2024

Your error message indicates that Sygnal is configured with type: apns when it needs to be type: gcm if you are using FCM.

from sygnal.

myoussef89 avatar myoussef89 commented on July 17, 2024

Your error message indicates that Sygnal is configured with type: apns when it needs to be type: gcm if you are using FCM.

yes, I think we messed up the tokens when we were trying on APNS.

from sygnal.

reivilibre avatar reivilibre commented on July 17, 2024

Is this now resolved? :)

from sygnal.

myoussef89 avatar myoussef89 commented on July 17, 2024

Is this now resolved? :)

I think for the current error yes

from sygnal.

Sphinix1 avatar Sphinix1 commented on July 17, 2024

how did you finally resolve it ?, can you share the structure of your sygnal.yaml ? i seem to have the same problem

from sygnal.

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.