生成“免费/演示”和“免费”的最佳方式 和来自相同源代码的商业应用程序?

发布于 2024-07-07 22:08:38 字数 277 浏览 6 评论 0原文

我想在 App Store 上提供两种不同版本的 iPhone 应用程序 - 一种是免费的,但受通过应用程序显示的项目数量的限制,另一种则完全不受限制。

两个应用程序的源代码将完全相同,唯一的区别是存储应用程序中项目的 SQLite 数据库。

据我了解,该应用程序的两个版本都需要具有不同的捆绑包名称和不同的图标。 我正在尝试找到一种方法来避免完全复制源代码目录,以便能够自定义其中一些内容:数据库、图标、笔尖字符串等。

有没有一种好的方法可以在不复制所有内容的情况下做到这一点?

I would like to provide two different versions of my iPhone app on the App Store -- one free that is limited by the number of items displayed through the application, and another one completely unlimited.

The source code for both apps will be exactly the same, the only difference would be the SQLite database that stores the items in the app.

I understand that both versions of the app will need to have different bundle names, and different icons. I'm trying to find a way to avoid completely copying the source code directory to be able to customize some of these things: database, icons, nib strings, etc.

Is there a good way to do this without duplicating everything?

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

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

发布评论

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

评论(6

朕就是辣么酷 2024-07-14 22:08:38

只需在您的项目中创建第二个目标即可。 一个可以是功能齐全的应用程序,其中包括完整的数据库,而新的目标将是带有演示数据库的演示版本。 我们用填字游戏来做到这一点,效果很好。 然后,您可以将所有源保存在一个地方,而不必担心事情不同步。

Just create a second target in your project. One can be the full featured application, which includes the full database, and the new target will be your demo build, with the demo database. We do this with Crosswords, and it works fine. You can then keep all your source in one place, and not worry about things getting out of sync.

路弥 2024-07-14 22:08:38

明智地使用条件编译。 我不知道你正在使用什么语言,但在 C/C++ 中,条件编译是使用宏预处理器和 ifdef 完成的。 您可以编写如下代码:

#ifdef FULL_APP
  // unlimited size
  #define SIZE -1
#else
  #define SIZE 100
#endif

当您构建程序时,您在编译器命令行上提供适当的宏定义。

gcc program.cc -o program.o -DFULL_APP

您可以通过多种方式使用条件编译和宏预处理器来打开或关闭可执行文件中的各种功能或修改程序的其他方面。

Make judicious use of conditional compilation. I don't know what language you are working in, but in C/C++ conditionals compilation is done using the macro preprocessor and ifdefs. You would write code something like:

#ifdef FULL_APP
  // unlimited size
  #define SIZE -1
#else
  #define SIZE 100
#endif

When you build the program you supply the appopriate macro definitions on the compiler command line.

gcc program.cc -o program.o -DFULL_APP

You can use conditional compilation and the macro preprocessor in a variety of ways to turn on or off various features in the executable or modify other aspects of your program.

决绝 2024-07-14 22:08:38

还值得注意的是,如果用户决定升级到完整版本,如果您没有某种机制来转移现有数据,您可能会看到用户的负面反应。 如果数据内容很小并且大部分可以用文本表示,我建议实现一个 URL 方案来传递它。

It is also worth noting that if a user decides to upgrade to the full version, if you do not have some mechanism in place to transfer over the existing data you will likely see a negative reaction from your users. If the contents of the data are small and can be mostly represented by text, I would suggest implementing a URL scheme for passing it over.

§普罗旺斯的薰衣草 2024-07-14 22:08:38

创建一个新项目,然后让它引用(而不是创建本地副本)与原始项目相同的源文件。

Create a new project, then have it reference (not create a local copy) of the same source files as the original project.

恏ㄋ傷疤忘ㄋ疼 2024-07-14 22:08:38

是否有某种(iPhone 特定的?)原因导致您的应用程序的两个版本需要不同的 SQLite 数据库?

如果没有,您可以使用可交换密钥实施一种许可机制,使您只需更改一个文件即可编译单个代码库。 在运行时,您的应用程序将检查该文件并允许减少或无限的存储。
额外的好处(如果 iPhone 商店支持此类功能)是解锁完整版本应该非常简单而不会丢失数据。

当然,如果您的客户精通技术且恶意,并且您的代码很容易反编译,那么这样的解决方案可能会损害您的业务。

Is there a certain (iPhone-specific?) reason that you need to have different SQLite databases for both versions of your app?

If not, you could implement a licensing mechanism with exchangeable keys that allowed you to compile your single codebases with just one file changed. At runtime, your app would check that file and either allow reduced or unlimited storage.
Added benefit (if iPhone-store supports such things) would be that it should be very simple to unlock the full version without losing data.

Of course, such a solution could harm your business if your customers are tech-savvy and malign and your code is easy to decompile.

紫南 2024-07-14 22:08:38

我已经对此进行了探索,似乎“下载试用版并通过网络升级”违反了应用程序商店的条款。 看来您确实需要商店中该应用程序的两个单独版本。 (参考本·戈特利布的条目)。 所以一个来源,两个发行版。

I have explored this and it seems that doing a "download a trial and upgrade it through the web" violates the terms of the app store. It seem you will really need two separate versions of the app in the store. (referencing back to Ben Gottlieb's entry). So one source, two distros.

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