예제 #1
0
        public static void SendNotificationbyUser(string message, int userid, int useridTo, int productid = 0, int Packageid = 0, int type = 0)
        {
            NotificationDal objnotify = new NotificationDal();
            var             userList  = objnotify.GetFcmByUserId(useridTo);

            //  var userList = new DataLayer().GetFcmByUserId(227);
            // var item = "f98Xq4PRiho:APA91bFhbXJen4QadYxH5iOgD31KWl4d9gNzOdwRkT3-n-fbB9RV7Ue0mFXKPiKD3YYCcXVhUtgYrDsRbZsSRdM-ems58s79aSq_ZahKmL4_z7PNXv62TJXqTqSCMb4P9fyGslwj5nWh";
            // var msg = "Your Produtc";
            foreach (var item in userList)
            {
                Notification.SendNotification(item, message, userid, "Product", productid, Packageid, type);
            }
        }
예제 #2
0
        public List <string> GetFcmByUserId(int userId)
        {
            var     fcmList = new List <string>();
            DataSet ds      = _notifidal.GetFcmByUserId(userId);

            if (ds != null && ds.Tables[0] != null)
            {
                if (ds.Tables[0].Rows.Count > 0)
                {
                    for (int i = 0; i < ds.Tables[0].Rows.Count; i++)
                    {
                        fcmList.Add(ds.Tables[0].Rows[i]["FcmId"].ToString());
                    }
                }
            }


            return(fcmList);
        }