Skip to content

Latest commit

 

History

History
61 lines (44 loc) · 2.23 KB

getting-started.md

File metadata and controls

61 lines (44 loc) · 2.23 KB

Getting started

An example project can be found at react-native-cloud-fs-example.

This package is not released to npm (yet)...

npm install react-native-cloud-fs@https://github.com/npomfret/react-native-cloud-fs.git --save
react-native link react-native-cloud-fs

iOS

On the device, make sure iCloud Drive is enabled. And it's helpful to have the iClound Drive app available.

In xCode...

  • Add the following to ios/app-name/Info.plist (replacing app-name and package-name as appropriate):
<key>NSUbiquitousContainers</key>
<dict>
    <key>iCloud.package-name</key>
    <dict>
        <key>NSUbiquitousContainerIsDocumentScopePublic</key>
        <true/>
        <key>NSUbiquitousContainerSupportedFolderLevels</key>
        <string>One</string>
        <key>NSUbiquitousContainerName</key>
        <string>app-name</string>
    </dict>
</dict>
  • Enable iCloud:

alt tag

Android

Enable Google Drive API:

It's complicated! Here's a video of someone doing a similar thing for the Google Drive API demo.

  • Create a new project for your app (if you don't already have one)
    • Under Credentials, choose Create Credentials > OAth client ID
      • Choose Android and enter a name
      • enter your SHA1 fingerprint (use the keytool to find it, eg: keytool -exportcert -keystore path-to-debug-or-production-keystore -list -v)
      • enter your package name (found in your manifest file)
      • copy the OAuth client ID
  • Click Library, choose Drive API and enable it
    • Click Drive UI Integration
      • add the mandatory application icons
      • under Drive integration > Authentication
        • check Automatically show OAuth 2.0 consent screen when users open my application from Google Drive and enter your OAuth client ID
        • enter an Open URL

Add the following to your app/build.gradle in the dependecies section (you can change the version to suit your application):

compile ('com.google.android.gms:play-services-drive:10.2.0') {
    force = true;
}