I'm developing a web site that will feature windows phone 7 apps, and I'd like to include a Microsoft Tag so users can point their phone at the screen and download the app that is featured.
So far their website has proven to be quite unhelpful, and it seems you need to sign up for the API if you don't want to generate them all manually.
I was wondering if there is a single URL that I can place the app ID into, hosted on Microsoft's servers, that will generate the tag for me?
There isn't just one URL that will create a tag for you. But this being Stack Overflow, here's a short program that uses the Tag API to create any number of tags. For the program to work, you will need to:
The complete blog post is at http://flyingpies.wordpress.com/2011/05/25/creating-several-microsoft-tags/.
using System;
using System.IO;
using MakeTags.Tag;
namespace MakeTags {
class Program {
static void Main(string[] args) {
MIBPContractClient tagService = new MIBPContractClient();
UserCredential creds = new UserCredential();
creds.AccessToken = "your-access-token-here";
int tagsToCreate = 10;
string category = "Main";
string tagTitlePrefix = "My Sample Tag ";
string tagImageFilePathFormat = "mytag{0}.png";
for (int i = 0; i < tagsToCreate; ++i) {
Console.WriteLine("Creating tag " + i);
string tagTitle = tagTitlePrefix + i;
URITag tag = new URITag();
tag.Title = tagTitle;
tag.MedFiUrl = "http://flyingpies.wordpress.com/2011/05/24/creating-several-microsoft-tags";
tag.UTCStartDate = DateTime.UtcNow;
tagService.CreateTag(creds, category, tag);
string tagImageFilePath = string.Format(tagImageFilePathFormat, i);
byte[] tagImageBytes = tagService.GetBarcode(
creds,
category,
tagTitle,
ImageTypes.png,
1f,
DecorationType.HCCBRP_DECORATION_DOWNLOAD,
false);
File.WriteAllBytes(tagImageFilePath, tagImageBytes);
}
}
}
}
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