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

Support custom fields for the PushData struct #100

Open
ramajd opened this issue Jun 21, 2023 · 3 comments
Open

Support custom fields for the PushData struct #100

ramajd opened this issue Jun 21, 2023 · 3 comments

Comments

@ramajd
Copy link
Contributor

ramajd commented Jun 21, 2023

as mentioned in the Matrix specification - Client Server API, data parameter in SetPusher struct should be a dictionary of pusher specific parameters:

Required if kind is not null. A dictionary of information for the pusher implementation itself. If kind is http, this should contain url which is the URL to use to send notifications to.

working on push notification implementation for iOS devices, I found that there are a series of additional parameters we need to set in the PushData struct.

{
  "url": "https://push-gateway.location.here/_matrix/push/v1/notify",
  "format": "event_id_only",
  "default_payload": {
    "aps": {
      "mutable-content": 1,
      "content-available": 1,
      "alert": {"loc-key": "SINGLE_UNREAD", "loc-args": []}
    }
  }
}

so I'm proposing tho change the data field in SetPusher struct to support additional parameters (Maybe the nlohmann::json).

@ramajd
Copy link
Contributor Author

ramajd commented Jul 11, 2023

does anyone have any comments about this modification?

if it's confirmed I can submit a pull request applying the proposed change

@deepbluev7
Copy link
Member

No, that sounds reasonable. We generally try to avoid the nlohmann::json type in our API, as it is untyped and increases compile time a lot, but if we need to be that flexible, then there isn't really a way around it :)

@ramajd
Copy link
Contributor Author

ramajd commented Jul 16, 2023

I also wanted to implement this custom payload as a std::variant. however, it only postpone the issue to a later time with different requirements.

so I will apply the modifications and submit a pull request then.

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