private async void SosCommandMethod()
{
var localsettings = ApplicationData.Current.LocalSettings;
if (localsettings.Values.ContainsKey("MessageToSend"))
{
Message = localsettings.Values["MessageToSend"] as string;
}
else
{
Message = "Help Me at";
}
await LocationAccesser();
await TwitterPoster();
// await FacebookPoster();
if (!ApiInformation.IsTypePresent("Windows.Phone.UI.Input.HardwareButtons"))
return;
/*Message Sending Methods */
if (!ApplicationData.Current.LocalSettings.Values.ContainsKey("FirstContactNumber"))
{
SosPageText += "\n No First Contact Assigned! \n Checking other entries";
RaisePropertyChanged(() => SosPageText);
}
else
{
_phonenumber = ApplicationData.Current.LocalSettings.Values["FirstContactNumber"] as string;
MessageSender(_phonenumber);
}
if (!ApplicationData.Current.LocalSettings.Values.ContainsKey("SecondContactNumber"))
{
SosPageText += "\n No Second Contact Assigned! \n Checking other entries";
RaisePropertyChanged(() => SosPageText);
}
else
{
_phonenumber = ApplicationData.Current.LocalSettings.Values["SecondContactNumber"] as string;
MessageSender(_phonenumber);
}
if (!ApplicationData.Current.LocalSettings.Values.ContainsKey("ThirdContactNumber"))
{
SosPageText += "\n No Third Contact Assigned! \n Checking other entries \n";
RaisePropertyChanged(() => SosPageText);
}
else
{
_phonenumber = ApplicationData.Current.LocalSettings.Values["ThirdContactNumber"] as string;
MessageSender(_phonenumber);
}
Caller();
}