locked
Pdf File unable to open with Launcher.LaunchFileAsync() RRS feed

  • Question

  • Hi all,

    I'm having a PDF document to open with Launcher.LaunchFileAsync().

    Here is my code,

     StorageFile storageFile = null;
    
                                        storageFile = await StorageFile.GetFileFromPathAsync("Path of my PDF");
    
     var options = new Windows.System.LauncherOptions();
                                            options.DisplayApplicationPicker = true;
                                            bool isOpened = await Launcher.LaunchFileAsync(storageFile, options);
                                            if(isOpened)
                                            {
                                                Debug.WriteLine("Launch Successfully");
                                            }
                                            else
                                            {
                                                MessageDialog messageDialog = new MessageDialog("Can't open file.", "Alert!");
                                                await messageDialog.ShowAsync();
                                                Debug.WriteLine("Launched Failed");
                                            }

    If i installed PDF viewer in my phone it's opening perfectly no issues.

    If i un installed PDF viewer from my phone and try same code, 

    Launcher.LaunchFileAsync() returns true but no results.

    I'm not able to see any thing in my screen. It should ask open with any other application like that.

    Thanks,

    Winit.

    Thursday, September 10, 2015 12:24 PM

Answers

  • Hi WinitWindowsphone8,

    Your app is the UWP app, so you should test it on the Windows 10, after that I can get the correct result if I uninstall the PDF viewer:


    Best Regards,
    Amy Peng

    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.


    Wednesday, October 7, 2015 3:00 AM

All replies

  • Which app? UWP? Have you tested on emulator?
    Friday, September 11, 2015 11:20 AM
  • Hi,

    It's UWP. I tested on Windows Phone 8.1 and Emulator.

    Thanks

    Friday, September 11, 2015 1:57 PM
  • Hi WinitWindowsphone8,

    Your app is the UWP app, so you should test it on the Windows 10, after that I can get the correct result if I uninstall the PDF viewer:


    Best Regards,
    Amy Peng

    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.


    Wednesday, October 7, 2015 3:00 AM