Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Looking for working example. Most of the Kumulous Examples are only for the API Need Push example

Im trying to use Kumulos to send push notification only. This is what I was using in parse:
Public Function SendPushNotification(ByVal notification As NotificationDto) As String Implements IPushNotificationProvider.SendPushNotification

    Dim message As String = String.Format("{0}{1}{2}", notification.Title, Environment.NewLine, notification.Message)

    'This method sends one request per browser to notify. This is because inside Data we need to send the Browser to open the notification in.
    For Each deviceBrowser As Integer In notification.Target.Select(Function(x) x.DeviceBrowserId).Distinct()
            'Create ParsePush object and assign Query (filter) and Data to send
            'Dim installationIds As List(Of String) = devicesToNotify.Where(Function(x) x.deviceBrowserId = deviceBrowser).Select(Function(x) x.deviceId).ToList()

            Dim installationIds As List(Of String) = notification.Target.Where(Function(x) x.DeviceBrowserId = deviceBrowser And x.DeviceTypeId = Constants.DeviceType.Ios).Select(Function(x) x.DeviceId).ToList()
            Dim pushQuery As ParseQuery(Of ParseInstallation)
            pushQuery = ParseInstallation.Query.WhereEqualTo("deviceType", "ios").WhereContainedIn("installationId", installationIds)
            Dim objParsePush As New ParsePush()
            objParsePush.Data = New Dictionary(Of String, Object) From
                        {"badge", "Increment"},
                        {"alert", message},
                        {"url", notification.Url},
                        {"browser", deviceBrowser},
                        {"sound", "default"}
            objParsePush.Query = pushQuery
        Catch ex As Exception
            Diagnostics.Debug.WriteLine("Something went wrong when trying to send Push Notification to Parse")
        End Try
Sign In or Register to comment.