gotify / android

An app for creating push notifications for new messages posted to gotify/server.
MIT License
913 stars 154 forks source link

Custom android app using Gotify server #363

Closed anushreelimaaye closed 3 weeks ago

anushreelimaaye commented 1 month ago

I want push notifications in custom mobile app. How to include push notification service in android app client? I want to know the process for it.

jmattheis commented 1 month ago

You could copy the https://github.com/gotify/android/blob/master/app/src/main/kotlin/com/github/gotify/service/WebSocketService.kt and use it in your own app. Forwarding notifications from the gotify/android app to another app was discussed here https://github.com/gotify/android/issues/29

anushreelimaaye commented 1 month ago

Thank you for your reply. I want to use Gotify to send push notification to specific user. How to send it to that user if i have more than 1000 users? In FCM, the message has been sent to on the basis of push token. How it would be in case of Gotify?

anushreelimaaye commented 1 month ago
  val url = "$serverUrl/stream".toHttpUrlOrNull()!!
        .newBuilder()
        .addQueryParameter("token", token)
        .build()  Is this correct format to set connection with server?
jmattheis commented 1 month ago

Thank you for your reply. I want to use Gotify to send push notification to specific user. How to send it to that user if i have more than 1000 users? In FCM, the message has been sent to on the basis of push token. How it would be in case of Gotify?

The user has to create an application and then you send a message to this application via the token. Gotify isn't built as a replacement to FCM, so this use-case hasn't great support.

Is this correct format to set connection with server?

Not sure what you mean with this. This is the correct url for the message stream endpoint.