# Indie Push Notifications

This guide covers how to send customized push notifications to individual users. We call these notifications "Indie" push notifications.

This video walks through the setup guide below:

[YouTube video player](https://www.youtube.com/embed/4-DCqfAnnFU?rel=0)

## Indie Push Notifications Preview:

Here's how our Indie Push Notification system works:

- **Registration:** Register a unique identifier for each app user you want to send Indie Push Notifications to.
- **Use**: Use the unique identifiers you registered to send Indie Push Notifications using our API.

## Prerequisites

1. **Create a free Native Notify account**

   Create a free [NativeNotify.com](https://app.nativenotify.com/sign-up-one)
   account to get your Native Notify App ID and App Token.

## Registration setup:

1. **Imports**

   In your login component, include these imports:

   ```bash
   import { registerIndieID, unregisterIndieDevice } from 'native-notify';
   ```

2. **Check for Hook function**

   Make sure you are using a Hook function in the component you plan to register your users in. Here is an example:

   ```bash
   export default function LoginScreen() {
       ...
   }
   ```

   This link explains Hooks in detail: [https://react.dev/reference/react/hooks](https://react.dev/reference/react/hooks)

3. **Register Unique Identifier**

   Use this code to register your individual user with Native Notify (when your user logs in, for example):

   ```bash
   registerIndieID('unique-user-id-string', app-id-number, 'app-token-string');
   ```

   > **Character limit:**
   >
   > A `sub_id` can be at most **256 characters** — that is the server-side limit, so keep your unique user ids short (a database id or UUID is plenty).

4. **Unregister Unique Identifier**

   Use this code to unregister your individual user from Native Notify (when you user logs out, for example):

   ```bash
   unregisterIndieDevice('unique-user-id-string', app-id-number, 'app-token-string');
   ```
