我需要网络服务方面的帮助

发布于 2024-10-14 06:51:30 字数 437 浏览 1 评论 0原文

这是我的场景:我有一个带有消耗品的 iPhone 应用程序(用 Monotouch 编写,但与设计无关)。安装应用程序时我会赠送 25 个免费消耗品。如果用户删除该应用程序并重新安装,他现在将获得同样的 25 个免费消耗品。我需要一种方法来防止这种情况发生。

所以我想到了在服务器(我的网站主机?)上建立一个数据库的想法,其中包含 UDID 列表。如果用户的 UDID 在数据库中(这意味着他已经安装了应用程序),则会将响应发送回应用程序以将消耗品计数设置为零。如果 UDID 不在 d/b 中,则会添加它并如此指示响应(新应用程序)。

我正在考虑使用 REST(更简单)和 Linux 主机作为服务器端。我的问题是:

  1. 有更好的方法吗?
  2. 服务器上选择的语言是什么?
  3. sqlREST 怎么样? (对我来说看起来很好,但是在上面的场景中它会起作用吗?)

Here is my scenario: I have an iPhone app (written in Monotouch but that has nothing to do with the design) that has consumables. I give 25 free consumables when the app is installed. If the user deletes the app and re-installs it, he now gets the same 25 free consumables. I need a way to prevent this.

So I came up with the idea of a database on a server (my website host?), which would have a list of UDIDs. If the user's UDID is in the database (that means he has already installed the app) a response is sent back to the app to set the consumable count to zero. If the UDID is not in the d/b, then it is added and the response is so indicated (new app).

I am thinking of using REST (simpler) and a Linux host for the server side. My questions are:

  1. Is there a better way of doing this?
  2. What is the language of choice on the server?
  3. What about sqlREST? (looks very good to me, but will it work in the above scenario?)

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

鱼窥荷 2024-10-21 06:51:30

好吧,我可以告诉你我选择的语言是什么:ASP.NET/C# 与 SQL Server DB 的结合。我的网站在一个托管商处运行,该托管商每月只需几美元即可提供这种组合。

您甚至不需要网络服务。您可以在服务器上设置一个 ASPX 页面并使用 NSString.FromUrl (或任何调用的方法)调用它:“mycounter.aspx?udid=1234”。每次调用该页面时,它都会增加传入的设备 ID 的计数,并且它唯一输出的是剩余请求的数量。
您的客户端将该响应解析为整数,如果它为零,则通知用户。

您可能应该添加一些散列,以确保邪恶的 Krumelur 不会访问您的 URL 并调用它来获取随机设备 ID,从而使它们无法使用。 :-)

雷内

Well, I can tell you what MY language of choice would be: ASP.NET/C# in combination with an SQL Server DB. I have my website running at a hoster which offers this combination for just a few bucks per month.

You don't even need webservices. You could just setup an ASPX page on your server and call it using NSString.FromUrl (or whatever the method is called): "mycounter.aspx?udid=1234". Everytime the page gets called, it increases the count of the passed in device ID and the only thing it ever outputs is the number of remaining requests.
Your client parses that response to integer and if it is zero, informs the user.

You should proably add some hashing to make sure that evil Krumelur won't go to your URL and call it for random device IDs, rendering them unusable. :-)

René

梦明 2024-10-21 06:51:30

答案实际上取决于您的网络托管服务商。以及他们支持什么。这可能取决于您的交易量等。

由于您使用的是 Monotouch,我假设您熟悉 .net/c# 世界。

我会查看用 C# 编写的 WCF Web 服务。这又将使用 SQL Server 进行存储。当然,您可以直接使用 SQL Server 存储过程。

sqlREST 看起来很有趣,但乍一看,您似乎需要运行 Appache + Tomcat 堆栈才能工作。

如果你只是想要尽可能低的标准来让它工作,那么我同意另一张海报...... ASP.NET + SQL 服务器也可以完成它。

The answer really depends on your web host. And what they support. That probably depends on your transaction volume and so on.

Since you are using Monotouch I'm going to assume you are comfortable in .net/c# world.

I would look at a WCF web service written in c#. This in turn would use SQL server for storage. Of course you could just go straight to a SQL server stored procedure.

sqlREST looks interesting but at a glance it looks like you need to be running the Appache + Tomcat stack for that to work.

if you just want the lowest possible bar to get it working then I agree with the other poster... ASP.NET + SQL server would get it done too.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文