Thank you for being a valued part of the CNET community. As of December 1, 2020, the forums are in read-only format. In early 2021, CNET Forums will no longer be available. We are grateful for the participation and advice you have provided to one another over the years.

Thanks,

CNET Support

Question

How to integrate windows live id login in windows phoneapp?

Nov 19, 2013 4:54PM PST

our windows phone 8 application needs windows live id login and we are using visual studio 2012 for creating its xap file. It is not logging in and found 2 solutions. one is, we can do it with visual studio 2013 and another is, we have to register our app in windows app store. But it is not working still.How this can be done?..pls suggest one good method.

Discussion is locked

- Collapse -
Clarification Request
I see a recent example at link.
Nov 20, 2013 11:30PM PST
- Collapse -
windows live id login in windows phoneapp
Nov 21, 2013 7:02PM PST

Thanks for the reply. But we are trying to implement live id login to our windows store app (html and javascript using phone gap) done in visual studio 2012 as specified in http://msdn.microsoft.com/en-us/library/windows/apps/hh920269.aspx.
The link says, open visual studio, in Solution Explorer, right-click References > Add Reference.... Go to Windows > Extensions, and check the box next to Live SDK. If you don't see Live SDK in the list, reinstall the Live SDK and retry this procedure. Click OK to exit the dialog box. We tried to reinstall it ,but we didn't got anything as specified above.Instead we have, In Solution Explorer, right-click References > Add Reference.... Go to Assemblies > Extensions>Microsoft.live . And when running windows phone emulator, it generates an error like this ," WL is undefined in our js file". I am including the code ,i used for live id login, which i written in index.js on visual studio.

function onLogin() {

document.getElementById('load').innerHTML = "Loading............";

WL.init();

WL.login({

scope: "wl.emails"

}).then(

function (response) {

WL.api({

path: "me",

method: "GET"

}).then(

function (response) {

// alert(response.emails.preferred);

var req = new XMLHttpRequest();

var serviceUrl = 'service url';

req.onreadystatechange = function() {

alert(req.readyState);

if(req.readyState == 4) {

document.getElementById('token').value = req.responseText;
}

}

req.open("GET",serviceUrl+"?username=" + response.emails.preferred + "&action=1",true);

req.send();

},

function (responseFailed) {

alert('Failed to receive email');

document.getElementById("infoArea").innerText =

"Error calling API: " + responseFailed.error.message;

}

);

},

function (responseFailed)

{

alert('Failed');

document.getElementById("infoArea").innerText =

"Error signing in: " + responseFailed.error_description;

}

);
}
<------------------------------------>
included /// <reference path="///LiveSDKHTML/js/wl.js" /> in index.js
and <script src="///LiveSDKHTML/js/wl.js"></script> in index. html. Kindly suggest me how this can be done..and waiting for a response soon.

- Collapse -
"(html and javascript using phone gap"
Nov 21, 2013 11:25PM PST

Ahh, sorry. I thought you were writing an app. HTML and javascript is a web page to me but I am bumping into programmers that will call a web page an app.

Good luck in cracking this one.
Bob

- Collapse -
windows app
Nov 22, 2013 1:52PM PST
- Collapse -
I apologize.
Nov 22, 2013 2:43PM PST

I'm a little more of the app that you compile from C/C++ or languages and as I noted, HTML and script to me is what it is. Hope you crack it.
Bob

- Collapse -
Answer
I see your cross post.
Nov 22, 2013 11:45PM PST

But my answer is to re-think your choice of html and script. Or surrender and call Microsoft.
Bob