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!
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:
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",
},
},
});
});
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",
},
},
});
});
Hello, I have run the same coding on another app of mine.
I used the correct App ID for the data hook (this was for the Push notification portion) - This worked perfectly on my published app.
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!