Hi All,
Hope you are doing well. Today I am going to tell you how we can use Push Notification on any post like or we can say comment like for Android as well as IOS Device.
First we will create a controller function from where we can trigger notification after any event.
Create Controller API function Post_like().
Step 1.
Hope you are doing well. Today I am going to tell you how we can use Push Notification on any post like or we can say comment like for Android as well as IOS Device.
First we will create a controller function from where we can trigger notification after any event.
Create Controller API function Post_like().
Step 1.
Step 2:
This is post like Api. Expected Parameters are post_id and user_id. using post_id and user_is user can check in the database that this post is like or not like . if found like then it returns dislike and vice versa.
No we will create a push notification api for that we will create new model that is called push_model.
here will define 2 function .
1. send_push_notification
2.send_notification
How you will find the solution. In fisrt function we are passing 5 parameters.user_id,title,message,id,action.
On the basis of this you can find that where and whom you want to send push notification.
In the last line of this function we are redirecting to another function here we have define that how to use curl and finally send notification using fire base.