示例#1
0
        public static string PushNotif(string notificationID, string title, string message, string branchID, List <String> blEmployeeStrList)
        {
            Core.Model.mdlPush         mdlPush  = new Core.Model.mdlPush();
            Core.Model.mdlNotification mdlNotif = new Core.Model.mdlNotification();
            mdlNotif.title = title;
            mdlNotif.body  = message;

            Core.Model.mdlData mdlData = new Core.Model.mdlData();
            mdlData.title          = title;
            mdlData.msg            = message;
            mdlData.notificationid = notificationID;
            List <string> androidkeyList = new List <string>();

            androidkeyList = PushNotificationFacade.GetAndroidKeyByBranchIDAndEmployeeID(branchID, blEmployeeStrList);


            mdlPush.registration_ids = androidkeyList;

            mdlPush.priority          = "high";
            mdlPush.delay_while_idle  = false;
            mdlPush.content_available = true;

            //mdlPush.notification = mdlNotif;

            mdlPush.data = mdlData;

            string json = JsonConvert.SerializeObject(mdlPush);

            string apikey = "AIzaSyCMje7hG5mWLNIqxPLrFHTfuQ_pIJP-0wE";

            string res = Core.Manager.PushNotificationFacade.SendNotif(apikey, json);

            return(res);
        }
示例#2
0
 public static Model.mdlResult PushNotificationConfirmation(Core.Model.mdlPushNotificationConfirmationParam param)
 {
     return(PushNotificationFacade.PushNotificationConfirmation(param));
 }