# In app notification clarification

**URL:** https://community.fliplet.com/t/in-app-notification-clarification/423
**Category:** Get Help
**Tags:** in-app, data-source, notifications
**Created:** [September 5, 2022, 8:32pm UTC](https://community.fliplet.com/t/in-app-notification-clarification/423 "2022-09-05T20:32:49Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![thekellisfam](https://dub1.discourse-cdn.com/flex017/user_avatar/community.fliplet.com/thekellisfam/32/263_2.png) [@thekellisfam](https://community.fliplet.com/u/thekellisfam)
#### Post date: [September 5, 2022, 8:32pm UTC](https://community.fliplet.com/t/in-app-notification-clarification/423/1 "2022-09-05T20:32:49Z")

</div>

Hello,

I have the Data source hook set to send a push notification. I have added this code to the settings section of the data source, under “data source hook” and it works perfectly!

```auto
[
  {
    "type": "push",
    "appId": 12569,
    "runOn": [
      "insert"
    ],
    "payload": {
      "body": "{{{Body}}}",
      "title": "{{{Title}}}",
      "custom": {
        "customData": {
          "page": 381770,
          "action": "screen"
        }
      }
    }
  },
  {
    "type": "operations",
    "runOn": [
      "beforeSave",
      "beforeQuery"
    ],
    "payload": {},
    "widgetInstanceId": 4430921
  }
]

```

The page ID it is currently set to is a custom made list from data source, not the “in app” notifications screen. (This was a temporary solution)

Now I need to add the “In app” notification to it - is this the same place I would add coding for “In app” notifications? (Data source hook section)

What is needed to send “in app” notifications as well, and where would I put that coding?  
Thank you

---

<div class="post-metadata">

### Author: ![Deb](https://dub1.discourse-cdn.com/flex017/user_avatar/community.fliplet.com/deb/32/159_2.png) [@Deb](https://community.fliplet.com/u/Deb)
#### Post date: [September 6, 2022, 8:27am UTC](https://community.fliplet.com/t/in-app-notification-clarification/423/2 "2022-09-06T08:27:24Z")

</div>

Hi Chase,

Unfortunately our DS hook system cannot send in-app notifications. It can only send push notifications. If you want to send an in app notification then you will need to add custom code. It depends on which user action triggers a notification for example submitting a form. Then you will need to use a form submit hook to trigger a notification. Here is an example:

```auto
Fliplet.Hooks.on("afterFormSubmit", function (response) {
  var instance = Fliplet.Notifications.init({});
  instance.insert({
    status: "published",
    data: {
     //Change title and message below if you want to access the form fields 
      title: "Greetings",
      message: "Hi John!",
      navigate: {
        action: "screen",
        page: 123,
        query: "?weather=sunny",
      },
    },
  });
});

```

Hope this helps,  
Deb

---

<div class="post-metadata">

### Author: ![thekellisfam](https://dub1.discourse-cdn.com/flex017/user_avatar/community.fliplet.com/thekellisfam/32/263_2.png) [@thekellisfam](https://community.fliplet.com/u/thekellisfam)
#### Post date: [September 6, 2022, 8:44am UTC](https://community.fliplet.com/t/in-app-notification-clarification/423/3 "2022-09-06T08:44:31Z")

</div>

It makes perfect sense  
YOU got it to work!

How can I pull from the form?

From column is called Title and Body to make it easy

---

<div class="post-metadata">

### Author: ![Deb](https://dub1.discourse-cdn.com/flex017/user_avatar/community.fliplet.com/deb/32/159_2.png) [@Deb](https://community.fliplet.com/u/Deb)
#### Post date: [September 6, 2022, 8:59am UTC](https://community.fliplet.com/t/in-app-notification-clarification/423/4 "2022-09-06T08:59:41Z")

</div>

Hi Chase,

You can use something like this:

```auto
Fliplet.Hooks.on("afterFormSubmit", function (response) {
  var instance = Fliplet.Notifications.init({});
  instance.insert({
    status: "published",
    data: {
     //Change title and message below if you want to access the form fields 
      title: response.result.data.Title,
      message: response.result.data.Body,
      navigate: {
        action: "screen",
        page: 123,
        query: "?weather=sunny",
      },
    },
  });
});

```

---

<div class="post-metadata">

### Author: ![thekellisfam](https://dub1.discourse-cdn.com/flex017/user_avatar/community.fliplet.com/thekellisfam/32/263_2.png) [@thekellisfam](https://community.fliplet.com/u/thekellisfam)
#### Post date: [September 6, 2022, 9:12am UTC](https://community.fliplet.com/t/in-app-notification-clarification/423/5 "2022-09-06T09:12:18Z")

</div>

Thank you! Works perfectly!

---

<div class="post-metadata">

### Author: ![thekellisfam](https://dub1.discourse-cdn.com/flex017/user_avatar/community.fliplet.com/thekellisfam/32/263_2.png) [@thekellisfam](https://community.fliplet.com/u/thekellisfam)
#### Post date: [September 8, 2022, 4:31am UTC](https://community.fliplet.com/t/in-app-notification-clarification/423/6 "2022-09-08T04:31:35Z")

</div>

Hello, I have run the same coding on another app of mine.

1. I used the correct App ID for the data hook (this was for the Push notification portion) - This worked perfectly on my published app.

2. I used the coding above for the “In-App” notification - but it didn’t work.  
Double-checked to see if everything was Identical.

I was thinking - A while back when I made the app, I remember publishing the app but also getting some sort of certificate for that app to allow notifications.

My question is, is there a certification process I need to do to allow in-app notifications?  
Through apple or through google?

Just trying to figure out why it works on one app but not another. Thank you!
