React Native iCloud Account Status
React Native module to determine whether the current user’s iCloud account can be accessed.
Table of Contents
Getting started
Requirements
- iOS 8.0+
- The iCloud capability with CloudKit:
- Click on your target and then the Capabilities tab
- Turn on the iCloud capability
- Expand it and check the CloudKit option under Services
Mostly automatic installation
$ npm install react-native-icloud-account-status --save
- React Native 0.60+:
$ cd ios && pod install
React Native <0.60:$ react-native link react-native-icloud-account-status
Manual installation
$ npm install react-native-icloud-account-status --save
- In XCode, in the project navigator, right click
Libraries
➜Add Files to [your project's name]
- Go to
node_modules
➜react-native-icloud-account-status
and addRNIcloudAccountStatus.xcodeproj
- In XCode, in the project navigator, select your project. Add
libRNIcloudAccountStatus.a
to your project'sBuild Phases
➜Link Binary With Libraries
- Run your project (
Cmd+R
)
Usage
; iCloudAccountStatus ;
API
Constants
STATUS_COULD_NOT_DETERMINE
STATUS_AVAILABLE
STATUS_RESTRICTED
STATUS_NO_ACCOUNT
Methods
getStatus()
Gets the current user's iCloud account status.
Returns a Promise
that resolves to a string of one of the following:
'couldNotDetermine'
'available'
'restricted'
'noAccount'
For more information about each status, see CKAccountStatus
at the Apple Developer Documentation.
License
Copyright (c) 2019 Blockfirm AB
This project is licensed under the MIT License. See LICENSE for full license text.