Пример #1
0
        public static PlatformNfcTagRecord ToPlatformNfcTagRecord(Stack <NdefRecord> ndefRecords)
        {
            var ndefRecord = ndefRecords.Peek();

            if (ndefRecord != null)
            {
                var nfcUriRecord = ndefRecord as NfcUriRecord;

                if (nfcUriRecord != null)
                {
                    if (nfcUriRecord.UriPrefix == NfcUriRecord.Prefix.http ||
                        nfcUriRecord.UriPrefix == NfcUriRecord.Prefix.https ||
                        nfcUriRecord.UriPrefix == NfcUriRecord.Prefix.httpswww ||
                        nfcUriRecord.UriPrefix == NfcUriRecord.Prefix.httpwww)
                    {
                        var platformNfcTagRecord = PlatformNfcTagRecord.FromDeviceTouchUrl(nfcUriRecord.ToString());

                        if (platformNfcTagRecord != null)
                        {
                            ndefRecords.Pop();
                            return(platformNfcTagRecord);
                        }
                    }
                }
            }
            return(null);
        }