Git Product home page Git Product logo

Comments (6)

olucurious avatar olucurious commented on June 16, 2024

So, the fcm server endpoint always require a recipient registration_id and right now there's no documentation reference for implementing "User Segment".

However, there's a way to send push notifications to multiple devices without supplying registration_ids by making the app instances subscribe to a topic, I'll work on a commit to handle this feature alongside conditional topic selection to describe it better

Thanks for pointing this out.
Cheers.

from pyfcm.

arpu avatar arpu commented on June 16, 2024

https://github.com/alexbaranov49/GcmFcmSender
jGcmData.put("to", "/topics/global");`

uses a "global" topic, all devices are subscribed to this

from pyfcm.

olucurious avatar olucurious commented on June 16, 2024

A new version has just been completed, you can check it out

  • Added topic messaging functionality

So, you can now use "global" as a topic name since you said all devices are subscribed to that topic.
You should check it out, the README file has been updated with description of the topic functionality.

Cheers.

from pyfcm.

jiamo avatar jiamo commented on June 16, 2024

Any new news? If the project have many apps. this User segment send it helpful. all devices are subscribed to that topic. need a extra step in client.

from pyfcm.

Josh179 avatar Josh179 commented on June 16, 2024

I try with this code:

from pyfcm import FCMNotification
push_service = FCMNotification(api_key="XXXXXXXXX")

registration_id = "XXXXXXXX"
message_title = "Message title"
message_body = "test"
result = push_service.notify_single_device(registration_id=registration_id, message_title=message_title, message_body=message_body)
print result

and this is the result, but the notification never popup in the device...

{'multicast_ids': [xxxxxxx], 'canonical_ids': 0, 'success': 1, 'topic_message_id': None, 'results': [{u'message_id': u'xxxxxxxxx'}], 'failure': 0}

so I need to create a topic? how I can do that with pyfcm?
I'll appreciate any kind of help

from pyfcm.

olucurious avatar olucurious commented on June 16, 2024

@Josh179 you should have created a new issue for that

You need to setup your client to display the message, same goes for topic, you have to subscribe your clients to a topic.

from pyfcm.

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.