Hello, I am trying to develop a mobile app for our local school which has two different courses avalaible English language course and German lang. course. What I want to do is when I send push notification for example regarding to English course app users to filter the notifications for them only and the same for german. But how I can implement it, based on which criteria to create filter to send notifications to the desired group of users (eg. English students)..

I am using lastest version of Cordova to build the app for android and I have simple implementation of Pushwoosh service to my app <body onload="init()"> as it is in the official sample.

UPDATE #2 New problem Can you help me out, I'm trying to integrate pushwoosh to my app but I don't know why the app is not registering the devices. I verified the credentials and required things but it doesn't work out. Can it be because I have another onready function to my app? At the test app ondeviceready was the pushwoosh function only and it worked out.

This is my whole code at scripts.js

 //Pushwoosh integration
    function init() {
       document.addEventListener("deviceready", initPushwoosh, true);

        //rest of the code
    }

    function initPushwoosh()
    {
        var pushNotification = window.plugins.pushNotification;

        //set push notifications handler
        document.addEventListener('push-notification', function(event) {
            var title = event.notification.title;
            var userData = event.notification.userdata;

            if(typeof(userData) != "undefined") {
                console.warn('user data: ' + JSON.stringify(userData));
            }

            alert(title);
        });

        //initialize Pushwoosh with projectid: "GOOGLE_PROJECT_NUMBER", appid : "PUSHWOOSH_APP_ID". This will trigger all pending push notifications on start.
        pushNotification.onDeviceReady({ projectid: "597994945278", appid : "BFF01-95906" });

        //register for pushes
        pushNotification.registerDevice(
            function(status) {
                var pushToken = status;
                console.warn('push token: ' + pushToken);
            },
            function(status) {
                console.warn(JSON.stringify(['failed to register ', status]));
            }
        );
    }

    //DergoMesazh
    function onSuccess(data, status)
            {
                data = $.trim(data);
                $("#notification").text(data);
            }

            function onError(data, status)
            {
                // handle an error
            }

            $(document).ready(function() {
                $("#submit").click(function(){

                    var formData = $("#callAjaxForm").serialize();

                    $.ajax({
                        type: "POST",
                        url: "http://radio-pendimi.com/mobile/v2/send.php",
                        crossDomain:true,
                        cache: false,
                        data: formData,
                        success: onSuccess,
                        error: onError
                    });
                    return false;
                });
                $("#reset").click(function() {
                    $('#callAjaxForm').trigger("reset");
                    $('#notification').text("");
                });
            });

I load init function with <body onload="init();">

asked 30 Jan '15, 16:52
albpower's gravatar image

albpower
113

edited 02 Feb '15, 15:49

Hi,

You might want to use Tags feature. You can create your own custom Tag and assign your users with a specific value of this Tag ("En" and "De" for instance). Thus, you will be able to target particular groups of users via Filters.

The same can be done via Remote API.

permanent link
answered 02 Feb '15, 13:57
Benedict's gravatar image

Benedict
7127

Can you see the main post, I have another problem now and I updated it with more information

(02 Feb '15, 15:48) albpower albpower's gravatar image

It might me a good idea to contact Pushwoosh support to sort this out.

(03 Feb '15, 14:47) Benedict Benedict's gravatar image
Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×446
×190
×23

question asked: 30 Jan '15, 16:52

question was seen: 836 times

last updated: 03 Feb '15, 14:47