# Personalized Push Notification

### <mark style="color:green;">What is Personalized Push Notification?</mark>

Personalized push notifications are notifications that are sent to a specific user, rather than a general audience. It can be sent to specific users for various reasons, including:

* Event alerts, such as when a message is received or a package is delivered
* Re-engaging users based on their previous app activity
* Promotions tailored to a user's product preferences.

### <mark style="color:green;">Prerequisites</mark>

* You must have enabled Firebase Push Notification support for your app.

### <mark style="color:green;">How to setup Personalized Push Notification?</mark>

**1.)** Go to Add-ons --> Integrations --> Personalized Push Notification & Enable it.

<mark style="color:red;">**NOTE:**</mark> <mark style="color:red;">Please create a new version of the App e.x. 1.0.2, if the current version does not support this feature. If the previous version is live on the stores, then request a new build and submit this new version to the stores.</mark>

**2.)** Enter **Webhook URL**

This Webhook URL is where we will be sending you **Device Token** of the user who is using your app. Your URL must accept POST request and we will be submitting following information with the POST request.

```json
{
      'token': 'DEVICE_TOKEN of the user',
      'email_address': 'EMAIL_ADDRESS or USERNAME of the user.',
      'platform': 'android or ios'
}
```

* **token -** Device token of the user who is using your app.
* **email\_address -** If you have login feature enabled in your app, then we will send an email address as well if user is logged in. This will help you to exactly apply device token to specific user.
* **platform -** We will also provide you platform information. Platform value can be either `android` or `iOS`.

Your webhook must accept request JSON in this format.

**3.)** Save as a draft.

### <mark style="color:green;">Fetch Device Token using JS Bridge (Optional)</mark>

Use this method if you want to directly fetch push notification device token using JS function. You can call below function anywhere in your website to fetch the token.

```javascript
twinr_push_token_fetch();
```

As soon as you call this method, it will return following response if your application user has push notification enabled in their device.

```
{
      'token': 'DEVICE_TOKEN of the user's device',
      'platform': 'android or ios'
}
```

### <mark style="color:green;">Benefits of Sending Personalized Push Notifications</mark>

1. Increased engagement: Personalized push notifications can increase the level of engagement and interest from customers, leading to higher click-through rates and conversions.
2. Better targeting: Personalized push notifications allow businesses to target specific segments of their customer base, increasing the chances of conversion and reducing the chance of annoying customers with irrelevant messages.
3. Improved customer retention: Personalized push notifications can improve customer retention by providing a more personalized experience, building trust and loyalty.
4. Increased revenue: Personalized push notifications can lead to increased revenue by promoting relevant products and services to specific customers, leading to more purchases.
5. Cost-effective: Personalized push notifications are cost-effective as compared to other forms of marketing such as email marketing, PPC campaigns, and SMS marketing. They can be sent in real-time and can be highly targeted to specific customers, resulting in a higher ROI.

### <mark style="color:green;">Common Questions</mark>

<details>

<summary>Which programming language should I use to build my webhook?</summary>

You can use any programming language you want. There is not restriction on which programming language you can use.

</details>

<details>

<summary>Can I use 3rd party tool such as Zapier or Integrately to build my Webhook?</summary>

Yes, you can use such tools to prepare your webhook. It must be POST webhook and shouldn't require any extra authentication.

</details>
