Search code examples
notificationsxamarinpushsharp

Xamarin Forms and PushSharp


I am developing a Xamarin Forms project which targets iOS and Android. Because I want to have push notifications, I came across PushSharp. In this video (around 25 - 30 min): https://www.youtube.com/watch?v=m2txoLvosVw, the developer have a iOS project and a PushSharpServer project where he sends a notification to a certain deviceToken.

In my project I have the application which talks to a database with Google App Engine. If a user registers a new post in my application and it gets registered in the database, what will be the best way to send out notifications to some users that a new post is available? Should the database send back a list of all the devicetokens that will get the notifications and then the notifications will be sent from the PushSharpServer-project in my application? Im a little confused about how this workflow should be so I was hoping someone could throw a little light on this subject :)


Solution

  • You can develop a PushSharp server app of whatever it is; console,windows service,desktop application..etc

    There are many ways on how you want the app to send notifications,one of the basic ways is as follows:

    1. Once a new post inserted, add a new record into a notification table in your database
    2. PushSharp server app must periodically check notification table for any new records,then fetch device tokens from your database then start sending notifications using PushSharp library
    3. Delete the record from notification table