简体   繁体   中英

Is it possible to launch system/third party app using an NDEFLaunchApp record to get the URI and by using LaunchUriAsync without NFC Tags?

So I have spent the whole night looking like a zombie in the morning trying to figure out how the OS handles an NFC tap for an NDEFLaunchApp Record and I have known the following.

I'm pretty sure that there is a workaround which lets you launch a system app / third party app (if you know the product Id / GUID) from your app . As there are apps in the Windows Phone Store which I have somehow figured out what I've been trying to.

I have come up with the following code:

        NdefLaunchAppRecord appLaunchRecord = new NdefLaunchAppRecord();
        appLaunchRecord.AddPlatformAppId("WindowsPhone", "{App GUID}");
        appLaunchRecord.Arguments = "_default";

        // Creating a new NdefMessage from the above record.

        var message = new NdefMessage { appLaunchRecord };

        // Getting the record from the message that we just created

        foreach (NdefLaunchAppRecord record in message)
        {
            var specializedType = record.CheckSpecializedType(false);
            if (specializedType == typeof(NdefLaunchAppRecord))
            {

                var x = String.Join(" ", record.Payload);
                // Getting the payload by GetString gets a formatted Uri with args

                string result = System.Text.Encoding.UTF8.GetString(record.Payload, 0, record.Payload.Length);
                // result = "\0\fWindowsPhone&{5B04B775-356B-4AA0-AAF8-6491FFEA5630}\0\b_default";
                // result = "(null)(form feed)WindowsPhone&{App GUID}(null)(backspace)_default

                // So this will be sent to the OS and I believe the OS will then launch the specified app by an unknown protocol
                // like xxx://result
                // and the app will be launched?

                // So is it then possible to somehow call the following:

                await Windows.System.Launcher.LaunchUriAsync(new Uri("OUR MAGIC RESULT?", UriKind.RelativeOrAbsolute));

If anyone has / can figure out a way for this, it would be a REAL Service to the WP Community as developers are restricted by Microsoft to open certain settings / apps which are actually needed by those apps. For instance (speech settings, audio settings, about settings, alarms, region settings, date+time);

APPS that possibly have a workaround:

  1. Music Hub Tile (Launches the old Music+Videos Hub)

http://www.windowsphone.com/en-gb/store/app/music-hub-tile/3faa2f9e-6b8d-440a-bb60-5dd76a5baec1

  1. Tile for Bing Vision

http://www.windowsphone.com/en-gb/store/app/tile-for-bing-vision/05894022-e18c-40a4-a6cc-992383aa7ee8

There are reserved uri schemes for bing and zune. See: http://msdn.microsoft.com/en-us/library/windows/apps/jj207065(v=vs.105).aspx

Those two apps propably use these and have found some undocumented use of the scheme.

If there is an uri scheme that launches any app by guid from within your app, it is hidden well. Currently you can only launch apps that registered for an uri scheme or file association.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM