Gotify Android Documentation

repository·master·Indexed 23 days ago

https://github.com/gotify/android

Client application for receiving and displaying push notifications from a Gotify server. Includes guides on installation via APK, F-Droid, and Google Play, building from source using Java 17, and configuring battery optimization. Documentation also covers the openapi-java-client library (v2.1.0), authentication using clientToken and appToken, and the Client data model.

Tokens
1.4K
Snippets
4
Records
14
Agent score
81%

What's inside Gotify Android

  1. Understand Gotify Android data collection and privacy

    master

    The Gotify Android app is designed to collect only the data strictly necessary for its operation, such as app settings and image caches. It does not contain advertisement libraries or third-party tracking (analytics) code like Google Analytics.

    Data Sharing with Servers

    To function, the app must connect to a gotify/server. The app will share data with whichever server URL you provide during setup.

    Security Recommendation: For maximum privacy, host your own gotify/server instance so that you maintain exclusive access to your data.

  2. Understand Gotify Message Priorities

    master

    Gotify uses priority levels to determine how notifications are displayed on the Android device. The mapping is as follows:

    Notification TypeGotify Priority Range
    No notification0
    Icon in notification bar1 - 3
    Icon in notification bar + Sound4 - 7
    Icon in notification bar + Sound + Vibration8 - 10
  3. Install the openapi-java-client library

    master

    To use the openapi-java-client in your local development environment, install it to your local Maven repository using the following command:

    mvn install

    If you need to deploy the library to a remote Maven repository, ensure your repository settings are configured and run:

    mvn deploy
  4. Minimize the Gotify foreground notification

    master

    On Android version 8 or higher, you can minimize the foreground notification that shows the connection status to make it less intrusive:

    1. Open Settings -> Apps -> Gotify.
    2. Click Notifications.
    3. Click on Gotify foreground notification.
    4. Toggle the Minimize option, or select a different Behavior or Importance (the exact options depend on your Android version).
    5. Restart Gotify to apply the changes.
  5. Add openapi-java-client to a Maven project

    master

    Once the library is installed or deployed, add it as a dependency to your project's pom.xml file to enable its use.

    <dependency>
        <groupId>org.openapitools</groupId>
        <artifactId>openapi-java-client</artifactId>
        <version>2.1.0</version>
        <scope>compile</scope>
    </dependency>
  6. Disable battery optimization for Gotify

    master

    Android may kill long-running apps to save battery. If battery optimization is enabled for Gotify, the app may be killed, preventing you from receiving notifications. To ensure reliable notifications, disable battery optimization for Gotify:

    1. Open your device Settings.
    2. Search for Battery Optimization.
    3. Find Gotify in the list and disable battery optimization.

    For manufacturer-specific instructions, refer to dontkillmyapp.com.

  7. Authenticate with Gotify using clientToken or appToken

    master

    Gotify uses two distinct types of tokens for authentication:

    1. clientToken: Used by clients that receive messages and manage resources (e.g., an Android app). This token can be used to create new tokens or delete messages.
    2. appToken: Used by applications that only send messages (e.g., a shell script).

    Tokens can be transmitted in any of the following ways:

    • A header named X-Gotify-Key.
    • A query parameter named token.
    • An Authorization header with the value prefixed by Bearer (e.g., Bearer <token>).

    Note: Basic authentication should only be used when creating a clientToken.

  8. Identify what data is shared during debugging or reviews

    master

    The Gotify developers do not have access to your information unless you explicitly share it through the following methods:

    Crash Reports

    If you use the 'Crash Report' function (via email or Android's Google crash reporting), the following data is shared:

    • device type
    • Android version
    • Gotify version
    • Error messages

    Google Play Store Reviews

    If you submit a review on the Google Play store, the following data is shared:

    • public profile information
    • Gotify version
    • device type
    • device language
    • Android version