I'm doing a simple try/catch (in a PCL project) to validate the users connection to the app, but I cant seem to find the DisplayAlert() method used in the Xamarin websites example.
Here are my usings:
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Input;
using System.Security;
using System.Diagnostics;
Here is the code:
public async Task Connexion()
{
// on met en place un try catch pour déceler toute erreur dans la procédure de connexion
try
{
// url de récupération du json de l'acteur
string urlActeur = "http://10.0.0.5/ppe3JoJuAd/gsbAppliFraisV2/webservices/w_visiteur.php" + "?" + "login=" + Login + "&" + "pass=" + Pass;
//instanciation du client http qui envoi un header json
HttpClient clientActeur = new HttpClient();
clientActeur.DefaultRequestHeaders.Accept.Clear();
clientActeur.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json"));
//réponse à la requête Http
var response = await clientActeur.GetAsync(urlActeur);
var json = response.Content.ReadAsStringAsync().Result;
var acteurJson = JsonConvert.DeserializeObject<ActeurJson>(json);
//on vérifie les informations de connexion du user (ici cela se ait avec oldMdp car pas d'implémentation du SHA1 actuellement en Xamarin, auquel cas nous auions converti le contenu du champ pass en sha1 puis vérification avec le champ mdp de l'acteur)
if (acteurJson.Acteur.login == login && acteurJson.Acteur.mdp == acteurJson.Acteur.oldMdp)
App.Current.MainPage = new VisitePage();
}
catch
{
await DisplayAlert()//intelisense does not find the using or the required dll
}
where should I look or what should I do to display the message ?