when i use this code in webform or MVC system keep hangs and stay in this line of code :
AppleRegistrationDescription vb =
await hubClient.CreateAppleNativeRegistrationAsync(token, new string[] { tag });
but in Console works fine
this is my code
static async Task<AppleRegistrationDescription> appleregister(string tag, string token)
{
var hubClient = NotificationHubClient.CreateClientFromConnectionString("Endpoint=sb://ipluzservicehub.servicebus.windows.net/;SharedAccessKeyName=DefaultFullSharedAccessSignature;SharedAccessKey=o9DAUFuT1n9AyHfuc8REkwo0W/65WAw1SSG+fNJ/xqg=", "taylors");
AppleRegistrationDescription vb = await hubClient.CreateAppleNativeRegistrationAsync(token, new string[] { tag });
return vb;
}
public ActionResult Index()
{
try
{
Task<AppleRegistrationDescription> t = appleregister("MYTag", "19606e2xxxxxxxxxxxxxxxxxx");
var list = t.Result;
var id = list.RegistrationId;
}
catch
{
}
return View();
}
can any one help me please