2
votes

After reverting from windows phone 8.0 to windows phone 8.1, the save contact task no longer exists. All documentation on the internet state that now

You don't have write access to the primary contact store on Windows Phone 8.1, but you have the ability to create your own contact store.

this link on msdn clearly shows how can I add contacts implicitly to my contact store.

What's strange is that WhatsApp and Telegram both allow me to create a contact and choose the account type of it (outlook, ..) and on windows phone 8.1 !

Can anyone explain this?

2
which type of windows phone 8.1 apps are you working on? That link is only for the silverlight version the win rt version of the phone project is differentKen Tucker
its a win RT app. Do you mean that the current whatsapp and telegram apps are Silverlight ? Can we in Silverlight achieve what I'm trying to do?Nada Naoushi

2 Answers

1
votes

If you're working with wp rt, your question is a duplicate of this question. In that case, you have to create your own contact store for the app you're working on (code copied from the linked question's answer):

using Windows.Phone.PersonalInformation;

public async void addPerson() {
var store = await ContactStore.CreateOrOpenAsync();

var contact = new StoredContact(store) {
    DisplayName = "Mike Peterson"
};
var props = await contact.GetPropertiesAsync();
props.add(KnownContactProperties.Email, "[email protected]");
props.add(KnownContactProperties.MobileTelephone, "+1 212 555 1234");

await contact.SaveAsync();
}

In order for your app's contacts to appear in "People", each user needs to change the filter settings of their People-App accordingly.

0
votes

Yes, I did similar things myself. The reason being the upgrade to windowsphone 8.1 brought restrictions on many apis which were released on windowsphone 8.0 like access to alarms, easy phone manager tasks were all changed because they were migrated from Silverlight to a new runtime. So if you'd still like to get accept to all those classes of Windowsphone 8.0 the trick is that is you first target your app to windowsphone 8.0 OS where you get access to all the classes. And then right clicking on the package explorer do a Windowsphone 8.1 Silverlight OS update. In that sense your app gets upgraded to windowsphone 8.1 while it still retains an intermediate namespace of windowsphone 8.0 allowing you to access all classes based for the old silverlight based OS.