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

[question]: Is there a way to add Launch URL to the push notification button? #17

Open
1 task done
mensurkurtagic opened this issue Oct 28, 2022 · 3 comments
Open
1 task done
Labels
question Further information is requested

Comments

@mensurkurtagic
Copy link

How can we help?

Documentation says that we can create WebButtons with LaunchUrl (Url) as a parameter, but WebButtons attribute is a List, where Button doesn't have Url parameter. How can we add Url to the WebButtons?
If anything else is needed from my side, I'm happy to help.
Image below shows this issue in action:
image

Thank you.

Code of Conduct

  • I agree to follow this project's Code of Conduct

@kesheshyan kesheshyan added the question Further information is requested label Nov 29, 2022
@Hoang-Minh
Copy link

I experience the same thing too. I have to use the unofficial package instead, and it does support url in the button
Check it out at https://www.nuget.org/packages/OneSignal.RestAPIv3.Client

@PzYon
Copy link

PzYon commented Mar 12, 2024

Might be a bit late for the show, but I had the same problem and I solved it using plain old inheritance:

public class ButtonWithUrl : Button
{
  [DataMember(Name = "url", IsRequired = true, EmitDefaultValue = false)]
  public string? Url { get; set; }

  public ButtonWithUrl(string? id = null, string? text = null, string? icon = null, string? url = null)
    : base(id, text, icon)
  {
    Url = url;
  }
}

And then setting the web buttons using the above type instead of the builtin Button-class:

new ButtonWithUrl(id: "yes", text: "Yes", url: "http://localhost:3000/settings")

@nan-li
Copy link

nan-li commented Mar 13, 2024

Hi everyone, thank you for reporting,
This is a bug, the url property is missing from the Button class so we will be fixing this in the next beta release update.

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

No branches or pull requests

5 participants