hero_icloud Sale!

iCloud ANE by vitapoly

$25 $19.99

iCloud Storage enables iPhone and iPad apps to store documents and settings across iOS.

This implementation of the iCloud ANE supports Key-Value Stores.

Supported Platforms:
SKU: com.vitapoly.nativeextensions.iCloudANE. Category: , .

Product Description

iCloud Storage enables iPhone and iPad apps to store documents and settings across iOS.

This implementation of the iCloud ANE supports Key-Value Stores. Key-Value Data Storage is best for storage and sharing small amounts of data. The values are strings but using JSON we can store AS3 primitives and objects in the iCloud. The typical use case is to store save data and purchase information. In our applications, we use iCloud to store and restore save data across multiple user devices. So, if the user purchases a new iPad, their in-app consumables and save states will automatically transfer over from their old device. This is actually one of the conditions for approval in the AppStore if using consumables. Since Apple does not keep track of consumables, the developer must; the quickest way is to provide a restore button that reads purchased consumable data from iCloud tied to the user’s account and not the device.

Usage

Create a Unique Provision Profile

  1. Go to the iOS Provisioning Portal
  2. Create a new app id for your application, note the Bundle Identifier, we will need it later
  3. Check “Enable for iCloud”
  4. Create a new Development profile for the App ID you just created. Do the same for the Distribution profile.
  5. Download the profiles. You will be using this new development profile to sign your application.

Add Entitlements to app.xml

Open -app.xml. Replace [[TEAMID]] and [[BUNDLEID]] with your team ID:

Use For Development:

   <iPhone> 		
	<Entitlements>
            <![CDATA[
		<key>application-identifier</key>
		<string>[[TEAMID]].[[BUNDLEID]]</string>
		<key>com.apple.developer.ubiquity-container-identifiers</key>
		<array>
			<string>[[TEAMID]].[[BUNDLEID]]</string>
		</array>
		<key>com.apple.developer.ubiquity-kvstore-identifier</key>
		<string>[[TEAMID]].[[BUNDLEID]]</string>
		<key>get-task-allow</key>
		<true/>
		<key>keychain-access-groups</key>
		<array>
			<string>[[TEAMID]].*</string>
		</array>
		    ]]>
        </Entitlements>
   </iPhone>

For Distribution, be sure to change the signing profile to use distribution. Then change the entitlements key “get-tasks-allow” to false.

		<key>get-task-allow</key>
		<false/>

Using the Native Extension

var iCloud:iCloudANE = new iCloudANE();

// storing data
// so.data is some shared object data. but it can just be a generic string
iCloud.store("save", JSON.stringify(so.data));	

// retrieving data
var iCloudSave:String = iCloud.getStringForKey("save"); 

// restoring the data as an as3 object
so.data = JSON.parse(iCloudSave);

5.00 out of 5

2 reviews for iCloud ANE by vitapoly

  1. 5 out of 5

    Rating by on :

    I had some trouble launching the application at first. It wasn’t the fault of the ANE though. I had a typo in the my bundle ID. Thanks to vitapoly support for pointing that out for me. I was stuck for days but now it works fine. :-D

  2. 5 out of 5

    Rating by on :

    I had quite a difficult time implementing the necessary entitlements. Basically, the way I would do it is:

    1) The easiest way to locate the prefix you’re looking for is to take a peek into your Team Provisioning Profile. Use the Organizer > Devices > Provisioning Profiles pane to locate the provision file. Right-click iOS Team Provisioning Profile and choose Reveal Profile in Finder.
    2) Open the Provisioning File in TextEdit
    3) Search for “Entitlements”
    4) Copy-paste the content with the tags, except for “aps-environmentdevelopment”

    • out of 5

      Rating by on :

      Thank you for pointing this trick out. There are two provisioning profiles, one for development and another one for distribution. It is important to “copy and paste” from the right one. If the distribution provisioning settings are used when testing, the IPA will either not install or will not allow writing to iCloud. If development provision settings are used when submitting to Apple, your app might get rejected about 10 minutes after “successful” transmission through Application Loader; you will get an e-mail saying so. Good luck on your application, please post in the forums if you have any questions. Thanks.

Add Review

Add a review