8-bit mate
8-bit mate

Reputation: 85

Flash iOS applications

I am currently building an iOS application with flash CS5 and I would need some help with a couple of the features:

  1. Is it possible to add in-app purchases? If yes, how does that work?
  2. Is it possible to add iAd advertising to the app? If so, how? If not, is there any good alternative that works with flash?
  3. 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

Upvotes: 3

Views: 1204

Answers (2)

Saumitra R. Bhave
Saumitra R. Bhave

Reputation: 709

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.

  1. in app purchase. I have a sample at http://code.google.com/p/in-app-purchase-air-ios
  2. iAd. I have a sample at http://code.google.com/p/iad-air-ios/
  3. As others have already answered use local shared objects.

Upvotes: 0

J. Holmes
J. Holmes

Reputation: 18546

  1. 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.

  2. 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.

  3. 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-level File writing. Check out File.applicationStorageDirectory. For sensitive information that should be encrypted into into the EncryptedLocalStore 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.

Upvotes: 3

Related Questions