<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Snippet: App Store Links</title>
	<atom:link href="http://www.alexcurylo.com/blog/2009/03/06/snippet-app-store-links/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.alexcurylo.com/blog/2009/03/06/snippet-app-store-links/</link>
	<description>Alex Curylo, iPhone Programmer</description>
	<lastBuildDate>Tue, 07 Feb 2012 06:22:00 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
	<item>
		<title>By: Geri</title>
		<link>http://www.alexcurylo.com/blog/2009/03/06/snippet-app-store-links/comment-page-1/#comment-3944</link>
		<dc:creator>Geri</dc:creator>
		<pubDate>Tue, 02 Nov 2010 20:52:33 +0000</pubDate>
		<guid isPermaLink="false">http://www.alexcurylo.com/blog/?p=508#comment-3944</guid>
		<description>Forget it, now I understand.</description>
		<content:encoded><![CDATA[<p>Forget it, now I understand.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Geri</title>
		<link>http://www.alexcurylo.com/blog/2009/03/06/snippet-app-store-links/comment-page-1/#comment-3943</link>
		<dc:creator>Geri</dc:creator>
		<pubDate>Tue, 02 Nov 2010 20:50:36 +0000</pubDate>
		<guid isPermaLink="false">http://www.alexcurylo.com/blog/?p=508#comment-3943</guid>
		<description>It links to your LinkShare account? Tricky one.</description>
		<content:encoded><![CDATA[<p>It links to your LinkShare account? Tricky one.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Alex</title>
		<link>http://www.alexcurylo.com/blog/2009/03/06/snippet-app-store-links/comment-page-1/#comment-3640</link>
		<dc:creator>Alex</dc:creator>
		<pubDate>Sun, 05 Sep 2010 06:40:08 +0000</pubDate>
		<guid isPermaLink="false">http://www.alexcurylo.com/blog/?p=508#comment-3640</guid>
		<description>Late update for anyone reading this thread:

The reason that the QA1269 version is correct is that you actually don&#039;t want to open the very last resolved URL, which will be a straight iTunes link, like

http://itunes.apple.com/app/trumpet-studio-trumpet-fingering/id318232014?mt=8

You actually want to open the URL in the response that resolved to that, which will be something like

http://phobos.apple.com/WebObjects/MZStore.woa/wa/viewSoftware?id=318232014&amp;mt=8&amp;partnerId=30&amp;partnerId=30&amp;siteID=goXYUj1aTb0-.M7zq185_M6sGzv9nXIp1A

The significant difference, of course, is that your LinkShare affiliate arguments are in that one. You want those.</description>
		<content:encoded><![CDATA[<p>Late update for anyone reading this thread:</p>
<p>The reason that the QA1269 version is correct is that you actually don&#8217;t want to open the very last resolved URL, which will be a straight iTunes link, like</p>
<p><a href="http://itunes.apple.com/app/trumpet-studio-trumpet-fingering/id318232014?mt=8" rel="nofollow">http://itunes.apple.com/app/trumpet-studio-trumpet-fingering/id318232014?mt=8</a></p>
<p>You actually want to open the URL in the response that resolved to that, which will be something like</p>
<p><a href="http://phobos.apple.com/WebObjects/MZStore.woa/wa/viewSoftware?id=318232014&#038;mt=8&#038;partnerId=30&#038;partnerId=30&#038;siteID=goXYUj1aTb0-.M7zq185_M6sGzv9nXIp1A" rel="nofollow">http://phobos.apple.com/WebObjects/MZStore.woa/wa/viewSoftware?id=318232014&#038;mt=8&#038;partnerId=30&#038;partnerId=30&#038;siteID=goXYUj1aTb0-.M7zq185_M6sGzv9nXIp1A</a></p>
<p>The significant difference, of course, is that your LinkShare affiliate arguments are in that one. You want those.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Alex</title>
		<link>http://www.alexcurylo.com/blog/2009/03/06/snippet-app-store-links/comment-page-1/#comment-3066</link>
		<dc:creator>Alex</dc:creator>
		<pubDate>Mon, 26 Apr 2010 17:13:13 +0000</pubDate>
		<guid isPermaLink="false">http://www.alexcurylo.com/blog/?p=508#comment-3066</guid>
		<description>Hmmmm. Yes, Oliver, that&#039;s what I read in the docs too ...

... but using [response URL] is taken straight from QA1269

https://developer.apple.com/iphone/library/qa/qa2008/qa1629.html

and I&#039;m moderately tended to think that an error there wouldn&#039;t have made it through review. (Certainly not impossible though!) Soon as I have a spare minute, I&#039;ll do some digging into exactly what the URLs are on both side in some actual redirects and file a Radar probably if it does look like an error in the QA.

But if you feel like possibly blowing a tech support incident (if it is their error, they often refund the incident) to find out for sure whether QA1629 is broken or not, please share the results!</description>
		<content:encoded><![CDATA[<p>Hmmmm. Yes, Oliver, that&#8217;s what I read in the docs too &#8230;</p>
<p>&#8230; but using [response URL] is taken straight from QA1269</p>
<p><a href="https://developer.apple.com/iphone/library/qa/qa2008/qa1629.html" rel="nofollow">https://developer.apple.com/iphone/library/qa/qa2008/qa1629.html</a></p>
<p>and I&#8217;m moderately tended to think that an error there wouldn&#8217;t have made it through review. (Certainly not impossible though!) Soon as I have a spare minute, I&#8217;ll do some digging into exactly what the URLs are on both side in some actual redirects and file a Radar probably if it does look like an error in the QA.</p>
<p>But if you feel like possibly blowing a tech support incident (if it is their error, they often refund the incident) to find out for sure whether QA1629 is broken or not, please share the results!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Oliver</title>
		<link>http://www.alexcurylo.com/blog/2009/03/06/snippet-app-store-links/comment-page-1/#comment-3062</link>
		<dc:creator>Oliver</dc:creator>
		<pubDate>Mon, 26 Apr 2010 11:13:59 +0000</pubDate>
		<guid isPermaLink="false">http://www.alexcurylo.com/blog/?p=508#comment-3062</guid>
		<description>Hi,
    Thanks for sharing this code. However, I think you have a bug in your connection:willSendRequest:redirectResponse: method. I believe the middle line should be:
self.iTunesURL = [request URL];

    Instead of:
self.iTunesURL = [response URL];

    If you check the docs (http://developer.apple.com/mac/library/documentation/Cocoa/Reference/Foundation/Classes/NSURLConnection_Class/Reference/Reference.html#//apple_ref/occ/instm/NSObject/connection:willSendRequest:redirectResponse), you&#039;ll see that the response argument actually contains the URL for the object that caused the redirect (i.e. the URL you&#039;re being redirected from, not to). I believe this is why one of the previous posters was getting Safari popping up briefly, as the iTunesURL property is being set back to LinkShare before the app closes.

    Hope that helps! Do feel free to correct me if I&#039;ve made a mistake there...

    Oliver
    MagicSolver.com</description>
		<content:encoded><![CDATA[<p>Hi,<br />
    Thanks for sharing this code. However, I think you have a bug in your connection:willSendRequest:redirectResponse: method. I believe the middle line should be:<br />
self.iTunesURL = [request URL];</p>
<p>    Instead of:<br />
self.iTunesURL = [response URL];</p>
<p>    If you check the docs (<a href="http://developer.apple.com/mac/library/documentation/Cocoa/Reference/Foundation/Classes/NSURLConnection_Class/Reference/Reference.html#//apple_ref/occ/instm/NSObject/connection:willSendRequest:redirectResponse" rel="nofollow">http://developer.apple.com/mac/library/documentation/Cocoa/Reference/Foundation/Classes/NSURLConnection_Class/Reference/Reference.html#//apple_ref/occ/instm/NSObject/connection:willSendRequest:redirectResponse</a>), you&#8217;ll see that the response argument actually contains the URL for the object that caused the redirect (i.e. the URL you&#8217;re being redirected from, not to). I believe this is why one of the previous posters was getting Safari popping up briefly, as the iTunesURL property is being set back to LinkShare before the app closes.</p>
<p>    Hope that helps! Do feel free to correct me if I&#8217;ve made a mistake there&#8230;</p>
<p>    Oliver<br />
    MagicSolver.com</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Alex</title>
		<link>http://www.alexcurylo.com/blog/2009/03/06/snippet-app-store-links/comment-page-1/#comment-2942</link>
		<dc:creator>Alex</dc:creator>
		<pubDate>Tue, 23 Mar 2010 19:31:55 +0000</pubDate>
		<guid isPermaLink="false">http://www.alexcurylo.com/blog/?p=508#comment-2942</guid>
		<description>@Matt:

I&#039;d guess that the URL must be malformed in some way. Here&#039;s the latest version of the referral code which I see on the LinkShare dashboard is definitely working fine as of yesterday:

- (void)sendReferral:(NSString *)appID tagged:(NSString *)tag
{
   NSString *referralTemplate1 = @&quot;http://click.linksynergy.com/fs-bin/stat?id=goXYUj1aTb0&amp;offerid=146261&amp;type=3&amp;subid=0&amp;u1=&quot;;
   NSString *referralTemplate2 = @&quot;&amp;tmpid=1826&amp;RD_PARM1=http%3A%2F%2Fphobos.apple.com%2FWebObjects%2FMZStore.woa%2Fwa%2FviewSoftware%3Fid%3D&quot;;
   NSString *referralTemplate3 = @&quot;%26mt%3D8%26partnerId%3D30&quot;;
   NSString *referralLink = [NSString stringWithFormat:@&quot;%@%@%@%@%@&quot;, referralTemplate1, tag, referralTemplate2, appID, referralTemplate3];
   self.iTunesURL = [NSURL URLWithString:referralLink];
   NSURLRequest *referralRequest = [NSURLRequest requestWithURL:self.iTunesURL];
   NSURLConnection *referralConnection = [[NSURLConnection alloc] initWithRequest:referralRequest delegate:self startImmediately:YES];
   [referralConnection release];
}

called with something like

   [self sendReferral:@&quot;302877146&quot; tagged:@&quot;PosesOld&quot;]; // volume 1 to test

Try that exact code. If it doesn&#039;t work, I have no idea why, there must be something strange about your network setup. If it does, then editing it for your account ought to work too...</description>
		<content:encoded><![CDATA[<p>@Matt:</p>
<p>I&#8217;d guess that the URL must be malformed in some way. Here&#8217;s the latest version of the referral code which I see on the LinkShare dashboard is definitely working fine as of yesterday:</p>
<p>- (void)sendReferral:(NSString *)appID tagged:(NSString *)tag<br />
{<br />
   NSString *referralTemplate1 = @&#8221;http://click.linksynergy.com/fs-bin/stat?id=goXYUj1aTb0&amp;offerid=146261&amp;type=3&amp;subid=0&amp;u1=&#8221;;<br />
   NSString *referralTemplate2 = @&#8221;&amp;tmpid=1826&amp;RD_PARM1=http%3A%2F%2Fphobos.apple.com%2FWebObjects%2FMZStore.woa%2Fwa%2FviewSoftware%3Fid%3D&#8221;;<br />
   NSString *referralTemplate3 = @&#8221;%26mt%3D8%26partnerId%3D30&#8243;;<br />
   NSString *referralLink = [NSString stringWithFormat:@"%@%@%@%@%@", referralTemplate1, tag, referralTemplate2, appID, referralTemplate3];<br />
   self.iTunesURL = [NSURL URLWithString:referralLink];<br />
   NSURLRequest *referralRequest = [NSURLRequest requestWithURL:self.iTunesURL];<br />
   NSURLConnection *referralConnection = [[NSURLConnection alloc] initWithRequest:referralRequest delegate:self startImmediately:YES];<br />
   [referralConnection release];<br />
}</p>
<p>called with something like</p>
<p>   [self sendReferral:@"302877146" tagged:@"PosesOld"]; // volume 1 to test</p>
<p>Try that exact code. If it doesn&#8217;t work, I have no idea why, there must be something strange about your network setup. If it does, then editing it for your account ought to work too&#8230;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Matt</title>
		<link>http://www.alexcurylo.com/blog/2009/03/06/snippet-app-store-links/comment-page-1/#comment-2941</link>
		<dc:creator>Matt</dc:creator>
		<pubDate>Tue, 23 Mar 2010 18:46:31 +0000</pubDate>
		<guid isPermaLink="false">http://www.alexcurylo.com/blog/?p=508#comment-2941</guid>
		<description>Hey Alex,

Did you encounter any trouble w/ the response in -willSendRequest being nil?  I&#039;ve set a breakpoint there and the response is always nil.  I&#039;ve verified that I&#039;m getting a 301 by curling the URL in question and checking out the headers.

Any ideas why that might be happening?

Thanks!

-Matt</description>
		<content:encoded><![CDATA[<p>Hey Alex,</p>
<p>Did you encounter any trouble w/ the response in -willSendRequest being nil?  I&#8217;ve set a breakpoint there and the response is always nil.  I&#8217;ve verified that I&#8217;m getting a 301 by curling the URL in question and checking out the headers.</p>
<p>Any ideas why that might be happening?</p>
<p>Thanks!</p>
<p>-Matt</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Alex</title>
		<link>http://www.alexcurylo.com/blog/2009/03/06/snippet-app-store-links/comment-page-1/#comment-2816</link>
		<dc:creator>Alex</dc:creator>
		<pubDate>Mon, 18 Jan 2010 07:55:34 +0000</pubDate>
		<guid isPermaLink="false">http://www.alexcurylo.com/blog/?p=508#comment-2816</guid>
		<description>Hey Deepthi,

I just checked the app and it&#039;s still working as expected, so I&#039;d imagine something&#039;s going wrong with your delegation. Put a breakpoint in your -willSendRequest to make sure it&#039;s getting called, and NSLog() the value of self.iTunesURL in your -connectionDidFinishLoading.

If all is working as intended, the value of self.iTunesURL that you actually open, which is the current one when -connectionDidFinishLoading gets called, should not redirect at all. You can check that by pasting it into Safari directly.

My guess would be that a misspelling crept into your -willSendRequest definition so the URL is not actually being updated as part of the redirection.</description>
		<content:encoded><![CDATA[<p>Hey Deepthi,</p>
<p>I just checked the app and it&#8217;s still working as expected, so I&#8217;d imagine something&#8217;s going wrong with your delegation. Put a breakpoint in your -willSendRequest to make sure it&#8217;s getting called, and NSLog() the value of self.iTunesURL in your -connectionDidFinishLoading.</p>
<p>If all is working as intended, the value of self.iTunesURL that you actually open, which is the current one when -connectionDidFinishLoading gets called, should not redirect at all. You can check that by pasting it into Safari directly.</p>
<p>My guess would be that a misspelling crept into your -willSendRequest definition so the URL is not actually being updated as part of the redirection.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Deepthi</title>
		<link>http://www.alexcurylo.com/blog/2009/03/06/snippet-app-store-links/comment-page-1/#comment-2815</link>
		<dc:creator>Deepthi</dc:creator>
		<pubDate>Mon, 18 Jan 2010 07:34:23 +0000</pubDate>
		<guid isPermaLink="false">http://www.alexcurylo.com/blog/?p=508#comment-2815</guid>
		<description>Hi Alex

I tried the first process to connect to the iTunes AppStore and to open the same application u mentioned in that link, but it is not opening on my iPhone. It is showing an alert saying that &quot;Cannot Open Page&quot; with the message &quot;Safari cannot open the page because too many redirects occoured.&quot;. Can you please help me on this.

Thanks in Advance
Deepthi</description>
		<content:encoded><![CDATA[<p>Hi Alex</p>
<p>I tried the first process to connect to the iTunes AppStore and to open the same application u mentioned in that link, but it is not opening on my iPhone. It is showing an alert saying that &#8220;Cannot Open Page&#8221; with the message &#8220;Safari cannot open the page because too many redirects occoured.&#8221;. Can you please help me on this.</p>
<p>Thanks in Advance<br />
Deepthi</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Alex</title>
		<link>http://www.alexcurylo.com/blog/2009/03/06/snippet-app-store-links/comment-page-1/#comment-2696</link>
		<dc:creator>Alex</dc:creator>
		<pubDate>Sat, 28 Nov 2009 18:26:06 +0000</pubDate>
		<guid isPermaLink="false">http://www.alexcurylo.com/blog/?p=508#comment-2696</guid>
		<description>Heh. That would explain it :)</description>
		<content:encoded><![CDATA[<p>Heh. That would explain it <img src='http://www.alexcurylo.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
</channel>
</rss>

