I'm creating an expo sender application which is web based, but I have a problem compiling the project. It keeps me saying
"Type or namespace definition, or end-of-file expected"
My code looks like this and I've got it from here
using MobileServices.Client;
using MobileServices.Models;
using System;
using System.Collections.Generic;
using System.Linq;
var expoSDKClient = new PushApiClient();
var pushTicketReq = new PushTicketRequest()
{
PushTo = new List<string>() { "..." },
PushBadgeCount = 7,
PushBody = ""
};
var result = expoSDKClient.PushSendAsync(pushTicketReq).GetAwaiter().GetResult();
if (result?.PushTicketErrors?.Count() > 0)
{
foreach (var error in result.PushTicketErrors)
{
Console.WriteLine($"Error: {error.ErrorCode} - {error.ErrorMessage}");
}
}
var pushReceiptResult = expoSDKClient.PushGetReceiptsAsync(pushReceiptReq).GetAwaiter().GetResult();
if (pushReceiptResult?.ErrorInformations?.Count() > 0)
{
foreach (var error in result.ErrorInformations)
{
Console.WriteLine($"Error: {error.ErrorCode} - {error.ErrorMessage}");
}
}
foreach (var pushReceipt in pushReceiptResult.PushTicketReceipts)
{
Console.WriteLine($"TicketId & Delivery Status: {pushReceipt.Key} {pushReceipt.Value.DeliveryStatus} {pushReceipt.Value.DeliveryMessage}");
}
This is my first C# application that I'm building and I have searched the error but with no result. Can you please help me how to solve this. I know that is something simple but I really need help because I'm stuck.