# Push Notifications without using "allowed user api push urls "

**URL:** https://meta.discourse.org/t/push-notifications-without-using-allowed-user-api-push-urls/181233
**Category:** Development
**Created:** [February 26, 2021, 3:01pm UTC](https://meta.discourse.org/t/push-notifications-without-using-allowed-user-api-push-urls/181233 "2021-02-26T15:01:26Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![a\_developer](https://avatars.discourse-cdn.com/v4/letter/a/a3d4f5/32.png) [@a\_developer](https://meta.discourse.org/u/a_developer)
#### Post date: [February 26, 2021, 3:01pm UTC](https://meta.discourse.org/t/push-notifications-without-using-allowed-user-api-push-urls/181233/1 "2021-02-26T15:01:27Z")

</div>

I am currently building a web view client like discourse mobile for android for two of my personal forums. I am using the user-api-key method for authentication. I saw a couple endpoints on the discourse codebase `push_notifications/subscribe` and `push_notifications/unsubscribe` that i believe would help me push notifications to the users device. The reason i want to use these endpoints is because i don’t have access to the discourse admin. Also, there is a very high possibility that URL’s to my implementation of push servers might change, so frequently updating discourse admin wouldn’t make much sense.

You might have seen this question multiple times now, but i couldn’t find precise relevant materials so if you could point me to the right link/topic or guide me through this it would be great. If i am successful, i’ll definitely document it for posterity.

---

<div class="post-metadata">

### Author: ![Falco](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/falco/32/179432_2.png) [@Falco](https://meta.discourse.org/u/Falco)
#### Post date: [February 26, 2021, 4:58pm UTC](https://meta.discourse.org/t/push-notifications-without-using-allowed-user-api-push-urls/181233/2 "2021-02-26T16:58:59Z")

</div>

Those endpoints are for the native Web Push API.

If you are building an Android app, and using the UserAPIKey, you can check how we do in [DiscourseHub](https://github.com/discourse/DiscourseMobile)

---

<div class="post-metadata">

### Author: ![a\_developer](https://avatars.discourse-cdn.com/v4/letter/a/a3d4f5/32.png) [@a\_developer](https://meta.discourse.org/u/a_developer)
#### Post date: [February 26, 2021, 5:13pm UTC](https://meta.discourse.org/t/push-notifications-without-using-allowed-user-api-push-urls/181233/3 "2021-02-26T17:13:15Z")

</div>

hey @Falco, thanks for your reply; please don’t mind me asking this. i’m still a novice figuring out discourse, but i see that discourse mobile is using the `push_url` param during user-api-key authentication. doesn’t that still need the help of allowed push url in admin? Also i sorry i didn’t mention this before, but i do need a general solution as i may implement the same for ios in the future.

if i am looking at it wrong, can you please point me towards the exact file you need me to look at?  
Also it may not seem very clear, but i require a server side implementation first

---

<div class="post-metadata">

### Author: ![Falco](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/falco/32/179432_2.png) [@Falco](https://meta.discourse.org/u/Falco)
#### Post date: [February 26, 2021, 5:54pm UTC](https://meta.discourse.org/t/push-notifications-without-using-allowed-user-api-push-urls/181233/4 "2021-02-26T17:54:38Z")

</div>

> [@a\_developer](#):
>
> but i see that discourse mobile is using the `push_url` param during user-api-key authentication. doesn’t that still need the help of allowed push url in admin? Also i sorry i didn’t mention this before, but i do need a general solution as i may implement the same for ios in the future.

Yes, that is all correct! It’s just that the

> [@a\_developer](#):
>
> `push_notifications/subscribe` and `push_notifications/unsubscribe`

you mentioned that are not used for DiscourseHub.

---

<div class="post-metadata">

### Author: ![a\_developer](https://avatars.discourse-cdn.com/v4/letter/a/a3d4f5/32.png) [@a\_developer](https://meta.discourse.org/u/a_developer)
#### Post date: [March 1, 2021, 4:31am UTC](https://meta.discourse.org/t/push-notifications-without-using-allowed-user-api-push-urls/181233/5 "2021-03-01T04:31:35Z")

</div>

so, i just want to be clear @Falco . is there no way i can implement push notifications (by the means of user-api-key) without adding urls in the `allowed_user_api_push_urls` section of the admin account? if there is please let me know.
