An error occurred creating push for user scripts: azure.notificationHubService could not be created -
in azure mobile service javascript backend ,trying send notification calling notification hub through custom api. giving me notification , everytime giving time out error too. observed logs , showing "an error occurred creating push user scripts: azure.notificationhubservice not created" .
instead of using azure.createnotificationhubservice method , there way import created notification hub service ?how rid of time out error. pasting function below.
function sendnotification() { var azure = require('azure'); var notificationhubservice = azure.createnotificationhubservice('disapphub','endpoint=sb://xxx.servicebus.windows.net/;sharedaccesskeyname=defaultfullsharedaccesssignature;sharedaccesskey=my_key_here=;'); var payload = { data: { "type":"newthread", } }; var mytags ='admin'; notificationhubservice.gcm.send(mytags, payload, function(error){ if(!error){ //notification sent } }); }
Comments
Post a Comment