The AndContinue
APIs are not asynchronous calls like the Windows Store AuthenticateAsync
is. From MSDN:
When you call an AndContinue method, your app is deactivated while the operation completes in order to conserve memory. On low-memory devices, your app might even be terminated.
So, when you call an AndContinue
method, your app can be terminated. When your app is restored, you'll need some way of jumping back into your async
method. There's nothing like this built-in AFAIK.
It is certainly possible to create a Task<WebAuthenticationResult>
using TaskCompletionSource<T>
, but it won't work in this case. The AndContinue
method can terminate your app, and when your app resumes, it can complete the task but there won't be any async
methods waiting on it.
You could possibly have a "task cache" that is serialized on suspend/resume, and have your async
methods pull from that cache, invoking other async
methods only if the task isn't found. I'd say that approach is fraught with pitfalls, though, and totally not worth it.