How can I trigger action on a windows phone app? Let say I want to navigate to a certain page in my native app by scanning the QR code, how do I go about doing that?
First of all this is an idea, what i would do is to create a custom uri scheme, so when the QR code has been read, the device will navigate to the page you pointed, it doesn't matter if your application is running
WMAppManifest right after Tokens add<Extensions> <Protocol Name="yourprotocol" NavUriFragment="encodedLaunchUri=%s" TaskID="_default" /> </Extensions>
App.cs add RootFrame.UriMapper = new CustomUriMapper();CustomUriMapper should look like this class CustomUriMapper : UriMapperBase { private string tempUri; public override Uri MapUri(Uri uri) { tempUri = System.Net.HttpUtility.UrlDecode(uri.ToString()); if (tempUri.Contains("yourprotocol")) { return new Uri("YourPage.xaml", UriKind.Relative); } else { return new Uri("MainPage.xaml", UriKind.Relative); } } }
Let me know how it goes (:
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With