Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8618039
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T06:00:53+00:00 2026-06-12T06:00:53+00:00

I need to send my toast notification arguments and open a web browser. Here

  • 0

I need to send my toast notification arguments and open a web browser. Here is my code:

private void DoNotification()
    {
        var notifications = serviceClient.GetNotificationsAsync(App.CurrentRestaurantLocation.ID);
        foreach (RestaurantNotification note in notifications.Result)
        {
            IToastNotificationContent toastContent = null;
            IToastText02 templateContent = ToastContentFactory.CreateToastText02();
            templateContent.TextHeading.Text = note.Title;
            templateContent.TextBodyWrap.Text = note.Message;
            toastContent = templateContent;
            // Create a toast, then create a ToastNotifier object to show
            // the toast
            ToastNotification toast = toastContent.CreateNotification();

            toast.Activated += toast_Activated;
            // If you have other applications in your package, you can specify the AppId of
            // the app to create a ToastNotifier for that application
            ToastNotificationManager.CreateToastNotifier().Show(toast);
        }
    }

    async void toast_Activated(ToastNotification sender, object args)
    {
        await Launcher.LaunchUriAsync(new Uri("http://www.google.com"));
    }

My activated event happens, however, no web browser opens. That launcher code works without the toast notification.

How do I populate args with a url? My web service returns note.RedirectUrl and I want to feed it in there.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-12T06:00:54+00:00Added an answer on June 12, 2026 at 6:00 am

    Instead of using the Activated event handler on the ToastNotification, use the OnLaunched handler in the main Application class (which allows launch context to be easily accessed).

    For the handler to be invoked, a launch argument needs to be provided in the toast XML. Using the code above, you can add the argument to the the IToastContent object like so:

    toastContent.Launch = note.RedirectUrl;
    

    Then in the Application’s OnLaunched method, the app can retrieve the launch argument:

    protected override void OnLaunched(LaunchActivatedEventArgs args)
    {
        if (!String.IsNullOrEmpty(args.Argument)) {
            var redirectUrl = args.Argument;
        }
    }
    

    Calling LaunchUriAsync should work as expected when used from OnLaunched.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Hi i need send file to server i use this code public void PostFile()
I need to send some arguments from the iPhone to a php in the
I need to send emails from my web application (on account creation, password reset,
In my app I need to send SMS, so I use the following code
We need send h264 from flash to Wowza and after to vlc by RTSP
I need send certain attributes(say, human readable user name) from server to client after
I've a custom form (created with form API) that need send an uploaded file
I need to send video stream between 2 mobile devices. Bada has no support
I need to send instant messages (like forum PMs) between users with my asp.net
I need to send an HTML report with images from an application. The report

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.