We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
we are sending notifications and the response.Recipients is always = 0, but we have few active devices that receive them.
this is my code (using asp.net mvc) if (ModelState.IsValid) { // prepara record PushNotification push = new PushNotification { Note = pushvm.Note, Title = pushvm.Title, Language = (int)pushvm.Language, UCode = StringUtils.CleanString(MAGNETICA.Utils.Funzioni.GenerateHashMD5(MAGNETICA.Utils.Funzioni.CreateUnixTime())), InsDate = DateTime.Now, InsUser = User.Identity.Name, Sent = false }; //invio push OneSignalApi.Client.Configuration config = new OneSignalApi.Client.Configuration(); config.BasePath = "https://onesignal.com/api/v1"; config.AccessToken = ConfigurationManager.AppSettings["OneSignalRestAPIKey"]; var apiInstance = new DefaultApi(config); StringMap headings; StringMap content; string segment; if (pushvm.Language == PushLanguage.Italian) { headings = new StringMap(it: pushvm.Title, en: pushvm.Title); content = new StringMap(it: pushvm.Note, en: pushvm.Note); segment = "Lang-it"; } else { headings = new StringMap(en: pushvm.Title); content = new StringMap(en: pushvm.Note); segment = "Lang-end"; } var notification = new Notification(appId: ConfigurationManager.AppSettings["OneSignalAppID"]) { SmallIcon = ConfigurationManager.AppSettings["BaseUrl"] + "/Content/Media/logos/AppIcon.png", IncludedSegments = new List<string> { segment }, Headings = headings, Contents = content, }; // Notification | try { // Create notification CreateNotificationSuccessResponse result = await apiInstance.CreateNotificationAsync(notification); push.Sent = true; push.SendDate = DateTime.Now; push.Recipients = result.Recipients; } catch (ApiException e) { //Debug.Print("Exception when calling DefaultApi.CreateNotification: " + e.Message); //Debug.Print("Status Code: " + e.ErrorCode); //Debug.Print(e.StackTrace); } _moDb.PushNotifications.Add(push); _moDb.SaveChanges(); return RedirectToAction("Index"); } return View(pushvm);
receive the number of recipients
No response
The text was updated successfully, but these errors were encountered:
No branches or pull requests
What happened?
we are sending notifications and the response.Recipients is always = 0, but we have few active devices that receive them.
Steps to reproduce?
What did you expect to happen?
receive the number of recipients
Relevant log output
No response
Code of Conduct
The text was updated successfully, but these errors were encountered: