Skip to content
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

Cant add analytics_label #108

Open
ManuelCostanzo opened this issue Oct 14, 2022 · 1 comment
Open

Cant add analytics_label #108

ManuelCostanzo opened this issue Oct 14, 2022 · 1 comment

Comments

@ManuelCostanzo
Copy link

Hey, hi everyone!

I have an issue when sending push notifications to multiple devices. I'm doing:

    options = {
      'data': {
        payload: {
          data: {
            id: 1,
          },
        }.to_json,
      },
      'notification': {
        title: "algo",
        body: "dos",
      },
      'android': {},
      'apns': {
        payload: {
          aps: {
            sound: "default",
            category: "#{Time.zone.now.to_i}",
          },
        },
      },
      'fcm_options': {
        analytics_label: "Label topic",
      },
    }
    response = fcm.send(registration_ids, options)

The push notification sent well, but Firebase is not creating the label. Only worked when I used send_v1 and specifying only 1 devise, but I have to send to multiple devices.

Thank you very much.

@vadimeremeev
Copy link

@ManuelCostanzo I think, need to use send_v1 as fcm.send do not support analytics labels, it using old firebase api. You can send to each device separately or create a firebase topic use instruction to send it there.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants