Launch Location Setting in Windows Phone

If you create a location based application in Windows Phone, you have to check the location setting in the phone. Is it enabled or not. If it isn’t, usually your app will show a message box that ask the user to enable their phone location first. Well, I think it could be nice if the app can open the location setting so the user don’t have to close your app manually and open the settings, scroll scroll and find the location setting. You can help to make their life easier by this short code:

MessageBoxResult result = MessageBox.Show("Location is disabled. Do you want to activate it?",
                       "Location", MessageBoxButton.OKCancel);

if (result == MessageBoxResult.OK)
     await Launcher.LaunchUriAsync(new Uri("ms-settings-location:"));

This code will launch location setting and let the user to enable it. Try it! 😀

Nanda Firdaus

Ex-engineer who is switching to product management role in Traveloka. Passionate about new technology and have interest in product development, business, and investment. Ex-Microsoft Student Partner. Master of Information System Management at Carnegie Mellon University. Bachelor of Information System, Faculty of Computer Science, Universitas Indonesia.

Leave a Reply

Your email address will not be published.