unable to send push notifications via the bluemix console

advertisements

I have followed the following references for notifications w.r.t. android,

https://github.com/ibm-bluemix-mobile-services/bms-samples-cordova-hellopush emphasized text https://github.com/ibm-bluemix-mobile-services/bms-clientsdk-cordova-plugin-push

different scenarios not working, are listed out here, 1)through bluemix console when ever i just send notifications to device, it shows "notification sent for delivery" in the bluemix console. but after sometime also i am not getting notifications in the mobile device.

i have configured bluemix w.r.t. firbease messaging & so i am able to send notifications from console.firebase.com, & paralley i am retrieving notifications in device too.

2)during device registration time, success response callback i am not getting, even though when app, is in background i am able to get notifications in device.

3)i am trying to subscribe to topic, here i am not getting any response back to device, either i am unable to send notifications to subscribed tags from bluemix, since bluemix shows tags are not subscribed. i have subscribed to tag in cordova angular js app here.

let me know if anybody have any suggestions on these queries. thanks.


plz find js file here,

var ocMobile=angular.module("ocMobile",[]);
ocMobile.factory("ocMobileFactory",function(/*global parameters */){
var ocMobileFactory={
initialize: function() {
this.bindEvents();
growl.info("B4 initialize");
// some codebase
},
bindEvents: function() {
document.addEventListener('deviceready', this.onDeviceReady, false);
document.addEventListener('offline', this.onOffline, false);
document.addEventListener('resume', this.onResume, false);
},
onOffline: function() {
// somecodebase
},
onResume: function() {
// some codebase
},
onDeviceReady: function() {
console.log("omnichannel onDeviceReady");
growl.info("onDeviceReady");
this.registerNotifications();
},
registerNotifications: function() {
growl.info("registerNotifications");
BMSClient.initialize(BMSClient.REGION_US_SOUTH);
// iOS Actionable notification options. Eg : {"category_Name":[{"identifier_name_1":"action_Name_1"},{"identifier_name_2":"action_Name_2"}]}
// Pass empty for Android
var category = {};
//device returns platform , deviceid etc., parameters
if (device.platform.toLowerCase() === "ios"){
category = {"category_Name":[{"identifier_name_1":"action_Name_1"},{"identifier_name_2":"action_Name_2"}]};
}
growl.info("registerNotifications: category:"+category);
BMSPush.initialize(appGuid parameter, clientSecret parameter, category);
var success = function(successResponse) {
// success handler display successresponse msg with token...
//TODO once successcallback register for topic subscriptions & test it
var successTag = function(successResponse) {
console.log("topic subscribed response:"+successResponse);
growl.info("topic subscribed response:"+successResponse);
};
var failureTag = function(failureResponse) {
console.log("topic subscription failed due to :"+failureResponse);
growl.info("topic subscription failed due to :"+failureResponse);
};
var tag = "YourTag";
BMSPush.subscribe(tag, successTag, failureTag);

        };
        var failure = function(failureResponse) {
        //failure handler display failure reason with failureresponse
        };
        var options = {"userId": "Your User Id value"};
        BMSPush.registerDevice(options, success, failure);

        var handleNotificationCallback = function(notification) {
            alert(notification.message);
        }
        BMSPush.registerNotificationsCallback(handleNotificationCallback);
    }
}
return ocMobileFactory;
});

let me know if anybody have any suggestions on these queries. thanks.