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

403 error in topic send #15

Open
download69 opened this issue Jul 8, 2021 · 0 comments
Open

403 error in topic send #15

download69 opened this issue Jul 8, 2021 · 0 comments

Comments

@download69
Copy link

download69 commented Jul 8, 2021

hi
when i use simple send, i don't have any problem and it send successfully.
but when i use send with topic, it returned 403 code ...

my codes :
` var client = new HttpClient();
client.DefaultRequestHeaders.Add("Authorization", "Token ****");

        var response = await client.PostAsync(
            "https://api.pushe.co/v2/messaging/notifications/",
            getTopicNotificationData(Title, content, token)
        );

        var status_code = (int)response.StatusCode;`

`var data = new JObject();
data.Add("title", Title);
data.Add("content", content);
data.Add("action", "{"action_type":"G"}");

        var topics = new JObject();
        topics.Add("topics", new JArray(new String[] { token }));

        var request_data = new JObject();
        request_data.Add("app_ids", new JArray(new String[] { "****" }));
        request_data.Add("data", data);
        request_data.Add("topics", topics);

        //      Console.WriteLine("Request data: " + request_data.ToString());

        return new StringContent(request_data.ToString(), Encoding.UTF8, "application/json");`

is any solution to solve it ...

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

1 participant