[Bug]: Méthode introuvable : 'Void RestSharp.RestRequest..ctor(RestSharp.Method)'. #45
Open
1 task done
Labels
bug
Something isn't working
What happened?
Good morning ,
I'm trying OneSignal's server-side API to send push notifications.
When I execute the method CreateNotificationSuccessResponse result = appInstance.CreateNotification(notification);
var appConfig = new Configuration();
appConfig.BasePath = "https://onesignal.com/api/v1";
appConfig.AccessToken = "ApiKey";
var appInstance = new DefaultApi(appConfig);
var notification = new Notification(appId: "app id");
StringMap stringMap = new StringMap();
stringMap.En = message;
notification.Contents = stringMap;
notification.ExternalId = Guid.NewGuid().ToString();
if (!string.IsNullOrWhiteSpace(link))
{
notification.Url = link;
}
if (Subcription.Count > 0)
{
notification.IncludedSegments = Subcription;
}
if (ExternalID.Count > 0)
{
PlayerNotificationTargetIncludeAliases playerNotificationTargetIncludeAliases = new PlayerNotificationTargetIncludeAliases(ExternalID);
notification.IncludeAliases = playerNotificationTargetIncludeAliases;
}
try
{
// Create notification
CreateNotificationSuccessResponse result = appInstance.CreateNotification(notification);
return result.Id + " --- "+result.Recipients.ToString();
}
catch (ApiException e)
{
Debug.Print("Exception when calling DefaultApi.CreateNotification: " + e.Message);
Debug.Print("Status Code: " + e.ErrorCode);
Debug.Print(e.StackTrace);
return "Exception when calling DefaultApi.CreateNotification: " + e.Message;
}
I have this error Method not found: 'Void RestSharp.RestRequest..ctor(RestSharp.Method)'.
Steps to reproduce?
What did you expect to happen?
à OneSignalApi.Client.ApiClient.NewRequest(HttpMethod method, String path, RequestOptions options, IReadableConfiguration configuration)
à OneSignalApi.Client.ApiClient.Post[T](String path, RequestOptions options, IReadableConfiguration configuration)
à OneSignalApi.Api.DefaultApi.CreateNotificationWithHttpInfo(Notification notification, Int32 operationIndex)
à OneSignalApi.Api.DefaultApi.CreateNotification(Notification notification, Int32 operationIndex)
à WebAPI.Helper.Utils.SendNotification(String message, List
1 Subcription, List
1 ExternalID, String link) dans D:\WORK\APPLICATION\CNPS\MA CNPS A MOI\AppMobile\WEP API\WebAPI\Helper\Utils.cs :ligne 967à WebAPI.Controllers.CallBackAPIController.testsss() dans D:\WORK\APPLICATION\CNPS\MA CNPS A MOI\AppMobile\WEP API\WebAPI\Controllers\CallBackAPIController.cs :ligne 3079
Relevant log output
No response
Code of Conduct
The text was updated successfully, but these errors were encountered: