amirrajan / rubymotion-applied

RubyMotion documentation provided by the community. Submit a pull request to the docs for a free one year indie subscription.
Apache License 2.0
49 stars 9 forks source link

Save to iCloud sample app #98

Open amirrajan opened 6 years ago

amirrajan commented 6 years ago

A sample app showing how to save to iCloud.

amirrajan commented 6 years ago

This might help get you started on the Rakefile front. You might not need all of this and they’ll be different since photos are an existing format.


app.info_plist['CFBundleDocumentTypes'] = [
{
  'CFBundleTypeName' => 'Mimic File',
  'LSItemContentTypes' => ["#{app.identifier}.mimic"],
  'LSHandlerRank' => 'Owner'
}]
app.info_plist['UTExportedTypeDeclarations'] = [
{

  'UTTypeConformsTo' => ['public.json'],
  'UTTypeDescription' => 'Mimic File',
  'UTTypeIdentifier' => "#{app.identifier}.mimic",
  'UTTypeTagSpecification' => {
    'public.filename-extension' => 'mimic',
    'public.mime-type' => 'application/json'
  }
}
]
app.info_plist['NSUbiquitousContainers'] = {
"iCloud.#{app.identifier}" => {
  'NSUbiquitousContainerIsDocumentScopePublic' => true
}
}

app.entitlements['com.apple.developer.icloud-container-identifiers'] = ["iCloud.#{app.identifier}"]
app.entitlements['com.apple.developer.icloud-services'] = ['CloudDocuments']
app.entitlements['com.apple.developer.ubiquity-container-identifiers'] = ["iCloud.#{app.identifier}"]```
astechishin commented 6 years ago

I am working on a sample CLoudKit app, would this help?

amirrajan commented 6 years ago

@tmillican may have something to contribute to this too.