以编程方式检测应用程序从哪个应用商店下载 [英] Programmatically detect which app store the app was downloaded from

查看:98
本文介绍了以编程方式检测应用程序从哪个应用商店下载的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我没有找到关于此的帖子所以我必须问:有没有办法以编程方式检测应用程序从哪个应用商店下载? (即:德国App Store)

I haven't found a thread about this so I must ask: is there a way to programmatically detect which app store the app was downloaded from? (ie: Germany App Store)

我不想要求位置权限来检测用户位置但是如果没有办法检测应用程序商店,然后我可能必须。

I don't want to have to ask for location privileges to detect user location but if there isn't a way to detect the app store then I may have to.

推荐答案

我认为您使用用户的当前区域设置来检测他们在哪个国家/地区是...但有时可能会失败,所以我不确定检测AppStore的100%有效方法是否适合你。

I think you'd use the current locale of the user to detect in which country they are… but it could fail sometimes, so I'm not very sure if a not 100% effective way to detect the AppStore would work for you.

你需要调用

[[NSLocale currentLocale] objectForKey: NSLocaleCountryCode]

另外,请参阅以下主题中的讨论,其中一些是旧的,但可能会帮助您找到替代解决方案 Link1

Also, please see discussions in the following threads, some of them are old, but probably will help you to find alternatives solutions too Link1 and Link2

这篇关于以编程方式检测应用程序从哪个应用商店下载的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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