Flash iOS 应用程序
我目前正在使用 flash CS5 构建 iOS 应用程序,我需要一些有关以下功能的帮助:
- 是否可以添加应用内购买?如果是,那是如何运作的?
- 是否可以在应用程序中添加 iAd 广告?如果是这样,怎么办?如果没有,有什么好的替代方案可以与闪光灯一起使用吗?
- 如何从应用程序内保存数据,以便在用户重新启动应用程序甚至设备(例如床头板等)时数据会被吃掉?
非常感谢任何帮助! :D
I am currently building an iOS application with flash CS5 and I would need some help with a couple of the features:
- Is it possible to add in-app purchases? If yes, how does that work?
- Is it possible to add iAd advertising to the app? If so, how? If not, is there any good alternative that works with flash?
- How can I save data from within the app so it will be there eaten if the user restarts the app and even the device (like for a headboard and such)?
Any help is highly appreciated!!! :D
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
如果是几个月前就好了。那么答案将是明确的不。然而,目前的答案是“也许”(或者如果您是乐观主义者,“可能”)。随着 Air 3.0 的发布,它现在支持本机扩展。这些扩展是本机代码,周围有一个包装 API,以便可以在 Air 应用程序中进行编译和调用。
事实上,我决定在研究这个答案时快速环顾四周,并找到了一个存储库,看起来有人已经实现了通过 ANE 进行应用内购买。但我还没有亲自测试过这个扩展,但这可能是了解它是如何实现的一个很好的起点。
您之所以找不到太多有关 ANE 的信息,是因为它们最近才在上个月发生的 Air 3.0 更新中得到支持。目前 Flash CS5(或 5.5)或 Flash Builder 4.5 不支持它们。它们在 Flash Builder 4.6 中受支持,目前处于封闭测试阶段。不过你也许还能潜入,而且应该很快就会发布。
最大的“缺点”是这些扩展需要以您的目标设备的本机格式开发。所以这意味着,如果你想制作一个 iOS 扩展,那么你可以在 Mac 上用 Objective-C 和 xcode 编写它。
与之前的答案几乎相同。使用 ANE 应该可以实现。但我还没有找到任何人这样做的例子。
将数据/状态保存到设备非常简单。您需要查看
SharedObject.getLocal()
方法(如果您想要 LSO)。或者您可以只使用低级File
编写。查看File.applicationStorageDirectory
。对于应加密到 < 的敏感信息code>EncryptedLocalStore 类,我相信 iOS 支持该类,但 Android 不支持。所有这些都应该为您提供在应用程序会话之间保存数据的好方法。
If it were a few months ago. Then answer would be an unequivocal no. However, presently, the answer is "perhaps" (or if you are an optimist, "probably"). With the release of Air 3.0, it now supports Native Extensions. These extensions are native code that have a wrapper API around them so that they can be compiled in with and called from an Air application.
In fact, I decided to look around real quick while researching for this answer and found a repo where it looks like somebody has implemented in-app purchases via a ANE. But I haven't tested this extension personally, but it may be a good starting point to see how it is implemented.
The reason you wont find too much information about ANE's yet is because they were only recently supported in the Air 3.0 update that happened last month. They are currently unsupported in Flash CS5 (or 5.5) or Flash Builder 4.5. They are supported in Flash Builder 4.6, which is currently in a closed beta. But you might be able to sneak in still, and it should be released soon.
The biggest "drawback" is that these extensions need to be developed in the native format for the device you are targeting. So that means, if you want to make an iOS extension, then you are writing it in Objective-C and xcode on a mac.
Pretty much the same answer as before. It should be possible with a ANE. But I haven't found any examples of anybody doing it yet.
It is very simple to save data/state to the device. You'll want to look into the
SharedObject.getLocal()
method if you want to the LSO. Or you can just use low-levelFile
writing. Check outFile.applicationStorageDirectory
. For sensitive information that should be encrypted into into theEncryptedLocalStore
class, which I believe is supported on iOS but not on Android.All of these should provide a good way for you to persist data between application sessions.
借助 AIR 3,您现在可以使用本机扩展来调用本机平台代码,以实现 AIR Actionscript API 未提供的功能。回答您的问题。
With AIR 3 you can now use native extensions to call into the native platform code to achieve the functionality not provided by AIR Actionscript APIs. To answer your questions.