ibm-bluemix-mobile-services / bms-clientsdk-cordova-plugin-push

Cordova Push notifications Plugin for IBM Cloud Mobile Services
Apache License 2.0
9 stars 9 forks source link

unable to send push notifications through bluemix console #70

Open vasuvuggu opened 7 years ago

vasuvuggu commented 7 years ago

Hi All, I have followed the following references for notifications w.r.t. android, https://github.com/ibm-bluemix-mobile-services/bms-samples-cordova-hellopush 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)i have subscribedto topic, i am unable to send notifications to subscribed tags from bluemix,i have subscribed to tag in cordova angular js app & even from bluemix console side as well.

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

AnanthaKrish commented 7 years ago

@vasuvuggu Can I see your JS file please ?

vasuvuggu commented 7 years ago

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;

});

zamrokk commented 6 years ago

I confirm same problem, it is working via Firebase but notifications sent via the bluemix console are not sent

AnanthaKrish commented 6 years ago

@zamrokk Please share your JS file. There might some configuration issue

  1. Are you configuring push properly in push service configurations page ?
  2. Is the googleservices.json with both your app bundle ID and push sdk bundle id ?
zamrokk commented 6 years ago

@AnanthaKrish one of my colleague is opening a ticket for it. He is in charge of the development. Do you need his IBM email to see directly with him ?