events refactoring
This commit is contained in:
parent
4475dca3fa
commit
d11fed8d32
13 changed files with 98 additions and 89 deletions
|
|
@ -8,6 +8,6 @@ namespace Yavsc.Services
|
|||
{
|
||||
public interface IGoogleCloudMessageSender
|
||||
{
|
||||
Task<MessageWithPayloadResponse> NotifyAsync(GoogleAuthSettings googlesettings, IEnumerable<string> registrationId, YaEvent ev);
|
||||
Task<MessageWithPayloadResponse> NotifyBookQueryAsync(GoogleAuthSettings googlesettings, IEnumerable<string> registrationId, BookQueryEvent ev);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -28,11 +28,11 @@ namespace Yavsc.Services
|
|||
/// <c>bool somethingsent = (response.failure == 0 && response.success > 0)</c>
|
||||
/// </returns>
|
||||
public async Task<MessageWithPayloadResponse>
|
||||
NotifyAsync(GoogleAuthSettings googleSettings, IEnumerable<string> registrationIds, YaEvent ev)
|
||||
NotifyBookQueryAsync(GoogleAuthSettings googleSettings, IEnumerable<string> registrationIds, BookQueryEvent ev)
|
||||
{
|
||||
MessageWithPayloadResponse response = null;
|
||||
await Task.Run(()=>{
|
||||
response = googleSettings.NotifyEvent(registrationIds, ev);
|
||||
response = googleSettings.NotifyEvent<BookQueryEvent>(registrationIds, ev);
|
||||
});
|
||||
return response;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue