在没有重定向的情况下建立到iTunes商店的会员链接? [英] Make an affiliate link to the iTunes store without redirects?

查看:176
本文介绍了在没有重定向的情况下建立到iTunes商店的会员链接?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Apple已在从iPhone应用程序启动App Store 中解释过如何建立一个联盟链接到应用程序商店并在后台处理重定向,这样它不会惹恼用户。但是最好不要重定向。我似乎记得有办法做到这一点,但现在我无法在任何地方找到它。

Apple has explained in "Launching the App Store from an iPhone application" how one can make an affiliate link to the app store and handle the redirect in background so it doesn't annoy the user. But it would be even better not to have the redirect at all. I seem to remember seeing a way to do that, but now I can't find it anywhere.

是否可以建立从iOS应用到联盟的联盟链接应用程序商店没有任何重定向?

Is it possible to make an affiliate link from an iOS app to the app store without any redirect at all?

编辑:澄清一下,我说的是Linkshare会员链接。

To clarify, I am talking about a Linkshare affiliate link.

编辑2:我是越来越近。我有这个链接,我直接抓住了linkshare的文本链接页面。在下面使用k1th的技巧时,在iPad上没有任何重定向的情况下工作,但在iPod touch上仍然有一个重定向[并且可能是iPhone]。我推测重定向可能是从顶级iPad应用程序切换到顶级iPhone应用程序,但我肯定不知道。

EDIT 2: I'm getting closer. I have this link, which I grabbed straight off of linkshare's "text links" page. When using k1th's trick below, works without any redirects on the iPad, but still has one redirect on an iPod touch [and presumably iPhone]. I speculate that the redirect may be to switch from top iPad apps to top iPhone apps, but I don't know that for sure.

http://click.linksynergy.com/fs-bin/click? id = sf2bW7QX / qU& offerid = 146261.10005745& type = 3& subid = 0

推荐答案

我接受它你不想重定向的原因是

I take it the reason you don't want redirects is to


  • 避免Safari浏览器弹出

  • 避免在App Store应用程序内部重定向

我更喜欢k1th的解决方案,但是失败了(我想它可能会失败#2) ,我认为问题是第一个itms链接不是最终链接。一种解决方案是简单地对URL进行硬编码(或通过其他方式提供):

I would prefer k1th's solution, but failing that (I suppose it could fail #2 above), I assume the problem is that the first itms link is not the "final" one. One solution would be to simply hard-code the URL (or provide it by some other means):

- (BOOL)webView:(UIWebView *)webView shouldStartLoadWithRequest:(NSURLRequest *)request navigationType:(UIWebViewNavigationType)navigationType {
    NSURL myAppUrl = ....
    if ([request.URL.scheme isEqualToString:@"itms"] &&
        [[UIApplication sharedApplication] canOpenURL:myAppURL]) {
        [[UIApplication sharedApplication] openURL:myAppURL];
        return NO;
    }

    return YES; // go on redirecting
}

更清洁的解决方案是关闭应用ID request.URL 中的itms链接,并使用可直接转到您应用的模式格式化新网址。

A cleaner solution would be to read the app ID off the itms link in the request.URL and format a new URL using the pattern that will take you directly to your app.

这篇关于在没有重定向的情况下建立到iTunes商店的会员链接?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆