BMC: Parameter binding issue in SendNotification Method
This commit is contained in:
		
							parent
							
								
									7e4fd047f2
								
							
						
					
					
						commit
						84cb9d4251
					
				| @ -78,19 +78,33 @@ namespace BCS.BMC.Web.Controllers | |||||||
|                 data.Status= notification.Status; |                 data.Status= notification.Status; | ||||||
|                 data.UserId = notification.UserId; |                 data.UserId = notification.UserId; | ||||||
|                 await db.Collection("BMC_Notification").Document().SetAsync(data); |                 await db.Collection("BMC_Notification").Document().SetAsync(data); | ||||||
|                 var getTokenDetails = _firebaseToken.GetAllList().Where(x => x.UserId == notification.UserId).FirstOrDefault(); |                 foreach (var item in notification.Id) | ||||||
|                 List<string> tokenList = new List<string>(); |                 { | ||||||
|                 tokenList.Add(getTokenDetails.FcmToken); |                     int userId = Convert.ToInt32(item); | ||||||
|  |                     var getTokenDetails = _firebaseToken.GetAllList().Where(x => x.UserId == userId).FirstOrDefault();                | ||||||
|  |                     List<string> tokenList = new List<string>(); | ||||||
|  |                     tokenList.Add(getTokenDetails.FcmToken.ToString()); | ||||||
|  |                  | ||||||
| 
 | 
 | ||||||
|                 if (getTokenDetails != null) |                 if (getTokenDetails != null) | ||||||
|                 { |                 { | ||||||
|                     var sendNotificationInfo = new FireBaseResponseModel(); |                         var title = notification.SenderName.ToJsonString(); | ||||||
|                     sendNotificationInfo.FcmToken = tokenList; |                         var body = notification.Message.ToJsonString(); | ||||||
|                     sendNotificationInfo.notification.Title = "Bwac Patrol Monitoring Alert"; |                         var sendNotificationInfo = new FireBaseResponseModel(); | ||||||
|                     sendNotificationInfo.notification.Body = notification.Message; |                         { | ||||||
|                     await SendNotification(sendNotificationInfo); |                             sendNotificationInfo.FcmToken = tokenList; | ||||||
|                 } |                         } | ||||||
| 
 | 
 | ||||||
|  |                         Notification notifications = new Notification | ||||||
|  |                         { | ||||||
|  |                             Title = title, | ||||||
|  |                             Body = body, | ||||||
|  |                             //ImageUrl = null | ||||||
|  |                         }; | ||||||
|  |                         sendNotificationInfo.notification = notifications; | ||||||
|  |                         await SendNotification(sendNotificationInfo); | ||||||
|  |                 } | ||||||
|  |             } | ||||||
| 
 | 
 | ||||||
|                 var entity = new FirebaseCloudMessageDetails(); |                 var entity = new FirebaseCloudMessageDetails(); | ||||||
|                 entity.UserId = notification.UserId; |                 entity.UserId = notification.UserId; | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user