diff --git a/README.md b/README.md
index 0fac16ab..0f8a5019 100644
--- a/README.md
+++ b/README.md
@@ -17,8 +17,8 @@ Installation
Pick one of these two commands:
```
-phonegap local plugin add https://github.com/benjie/phonegap-parse-plugin --variable APP_ID=PARSE_APP_ID --variable CLIENT_KEY=PARSE_CLIENT_KEY
-cordova plugin add https://github.com/benjie/phonegap-parse-plugin --variable APP_ID=PARSE_APP_ID --variable CLIENT_KEY=PARSE_CLIENT_KEY
+phonegap local plugin add https://github.com/avivais/phonegap-parse-plugin --variable APP_ID=PARSE_APP_ID --variable CLIENT_KEY=PARSE_CLIENT_KEY
+cordova plugin add https://github.com/avivais/phonegap-parse-plugin --variable APP_ID=PARSE_APP_ID --variable CLIENT_KEY=PARSE_CLIENT_KEY
```
Initial Setup
@@ -128,6 +128,15 @@ And add your application name to `AndroidManifest.xml`:
...
```
+Parse version
+-------------
+
+Parse iOS - 1.8.3
+
+Parse Android - 1.9.0
+
+Parse WP8 - ...
+
Compatibility
-------------
diff --git a/src/ios/Frameworks/Bolts.framework/Info.plist b/src/ios/Frameworks/Bolts.framework/Info.plist
new file mode 100644
index 00000000..4538c7e3
Binary files /dev/null and b/src/ios/Frameworks/Bolts.framework/Info.plist differ
diff --git a/src/ios/Frameworks/Bolts.framework/Modules/module.modulemap b/src/ios/Frameworks/Bolts.framework/Modules/module.modulemap
new file mode 100644
index 00000000..3c92a170
--- /dev/null
+++ b/src/ios/Frameworks/Bolts.framework/Modules/module.modulemap
@@ -0,0 +1,15 @@
+framework module Bolts {
+ umbrella header "Bolts.h"
+
+ export *
+ module * { export * }
+
+ explicit module BFAppLinkResolving {
+ header "BFAppLinkResolving.h"
+ export *
+ }
+ explicit module BFWebViewAppLinkResolver {
+ header "BFWebViewAppLinkResolver.h"
+ export *
+ }
+}
diff --git a/src/ios/Frameworks/Bolts.framework/Versions/A/Bolts b/src/ios/Frameworks/Bolts.framework/Versions/A/Bolts
index 2f6ba68d..c8d51f17 100644
Binary files a/src/ios/Frameworks/Bolts.framework/Versions/A/Bolts and b/src/ios/Frameworks/Bolts.framework/Versions/A/Bolts differ
diff --git a/src/ios/Frameworks/Bolts.framework/Versions/A/Headers/BFAppLink.h b/src/ios/Frameworks/Bolts.framework/Versions/A/Headers/BFAppLink.h
index 5e51acd8..aa89efc2 100644
--- a/src/ios/Frameworks/Bolts.framework/Versions/A/Headers/BFAppLink.h
+++ b/src/ios/Frameworks/Bolts.framework/Versions/A/Headers/BFAppLink.h
@@ -21,10 +21,10 @@ FOUNDATION_EXPORT NSString *const BFAppLinkVersion;
/*!
Creates a BFAppLink with the given list of BFAppLinkTargets and target URL.
-
+
Generally, this will only be used by implementers of the BFAppLinkResolving protocol,
as these implementers will produce App Link metadata for a given URL.
-
+
@param sourceURL the URL from which this App Link is derived
@param targets an ordered list of BFAppLinkTargets for this platform derived
from App Link metadata.
diff --git a/src/ios/Frameworks/Bolts.framework/Versions/A/Headers/BFAppLinkResolving.h b/src/ios/Frameworks/Bolts.framework/Versions/A/Headers/BFAppLinkResolving.h
index baa1451e..b67bdba1 100644
--- a/src/ios/Frameworks/Bolts.framework/Versions/A/Headers/BFAppLinkResolving.h
+++ b/src/ios/Frameworks/Bolts.framework/Versions/A/Headers/BFAppLinkResolving.h
@@ -21,7 +21,7 @@
/*!
Asynchronously resolves App Link data for a given URL.
-
+
@param url The URL to resolve into an App Link.
@returns A BFTask that will return a BFAppLink for the given URL.
*/
diff --git a/src/ios/Frameworks/Bolts.framework/Versions/A/Headers/BFAppLinkReturnToRefererController.h b/src/ios/Frameworks/Bolts.framework/Versions/A/Headers/BFAppLinkReturnToRefererController.h
index 22648d44..d19465ee 100644
--- a/src/ios/Frameworks/Bolts.framework/Versions/A/Headers/BFAppLinkReturnToRefererController.h
+++ b/src/ios/Frameworks/Bolts.framework/Versions/A/Headers/BFAppLinkReturnToRefererController.h
@@ -38,7 +38,7 @@
/*!
A controller class that implements default behavior for a BFAppLinkReturnToRefererView, including
- the ability to display the view above the navigation bar for navigation-bsaed apps.
+ the ability to display the view above the navigation bar for navigation-based apps.
*/
@interface BFAppLinkReturnToRefererController : NSObject
@@ -75,7 +75,7 @@
- (void)showViewForRefererAppLink:(BFAppLink *)refererAppLink;
/*!
- Shows the BFAppLinkReturnToRefererView with referer information extracted from the specified URL.
+ Shows the BFAppLinkReturnToRefererView with referer information extracted from the specified URL.
If nil or missing referer App Link data, the view will not be displayed. */
- (void)showViewForRefererURL:(NSURL *)url;
diff --git a/src/ios/Frameworks/Bolts.framework/Versions/A/Headers/BFAppLinkReturnToRefererView.h b/src/ios/Frameworks/Bolts.framework/Versions/A/Headers/BFAppLinkReturnToRefererView.h
index e3af9408..d20f73a2 100644
--- a/src/ios/Frameworks/Bolts.framework/Versions/A/Headers/BFAppLinkReturnToRefererView.h
+++ b/src/ios/Frameworks/Bolts.framework/Versions/A/Headers/BFAppLinkReturnToRefererView.h
@@ -16,11 +16,11 @@
@class BFAppLinkReturnToRefererView;
@class BFURL;
-typedef enum BFIncludeStatusBarInSize {
- BFIncludeStatusBarInSizeNever,
- BFIncludeStatusBarInSizeIOS7AndLater,
- BFIncludeStatusBarInSizeAlways,
-} BFIncludeStatusBarInSize;
+typedef NS_ENUM(NSUInteger, BFIncludeStatusBarInSize) {
+ BFIncludeStatusBarInSizeNever,
+ BFIncludeStatusBarInSizeIOS7AndLater,
+ BFIncludeStatusBarInSizeAlways,
+};
/*!
Protocol that a class can implement in order to be notified when the user has navigated back
@@ -65,7 +65,7 @@ typedef enum BFIncludeStatusBarInSize {
/*!
Indicates whether to extend the size of the view to include the current status bar
size, for use in scenarios where the view might extend under the status bar on iOS 7 and
- above; this property has no effect on earlier versions of iOS.
+ above; this property has no effect on earlier versions of iOS.
*/
@property (nonatomic, assign) BFIncludeStatusBarInSize includeStatusBarInSize;
@@ -74,18 +74,4 @@ typedef enum BFIncludeStatusBarInSize {
*/
@property (nonatomic, assign) BOOL closed;
-/*!
- For apps that use a navigation controller, this method allows for displaying the view as
- a banner above the navigation bar of the navigation controller. It will listen for orientation
- change and other events to ensure it stays properly positioned above the nevigation bar.
- If this method is called from, e.g., viewDidAppear, its counterpart, detachFromMainWindow should
- be called from, e.g., viewWillDisappear.
- */
-//- (void)attachToMainWindowAboveNavigationController:(UINavigationController *)navigationController view:(UIView *)view;
-
-/*!
- Indicates that the view should no longer position itself above a navigation bar.
- */
-//- (void)detachFromMainWindow;
-
@end
diff --git a/src/ios/Frameworks/Bolts.framework/Versions/A/Headers/BFCancellationToken.h b/src/ios/Frameworks/Bolts.framework/Versions/A/Headers/BFCancellationToken.h
new file mode 100644
index 00000000..90a20d72
--- /dev/null
+++ b/src/ios/Frameworks/Bolts.framework/Versions/A/Headers/BFCancellationToken.h
@@ -0,0 +1,38 @@
+/*
+ * Copyright (c) 2014, Facebook, Inc.
+ * All rights reserved.
+ *
+ * This source code is licensed under the BSD-style license found in the
+ * LICENSE file in the root directory of this source tree. An additional grant
+ * of patent rights can be found in the PATENTS file in the same directory.
+ *
+ */
+
+#import
+
+#import
+
+/*!
+ A block that will be called when a token is cancelled.
+ */
+typedef void(^BFCancellationBlock)();
+
+/*!
+ The consumer view of a CancellationToken.
+ Propagates notification that operations should be canceled.
+ A BFCancellationToken has methods to inspect whether the token has been cancelled.
+ */
+@interface BFCancellationToken : NSObject
+
+/*!
+ Whether cancellation has been requested for this token source.
+ */
+@property (nonatomic, assign, readonly, getter=isCancellationRequested) BOOL cancellationRequested;
+
+/*!
+ Register a block to be notified when the token is cancelled.
+ If the token is already cancelled the delegate will be notified immediately.
+ */
+- (BFCancellationTokenRegistration *)registerCancellationObserverWithBlock:(BFCancellationBlock)block;
+
+@end
diff --git a/src/ios/Frameworks/Bolts.framework/Versions/A/Headers/BFCancellationTokenRegistration.h b/src/ios/Frameworks/Bolts.framework/Versions/A/Headers/BFCancellationTokenRegistration.h
new file mode 100644
index 00000000..3e7b711e
--- /dev/null
+++ b/src/ios/Frameworks/Bolts.framework/Versions/A/Headers/BFCancellationTokenRegistration.h
@@ -0,0 +1,25 @@
+/*
+ * Copyright (c) 2014, Facebook, Inc.
+ * All rights reserved.
+ *
+ * This source code is licensed under the BSD-style license found in the
+ * LICENSE file in the root directory of this source tree. An additional grant
+ * of patent rights can be found in the PATENTS file in the same directory.
+ *
+ */
+
+#import
+
+/*!
+ Represents the registration of a cancellation observer with a cancellation token.
+ Can be used to unregister the observer at a later time.
+ */
+@interface BFCancellationTokenRegistration : NSObject
+
+/*!
+ Removes the cancellation observer registered with the token
+ and releases all resources associated with this registration.
+ */
+- (void)dispose;
+
+@end
diff --git a/src/ios/Frameworks/Bolts.framework/Versions/A/Headers/BFCancellationTokenSource.h b/src/ios/Frameworks/Bolts.framework/Versions/A/Headers/BFCancellationTokenSource.h
new file mode 100644
index 00000000..bd6e7a1e
--- /dev/null
+++ b/src/ios/Frameworks/Bolts.framework/Versions/A/Headers/BFCancellationTokenSource.h
@@ -0,0 +1,56 @@
+/*
+ * Copyright (c) 2014, Facebook, Inc.
+ * All rights reserved.
+ *
+ * This source code is licensed under the BSD-style license found in the
+ * LICENSE file in the root directory of this source tree. An additional grant
+ * of patent rights can be found in the PATENTS file in the same directory.
+ *
+ */
+
+#import
+
+@class BFCancellationToken;
+
+/*!
+ BFCancellationTokenSource represents the producer side of a CancellationToken.
+ Signals to a CancellationToken that it should be canceled.
+ It is a cancellation token that also has methods
+ for changing the state of a token by cancelling it.
+ */
+@interface BFCancellationTokenSource : NSObject
+
+/*!
+ Creates a new cancellation token source.
+ */
++ (instancetype)cancellationTokenSource;
+
+/*!
+ The cancellation token associated with this CancellationTokenSource.
+ */
+@property (nonatomic, strong, readonly) BFCancellationToken *token;
+
+/*!
+ Whether cancellation has been requested for this token source.
+ */
+@property (nonatomic, assign, readonly, getter=isCancellationRequested) BOOL cancellationRequested;
+
+/*!
+ Cancels the token if it has not already been cancelled.
+ */
+- (void)cancel;
+
+/*!
+ Schedules a cancel operation on this CancellationTokenSource after the specified number of milliseconds.
+ @param millis The number of milliseconds to wait before completing the returned task.
+ If delay is `0` the cancel is executed immediately. If delay is `-1` any scheduled cancellation is stopped.
+ */
+- (void)cancelAfterDelay:(int)millis;
+
+/*!
+ Releases all resources associated with this token source,
+ including disposing of all registrations.
+ */
+- (void)dispose;
+
+@end
diff --git a/src/ios/Frameworks/Bolts.framework/Versions/A/Headers/BFDefines.h b/src/ios/Frameworks/Bolts.framework/Versions/A/Headers/BFDefines.h
new file mode 100644
index 00000000..cf7dcdf3
--- /dev/null
+++ b/src/ios/Frameworks/Bolts.framework/Versions/A/Headers/BFDefines.h
@@ -0,0 +1,18 @@
+/*
+ * Copyright (c) 2014, Facebook, Inc.
+ * All rights reserved.
+ *
+ * This source code is licensed under the BSD-style license found in the
+ * LICENSE file in the root directory of this source tree. An additional grant
+ * of patent rights can be found in the PATENTS file in the same directory.
+ *
+ */
+
+#import
+
+#if __has_feature(objc_generics) || __has_extension(objc_generics)
+# define BF_GENERIC(type)
+#else
+# define BF_GENERIC(type)
+# define BFGenericType id
+#endif
diff --git a/src/ios/Frameworks/Bolts.framework/Versions/A/Headers/BFMeasurementEvent.h b/src/ios/Frameworks/Bolts.framework/Versions/A/Headers/BFMeasurementEvent.h
index 7a9948c3..b3173fc2 100644
--- a/src/ios/Frameworks/Bolts.framework/Versions/A/Headers/BFMeasurementEvent.h
+++ b/src/ios/Frameworks/Bolts.framework/Versions/A/Headers/BFMeasurementEvent.h
@@ -19,15 +19,14 @@ FOUNDATION_EXPORT NSString *const BFMeasurementEventNameKey;
/*! The dictionary field for the arguments of the event */
FOUNDATION_EXPORT NSString *const BFMeasurementEventArgsKey;
-
/*! Bolts Events raised by BFMeasurementEvent for Applink */
/*!
- The name of the event posted when [BFURL URLWithURL:] is called successfully. This represents the successful parsing of an app link URL.
+ The name of the event posted when [BFURL URLWithURL:] is called successfully. This represents the successful parsing of an app link URL.
*/
FOUNDATION_EXPORT NSString *const BFAppLinkParseEventName;
-/*!
- The name of the event posted when [BFURL URLWithInboundURL:] is called successfully.
+/*!
+ The name of the event posted when [BFURL URLWithInboundURL:] is called successfully.
This represents parsing an inbound app link URL from a different application
*/
FOUNDATION_EXPORT NSString *const BFAppLinkNavigateInEventName;
@@ -35,9 +34,9 @@ FOUNDATION_EXPORT NSString *const BFAppLinkNavigateInEventName;
/*! The event raised when the user navigates from your app to other apps */
FOUNDATION_EXPORT NSString *const BFAppLinkNavigateOutEventName;
-/*!
+/*!
The event raised when the user navigates out from your app and back to the referrer app.
- e.g when the user leaves your app after tapping the back-to-referrer navigation bar
+ e.g when the user leaves your app after tapping the back-to-referrer navigation bar
*/
FOUNDATION_EXPORT NSString *const BFAppLinkNavigateBackToReferrerEventName;
diff --git a/src/ios/Frameworks/Bolts.framework/Versions/A/Headers/BFTask.h b/src/ios/Frameworks/Bolts.framework/Versions/A/Headers/BFTask.h
index 2ac84d60..827071d5 100644
--- a/src/ios/Frameworks/Bolts.framework/Versions/A/Headers/BFTask.h
+++ b/src/ios/Frameworks/Bolts.framework/Versions/A/Headers/BFTask.h
@@ -10,26 +10,39 @@
#import
-@class BFExecutor;
-@class BFTask;
+#import
+#import
/*!
- A block that can act as a continuation for a task.
+ Error domain used if there was multiple errors on .
+ */
+extern NSString *const BFTaskErrorDomain;
+
+/*!
+ An exception that is thrown if there was multiple exceptions on .
*/
-typedef id(^BFContinuationBlock)(BFTask *task);
+extern NSString *const BFTaskMultipleExceptionsException;
+
+@class BFExecutor;
+@class BFTask;
/*!
The consumer view of a Task. A BFTask has methods to
inspect the state of the task, and to add continuations to
be run once the task is complete.
*/
-@interface BFTask : NSObject
+@interface BFTask BF_GENERIC(__covariant BFGenericType) : NSObject
+
+/*!
+ A block that can act as a continuation for a task.
+ */
+typedef id(^BFContinuationBlock)(BFTask BF_GENERIC(BFGenericType) *task);
/*!
Creates a task that is already completed with the given result.
@param result The result for the task.
*/
-+ (instancetype)taskWithResult:(id)result;
++ (instancetype)taskWithResult:(BFGenericType)result;
/*!
Creates a task that is already completed with the given error.
@@ -55,6 +68,14 @@ typedef id(^BFContinuationBlock)(BFTask *task);
*/
+ (instancetype)taskForCompletionOfAllTasks:(NSArray *)tasks;
+/*!
+ Returns a task that will be completed once all of the input tasks have completed.
+ If all tasks complete successfully without being faulted or cancelled the result will be
+ an `NSArray` of all task results in the order they were provided.
+ @param tasks An `NSArray` of the tasks to use as an input.
+ */
++ (instancetype)taskForCompletionOfAllTasksWithResults:(NSArray *)tasks;
+
/*!
Returns a task that will be completed a certain amount of time in the future.
@param millis The approximate number of milliseconds to wait before the
@@ -62,6 +83,15 @@ typedef id(^BFContinuationBlock)(BFTask *task);
*/
+ (instancetype)taskWithDelay:(int)millis;
+/*!
+ Returns a task that will be completed a certain amount of time in the future.
+ @param millis The approximate number of milliseconds to wait before the
+ task will be finished (with result == nil).
+ @param token The cancellation token (optional).
+ */
++ (instancetype)taskWithDelay:(int)millis
+ cancellationToken:(BFCancellationToken *)token;
+
/*!
Returns a task that will be completed after the given block completes with
the specified executor.
@@ -80,8 +110,7 @@ typedef id(^BFContinuationBlock)(BFTask *task);
/*!
The result of a successful task.
*/
-@property (nonatomic, strong, readonly) id result;
-
+@property (nonatomic, strong, readonly) BFGenericType result;
/*!
The error of a failed task.
@@ -96,12 +125,17 @@ typedef id(^BFContinuationBlock)(BFTask *task);
/*!
Whether this task has been cancelled.
*/
-@property (nonatomic, assign, readonly, getter = isCancelled) BOOL cancelled;
+@property (nonatomic, assign, readonly, getter=isCancelled) BOOL cancelled;
+
+/*!
+ Whether this task has completed due to an error or exception.
+ */
+@property (nonatomic, assign, readonly, getter=isFaulted) BOOL faulted;
/*!
Whether this task has completed.
*/
-@property (nonatomic, assign, readonly, getter = isCompleted) BOOL completed;
+@property (nonatomic, assign, readonly, getter=isCompleted) BOOL completed;
/*!
Enqueues the given block to be run once this task is complete.
@@ -116,6 +150,21 @@ typedef id(^BFContinuationBlock)(BFTask *task);
*/
- (instancetype)continueWithBlock:(BFContinuationBlock)block;
+/*!
+ Enqueues the given block to be run once this task is complete.
+ This method uses a default execution strategy. The block will be
+ run on the thread where the previous task completes, unless the
+ the stack depth is too deep, in which case it will be run on a
+ dispatch queue with default priority.
+ @param block The block to be run once this task is complete.
+ @param cancellationToken The cancellation token (optional).
+ @returns A task that will be completed after block has run.
+ If block returns a BFTask, then the task returned from
+ this method will not be completed until that task is completed.
+ */
+- (instancetype)continueWithBlock:(BFContinuationBlock)block
+ cancellationToken:(BFCancellationToken *)cancellationToken;
+
/*!
Enqueues the given block to be run once this task is complete.
@param executor A BFExecutor responsible for determining how the
@@ -126,7 +175,20 @@ typedef id(^BFContinuationBlock)(BFTask *task);
this method will not be completed until that task is completed.
*/
- (instancetype)continueWithExecutor:(BFExecutor *)executor
- withBlock:(BFContinuationBlock)block;
+ withBlock:(BFContinuationBlock)block;
+/*!
+ Enqueues the given block to be run once this task is complete.
+ @param executor A BFExecutor responsible for determining how the
+ continuation block will be run.
+ @param block The block to be run once this task is complete.
+ @param cancellationToken The cancellation token (optional).
+ @returns A task that will be completed after block has run.
+ If block returns a BFTask, then the task returned from
+ his method will not be completed until that task is completed.
+ */
+- (instancetype)continueWithExecutor:(BFExecutor *)executor
+ block:(BFContinuationBlock)block
+ cancellationToken:(BFCancellationToken *)cancellationToken;
/*!
Identical to continueWithBlock:, except that the block is only run
@@ -140,6 +202,35 @@ typedef id(^BFContinuationBlock)(BFTask *task);
*/
- (instancetype)continueWithSuccessBlock:(BFContinuationBlock)block;
+/*!
+ Identical to continueWithBlock:, except that the block is only run
+ if this task did not produce a cancellation, error, or exception.
+ If it did, then the failure will be propagated to the returned
+ task.
+ @param block The block to be run once this task is complete.
+ @param cancellationToken The cancellation token (optional).
+ @returns A task that will be completed after block has run.
+ If block returns a BFTask, then the task returned from
+ this method will not be completed until that task is completed.
+ */
+- (instancetype)continueWithSuccessBlock:(BFContinuationBlock)block
+ cancellationToken:(BFCancellationToken *)cancellationToken;
+
+/*!
+ Identical to continueWithExecutor:withBlock:, except that the block
+ is only run if this task did not produce a cancellation, error, or
+ exception. If it did, then the failure will be propagated to the
+ returned task.
+ @param executor A BFExecutor responsible for determining how the
+ continuation block will be run.
+ @param block The block to be run once this task is complete.
+ @returns A task that will be completed after block has run.
+ If block returns a BFTask, then the task returned from
+ this method will not be completed until that task is completed.
+ */
+- (instancetype)continueWithExecutor:(BFExecutor *)executor
+ withSuccessBlock:(BFContinuationBlock)block;
+
/*!
Identical to continueWithExecutor:withBlock:, except that the block
is only run if this task did not produce a cancellation, error, or
@@ -148,12 +239,14 @@ typedef id(^BFContinuationBlock)(BFTask *task);
@param executor A BFExecutor responsible for determining how the
continuation block will be run.
@param block The block to be run once this task is complete.
+ @param cancellationToken The cancellation token (optional).
@returns A task that will be completed after block has run.
If block returns a BFTask, then the task returned from
this method will not be completed until that task is completed.
*/
- (instancetype)continueWithExecutor:(BFExecutor *)executor
- withSuccessBlock:(BFContinuationBlock)block;
+ successBlock:(BFContinuationBlock)block
+ cancellationToken:(BFCancellationToken *)cancellationToken;
/*!
Waits until this operation is completed.
diff --git a/src/ios/Frameworks/Bolts.framework/Versions/A/Headers/BFTaskCompletionSource.h b/src/ios/Frameworks/Bolts.framework/Versions/A/Headers/BFTaskCompletionSource.h
index d0ea545d..23366c18 100644
--- a/src/ios/Frameworks/Bolts.framework/Versions/A/Headers/BFTaskCompletionSource.h
+++ b/src/ios/Frameworks/Bolts.framework/Versions/A/Headers/BFTaskCompletionSource.h
@@ -10,14 +10,16 @@
#import
-@class BFTask;
+#import
+
+@class BFTask BF_GENERIC(BFGenericType);
/*!
A BFTaskCompletionSource represents the producer side of tasks.
It is a task that also has methods for changing the state of the
task by settings its completion values.
*/
-@interface BFTaskCompletionSource : NSObject
+@interface BFTaskCompletionSource BF_GENERIC(__covariant BFGenericType) : NSObject
/*!
Creates a new unfinished task.
@@ -27,14 +29,14 @@
/*!
The task associated with this TaskCompletionSource.
*/
-@property (nonatomic, retain, readonly) BFTask *task;
+@property (nonatomic, strong, readonly) BFTask BF_GENERIC(BFGenericType) *task;
/*!
Completes the task by setting the result.
Attempting to set this for a completed task will raise an exception.
@param result The result of the task.
*/
-- (void)setResult:(id)result;
+- (void)setResult:(BFGenericType)result;
/*!
Completes the task by setting the error.
@@ -60,7 +62,7 @@
Sets the result of the task if it wasn't already completed.
@returns whether the new value was set.
*/
-- (BOOL)trySetResult:(id)result;
+- (BOOL)trySetResult:(BFGenericType)result;
/*!
Sets the error of the task if it wasn't already completed.
diff --git a/src/ios/Frameworks/Bolts.framework/Versions/A/Headers/BFURL.h b/src/ios/Frameworks/Bolts.framework/Versions/A/Headers/BFURL.h
index f269e2d1..924c91d4 100644
--- a/src/ios/Frameworks/Bolts.framework/Versions/A/Headers/BFURL.h
+++ b/src/ios/Frameworks/Bolts.framework/Versions/A/Headers/BFURL.h
@@ -10,8 +10,6 @@
#import
-
-
@class BFAppLink;
/*!
@@ -29,12 +27,12 @@
*/
+ (BFURL *)URLWithURL:(NSURL *)url;
-/*!
- Creates a link target from a raw URL received from an external application. This is typically called from the app delegate's
+/*!
+ Creates a link target from a raw URL received from an external application. This is typically called from the app delegate's
application:openURL:sourceApplication:annotation: and will post the BFAppLinkNavigateInEventName measurement event.
@param url The instance of `NSURL` to create BFURL from.
@param sourceApplication the bundle ID of the app that is requesting your app to open the URL. The same sourceApplication in application:openURL:sourceApplication:annotation:
-*/
+ */
+ (BFURL *)URLWithInboundURL:(NSURL *)url sourceApplication:(NSString *)sourceApplication;
/*!
diff --git a/src/ios/Frameworks/Bolts.framework/Versions/A/Headers/BFWebViewAppLinkResolver.h b/src/ios/Frameworks/Bolts.framework/Versions/A/Headers/BFWebViewAppLinkResolver.h
index cffa5292..3782ae2c 100644
--- a/src/ios/Frameworks/Bolts.framework/Versions/A/Headers/BFWebViewAppLinkResolver.h
+++ b/src/ios/Frameworks/Bolts.framework/Versions/A/Headers/BFWebViewAppLinkResolver.h
@@ -16,7 +16,7 @@
A reference implementation for an App Link resolver that uses a hidden UIWebView
to parse the HTML containing App Link metadata.
*/
-@interface BFWebViewAppLinkResolver : NSObject
+@interface BFWebViewAppLinkResolver : NSObject
/*!
Gets the instance of a BFWebViewAppLinkResolver.
diff --git a/src/ios/Frameworks/Bolts.framework/Versions/A/Headers/Bolts.h b/src/ios/Frameworks/Bolts.framework/Versions/A/Headers/Bolts.h
index e22bdd54..c75d937e 100644
--- a/src/ios/Frameworks/Bolts.framework/Versions/A/Headers/Bolts.h
+++ b/src/ios/Frameworks/Bolts.framework/Versions/A/Headers/Bolts.h
@@ -9,18 +9,24 @@
*/
#import
+#import
+#import
+#import
+#import
#import
#import
#import
-#if TARGET_OS_IPHONE
+#if __has_include() && TARGET_OS_IPHONE
#import
#import
-#import
-#import
-#import
+#import
#import
#import
+#import
+#import
+#import
+#import
#endif
/*! @abstract 80175001: There were multiple errors. */
diff --git a/src/ios/Frameworks/Bolts.framework/Versions/A/Headers/BoltsVersion.h b/src/ios/Frameworks/Bolts.framework/Versions/A/Headers/BoltsVersion.h
index 24e802ed..6c12f864 100644
--- a/src/ios/Frameworks/Bolts.framework/Versions/A/Headers/BoltsVersion.h
+++ b/src/ios/Frameworks/Bolts.framework/Versions/A/Headers/BoltsVersion.h
@@ -1 +1 @@
-#define BOLTS_VERSION @"1.1.3"
+#define BOLTS_VERSION @"1.2.2"
diff --git a/src/ios/Frameworks/Parse.framework/Headers/PFACL.h b/src/ios/Frameworks/Parse.framework/Headers/PFACL.h
index aa05ebbb..a952585b 100644
--- a/src/ios/Frameworks/Parse.framework/Headers/PFACL.h
+++ b/src/ios/Frameworks/Parse.framework/Headers/PFACL.h
@@ -1,11 +1,18 @@
-//
-// PFACL.h
-//
-// Copyright 2011-present Parse Inc. All rights reserved.
-//
+/**
+ * Copyright (c) 2015-present, Parse, LLC.
+ * All rights reserved.
+ *
+ * This source code is licensed under the BSD-style license found in the
+ * LICENSE file in the root directory of this source tree. An additional grant
+ * of patent rights can be found in the PATENTS file in the same directory.
+ */
#import
+#import
+
+PF_ASSUME_NONNULL_BEGIN
+
@class PFRole;
@class PFUser;
@@ -26,14 +33,14 @@
@returns Returns a new `PFACL`.
*/
-+ (PFACL *)ACL;
++ (instancetype)ACL;
/*!
@abstract Creates an ACL where only the provided user has access.
@param user The user to assign access.
*/
-+ (PFACL *)ACLWithUser:(PFUser *)user;
++ (instancetype)ACLWithUser:(PFUser *)user;
///--------------------------------------
/// @name Controlling Public Access
@@ -250,6 +257,8 @@
- If `NO`, the provided `acl` will be used without modification.
- If `acl` is `nil`, this value is ignored.
*/
-+ (void)setDefaultACL:(PFACL *)acl withAccessForCurrentUser:(BOOL)currentUserAccess;
++ (void)setDefaultACL:(PF_NULLABLE PFACL *)acl withAccessForCurrentUser:(BOOL)currentUserAccess;
@end
+
+PF_ASSUME_NONNULL_END
diff --git a/src/ios/Frameworks/Parse.framework/Headers/PFAnalytics.h b/src/ios/Frameworks/Parse.framework/Headers/PFAnalytics.h
index 3068a629..97a74c3c 100644
--- a/src/ios/Frameworks/Parse.framework/Headers/PFAnalytics.h
+++ b/src/ios/Frameworks/Parse.framework/Headers/PFAnalytics.h
@@ -1,18 +1,19 @@
-//
-// PFAnalytics.h
-//
-// Copyright 2011-present Parse Inc. All rights reserved.
-//
+/**
+ * Copyright (c) 2015-present, Parse, LLC.
+ * All rights reserved.
+ *
+ * This source code is licensed under the BSD-style license found in the
+ * LICENSE file in the root directory of this source tree. An additional grant
+ * of patent rights can be found in the PATENTS file in the same directory.
+ */
#import
-#if TARGET_OS_IPHONE
+#import
+
#import
-#else
-#import
-#endif
-@class BFTask;
+PF_ASSUME_NONNULL_BEGIN
/*!
`PFAnalytics` provides an interface to Parse's logging and analytics backend.
@@ -40,7 +41,7 @@
@returns Returns the task encapsulating the work being done.
*/
-+ (BFTask *)trackAppOpenedWithLaunchOptions:(NSDictionary *)launchOptions;
++ (BFTask *)trackAppOpenedWithLaunchOptions:(PF_NULLABLE NSDictionary *)launchOptions;
/*!
@abstract Tracks this application being launched.
@@ -55,7 +56,8 @@
@param block The block to execute on server response.
It should have the following argument signature: `^(BOOL succeeded, NSError *error)`
*/
-+ (void)trackAppOpenedWithLaunchOptionsInBackground:(NSDictionary *)launchOptions block:(PFBooleanResultBlock)block;
++ (void)trackAppOpenedWithLaunchOptionsInBackground:(PF_NULLABLE NSDictionary *)launchOptions
+ block:(PF_NULLABLE PFBooleanResultBlock)block;
/*!
@abstract Tracks this application being launched. If this happened as the result of the
@@ -69,7 +71,7 @@
@returns Returns the task encapsulating the work being done.
*/
-+ (BFTask *)trackAppOpenedWithRemoteNotificationPayload:(NSDictionary *)userInfo;
++ (BFTask *)trackAppOpenedWithRemoteNotificationPayload:(PF_NULLABLE NSDictionary *)userInfo;
/*!
@abstract Tracks this application being launched. If this happened as the result of the
@@ -82,8 +84,8 @@
@param block The block to execute on server response.
It should have the following argument signature: `^(BOOL succeeded, NSError *error)`
*/
-+ (void)trackAppOpenedWithRemoteNotificationPayloadInBackground:(NSDictionary *)userInfo
- block:(PFBooleanResultBlock)block;
++ (void)trackAppOpenedWithRemoteNotificationPayloadInBackground:(PF_NULLABLE NSDictionary *)userInfo
+ block:(PF_NULLABLE PFBooleanResultBlock)block;
///--------------------------------------
/// @name Custom Analytics
@@ -109,7 +111,7 @@
@param block The block to execute on server response.
It should have the following argument signature: `^(BOOL succeeded, NSError *error)`
*/
-+ (void)trackEventInBackground:(NSString *)name block:(PFBooleanResultBlock)block;
++ (void)trackEventInBackground:(NSString *)name block:(PF_NULLABLE PFBooleanResultBlock)block;
/*!
@abstract Tracks the occurrence of a custom event with additional dimensions. Parse will
@@ -132,7 +134,7 @@
@returns Returns the task encapsulating the work being done.
*/
-+ (BFTask *)trackEvent:(NSString *)name dimensions:(NSDictionary *)dimensions;
++ (BFTask *)trackEvent:(NSString *)name dimensions:(PF_NULLABLE NSDictionary *)dimensions;
/*!
@abstract Tracks the occurrence of a custom event with additional dimensions. Parse will
@@ -155,6 +157,10 @@
@param block The block to execute on server response.
It should have the following argument signature: `^(BOOL succeeded, NSError *error)`
*/
-+ (void)trackEventInBackground:(NSString *)name dimensions:(NSDictionary *)dimensions block:(PFBooleanResultBlock)block;
++ (void)trackEventInBackground:(NSString *)name
+ dimensions:(PF_NULLABLE NSDictionary *)dimensions
+ block:(PF_NULLABLE PFBooleanResultBlock)block;
@end
+
+PF_ASSUME_NONNULL_END
diff --git a/src/ios/Frameworks/Parse.framework/Headers/PFAnonymousUtils.h b/src/ios/Frameworks/Parse.framework/Headers/PFAnonymousUtils.h
index de5cf7de..498d838e 100644
--- a/src/ios/Frameworks/Parse.framework/Headers/PFAnonymousUtils.h
+++ b/src/ios/Frameworks/Parse.framework/Headers/PFAnonymousUtils.h
@@ -1,18 +1,20 @@
-//
-// PFAnonymousUtils.h
-//
-// Copyright 2011-present Parse Inc. All rights reserved.
-//
+/**
+ * Copyright (c) 2015-present, Parse, LLC.
+ * All rights reserved.
+ *
+ * This source code is licensed under the BSD-style license found in the
+ * LICENSE file in the root directory of this source tree. An additional grant
+ * of patent rights can be found in the PATENTS file in the same directory.
+ */
#import
-#if TARGET_OS_IPHONE
+#import
+
#import
#import
-#else
-#import
-#import
-#endif
+
+PF_ASSUME_NONNULL_BEGIN
/*!
Provides utility functions for working with Anonymously logged-in users.
@@ -22,15 +24,15 @@
- Once logged out, an anonymous user cannot be recovered.
- When the current user is anonymous, the following methods can be used to switch
to a different user or convert the anonymous user into a regular one:
- - signUp converts an anonymous user to a standard user with the given username and password.
- Data associated with the anonymous user is retained.
- - logIn switches users without converting the anonymous user.
- Data associated with the anonymous user will be lost.
- - Service logIn (e.g. Facebook, Twitter) will attempt to convert
- the anonymous user into a standard user by linking it to the service.
- If a user already exists that is linked to the service, it will instead switch to the existing user.
- - Service linking (e.g. Facebook, Twitter) will convert the anonymous user
- into a standard user by linking it to the service.
+ - signUp converts an anonymous user to a standard user with the given username and password.
+ Data associated with the anonymous user is retained.
+ - logIn switches users without converting the anonymous user.
+ Data associated with the anonymous user will be lost.
+ - Service logIn (e.g. Facebook, Twitter) will attempt to convert
+ the anonymous user into a standard user by linking it to the service.
+ If a user already exists that is linked to the service, it will instead switch to the existing user.
+ - Service linking (e.g. Facebook, Twitter) will convert the anonymous user
+ into a standard user by linking it to the service.
*/
@interface PFAnonymousUtils : NSObject
@@ -51,7 +53,7 @@
@param block The block to execute when anonymous user creation is complete.
It should have the following argument signature: `^(PFUser *user, NSError *error)`.
*/
-+ (void)logInWithBlock:(PFUserResultBlock)block;
++ (void)logInWithBlock:(PF_NULLABLE PFUserResultBlock)block;
/*
@abstract Creates an anonymous user.
@@ -60,7 +62,7 @@
@param selector The selector that will be called when the asynchronous request is complete.
It should have the following signature: `(void)callbackWithUser:(PFUser *)user error:(NSError *)error`.
*/
-+ (void)logInWithTarget:(id)target selector:(SEL)selector;
++ (void)logInWithTarget:(PF_NULLABLE_S id)target selector:(PF_NULLABLE_S SEL)selector;
///--------------------------------------
/// @name Determining Whether a User is Anonymous
@@ -73,6 +75,8 @@
@returns `YES` if the user is anonymous. `NO` if the user is not the current user or is not anonymous.
*/
-+ (BOOL)isLinkedWithUser:(PFUser *)user;
++ (BOOL)isLinkedWithUser:(PF_NULLABLE PFUser *)user;
@end
+
+PF_ASSUME_NONNULL_END
diff --git a/src/ios/Frameworks/Parse.framework/Headers/PFCloud.h b/src/ios/Frameworks/Parse.framework/Headers/PFCloud.h
index 6326ead6..63eec7f0 100644
--- a/src/ios/Frameworks/Parse.framework/Headers/PFCloud.h
+++ b/src/ios/Frameworks/Parse.framework/Headers/PFCloud.h
@@ -1,18 +1,19 @@
-//
-// PFCloud.h
-//
-// Copyright 2011-present Parse Inc. All rights reserved.
-//
+/**
+ * Copyright (c) 2015-present, Parse, LLC.
+ * All rights reserved.
+ *
+ * This source code is licensed under the BSD-style license found in the
+ * LICENSE file in the root directory of this source tree. An additional grant
+ * of patent rights can be found in the PATENTS file in the same directory.
+ */
#import
-#if TARGET_OS_IPHONE
+#import
+
#import
-#else
-#import
-#endif
-@class BFTask;
+PF_ASSUME_NONNULL_BEGIN
/*!
The `PFCloud` class provides methods for interacting with Parse Cloud Functions.
@@ -27,7 +28,8 @@
@returns The response from the cloud function.
*/
-+ (id)callFunction:(NSString *)function withParameters:(NSDictionary *)parameters;
++ (PF_NULLABLE_S id)callFunction:(NSString *)function
+ withParameters:(PF_NULLABLE NSDictionary *)parameters PF_SWIFT_UNAVAILABLE;
/*!
@abstract Calls the given cloud function *synchronously* with the parameters provided and
@@ -40,7 +42,9 @@
@returns The response from the cloud function.
This result could be a `NSDictionary`, an `NSArray`, `NSNumber` or `NSString`.
*/
-+ (id)callFunction:(NSString *)function withParameters:(NSDictionary *)parameters error:(NSError **)error;
++ (PF_NULLABLE_S id)callFunction:(NSString *)function
+ withParameters:(PF_NULLABLE NSDictionary *)parameters
+ error:(NSError **)error;
/*!
@abstract Calls the given cloud function *asynchronously* with the parameters provided.
@@ -50,7 +54,8 @@
@returns The task, that encapsulates the work being done.
*/
-+ (BFTask *)callFunctionInBackground:(NSString *)function withParameters:(NSDictionary *)parameters;
++ (BFTask *)callFunctionInBackground:(NSString *)function
+ withParameters:(PF_NULLABLE NSDictionary *)parameters;
/*!
@abstract Calls the given cloud function *asynchronously* with the parameters provided
@@ -62,8 +67,8 @@
It should have the following argument signature: `^(id result, NSError *error)`.
*/
+ (void)callFunctionInBackground:(NSString *)function
- withParameters:(NSDictionary *)parameters
- block:(PFIdResultBlock)block;
+ withParameters:(PF_NULLABLE NSDictionary *)parameters
+ block:(PF_NULLABLE PFIdResultBlock)block;
/*
@abstract Calls the given cloud function *asynchronously* with the parameters provided
@@ -77,8 +82,10 @@
Result will be `nil` if error is set and vice versa.
*/
+ (void)callFunctionInBackground:(NSString *)function
- withParameters:(NSDictionary *)parameters
- target:(id)target
- selector:(SEL)selector;
+ withParameters:(PF_NULLABLE NSDictionary *)parameters
+ target:(PF_NULLABLE_S id)target
+ selector:(PF_NULLABLE_S SEL)selector;
@end
+
+PF_ASSUME_NONNULL_END
diff --git a/src/ios/Frameworks/Parse.framework/Headers/PFConfig.h b/src/ios/Frameworks/Parse.framework/Headers/PFConfig.h
index e1afbe3e..1960c049 100644
--- a/src/ios/Frameworks/Parse.framework/Headers/PFConfig.h
+++ b/src/ios/Frameworks/Parse.framework/Headers/PFConfig.h
@@ -1,20 +1,29 @@
-//
-// PFConfig.h
-//
-// Copyright 2011-present Parse Inc. All rights reserved.
-//
+/**
+ * Copyright (c) 2015-present, Parse, LLC.
+ * All rights reserved.
+ *
+ * This source code is licensed under the BSD-style license found in the
+ * LICENSE file in the root directory of this source tree. An additional grant
+ * of patent rights can be found in the PATENTS file in the same directory.
+ */
#import
-@class BFTask;
+#import
+
+#import
+#import
+
+PF_ASSUME_NONNULL_BEGIN
+
@class PFConfig;
-typedef void(^PFConfigResultBlock)(PFConfig *config, NSError *error);
+typedef void(^PFConfigResultBlock)(PFConfig *PF_NULLABLE_S config, NSError *PF_NULLABLE_S error);
/*!
`PFConfig` is a representation of the remote configuration object.
It enables you to add things like feature gating, a/b testing or simple "Message of the day".
-*/
+ */
@interface PFConfig : NSObject
///--------------------------------------
@@ -39,7 +48,7 @@ typedef void(^PFConfigResultBlock)(PFConfig *config, NSError *error);
@returns Instance of `PFConfig` if the operation succeeded, otherwise `nil`.
*/
-+ (PFConfig *)getConfig;
++ (PF_NULLABLE PFConfig *)getConfig PF_SWIFT_UNAVAILABLE;
/*!
@abstract Gets the `PFConfig` object *synchronously* from the server and sets an error if it occurs.
@@ -48,7 +57,7 @@ typedef void(^PFConfigResultBlock)(PFConfig *config, NSError *error);
@returns Instance of PFConfig if the operation succeeded, otherwise `nil`.
*/
-+ (PFConfig *)getConfig:(NSError **)error;
++ (PF_NULLABLE PFConfig *)getConfig:(NSError **)error;
/*!
@abstract Gets the `PFConfig` *asynchronously* and sets it as a result of a task.
@@ -63,7 +72,7 @@ typedef void(^PFConfigResultBlock)(PFConfig *config, NSError *error);
@param block The block to execute.
It should have the following argument signature: `^(PFConfig *config, NSError *error)`.
*/
-+ (void)getConfigInBackgroundWithBlock:(PFConfigResultBlock)block;
++ (void)getConfigInBackgroundWithBlock:(PF_NULLABLE PFConfigResultBlock)block;
///--------------------------------------
/// @name Parameters
@@ -76,7 +85,7 @@ typedef void(^PFConfigResultBlock)(PFConfig *config, NSError *error);
@returns The value associated with `key`, or `nil` if there is no such value.
*/
-- (id)objectForKey:(NSString *)key;
+- (PF_NULLABLE_S id)objectForKey:(NSString *)key;
/*!
@abstract Returns the object associated with a given key.
@@ -90,6 +99,8 @@ typedef void(^PFConfigResultBlock)(PFConfig *config, NSError *error);
@returns The value associated with `key`, or `nil` if there is no such value.
*/
-- (id)objectForKeyedSubscript:(NSString *)keyedSubscript;
+- (PF_NULLABLE_S id)objectForKeyedSubscript:(NSString *)keyedSubscript;
@end
+
+PF_ASSUME_NONNULL_END
diff --git a/src/ios/Frameworks/Parse.framework/Headers/PFConstants.h b/src/ios/Frameworks/Parse.framework/Headers/PFConstants.h
index 238f3a91..7dd7046a 100644
--- a/src/ios/Frameworks/Parse.framework/Headers/PFConstants.h
+++ b/src/ios/Frameworks/Parse.framework/Headers/PFConstants.h
@@ -1,8 +1,16 @@
-// PFConstants.h
-// Copyright 2011 Parse, Inc. All rights reserved.
+/**
+ * Copyright (c) 2015-present, Parse, LLC.
+ * All rights reserved.
+ *
+ * This source code is licensed under the BSD-style license found in the
+ * LICENSE file in the root directory of this source tree. An additional grant
+ * of patent rights can be found in the PATENTS file in the same directory.
+ */
#import
+#import
+
@class PFObject;
@class PFUser;
@@ -10,7 +18,7 @@
/// @name Version
///--------------------------------------
-#define PARSE_VERSION @"1.6.1"
+#define PARSE_VERSION @"1.8.3"
extern NSInteger const PARSE_API_VERSION;
@@ -21,35 +29,67 @@ extern NSInteger const PARSE_API_VERSION;
#define PARSE_IOS_ONLY (TARGET_OS_IPHONE)
#define PARSE_OSX_ONLY (TARGET_OS_MAC && !(TARGET_OS_IPHONE))
-extern NSString *const kPFDeviceType;
+extern NSString *const PF_NONNULL_S kPFDeviceType;
#if PARSE_IOS_ONLY
#import
#else
#import
-@compatibility_alias UIImage NSImage;
-@compatibility_alias UIColor NSColor;
-@compatibility_alias UIView NSView;
#endif
///--------------------------------------
/// @name Server
///--------------------------------------
-extern NSString *const kPFParseServer;
+extern NSString *const PF_NONNULL_S kPFParseServer;
///--------------------------------------
/// @name Cache Policies
///--------------------------------------
-typedef enum {
+/*!
+ `PFCachePolicy` specifies different caching policies that could be used with .
+
+ This lets you show data when the user's device is offline,
+ or when the app has just started and network requests have not yet had time to complete.
+ Parse takes care of automatically flushing the cache when it takes up too much space.
+
+ @warning Cache policy could only be set when Local Datastore is not enabled.
+
+ @see PFQuery
+ */
+typedef NS_ENUM(uint8_t, PFCachePolicy) {
+ /*!
+ @abstract The query does not load from the cache or save results to the cache.
+ This is the default cache policy.
+ */
kPFCachePolicyIgnoreCache = 0,
+ /*!
+ @abstract The query only loads from the cache, ignoring the network.
+ If there are no cached results, this causes a `NSError` with `kPFErrorCacheMiss` code.
+ */
kPFCachePolicyCacheOnly,
+ /*!
+ @abstract The query does not load from the cache, but it will save results to the cache.
+ */
kPFCachePolicyNetworkOnly,
+ /*!
+ @abstract The query first tries to load from the cache, but if that fails, it loads results from the network.
+ If there are no cached results, this causes a `NSError` with `kPFErrorCacheMiss` code.
+ */
kPFCachePolicyCacheElseNetwork,
+ /*!
+ @abstract The query first tries to load from the network, but if that fails, it loads results from the cache.
+ If there are no cached results, this causes a `NSError` with `kPFErrorCacheMiss` code.
+ */
kPFCachePolicyNetworkElseCache,
+ /*!
+ @abstract The query first loads from the cache, then loads from the network.
+ The callback will be called twice - first with the cached results, then with the network results.
+ Since it returns two results at different times, this cache policy cannot be used with synchronous or task methods.
+ */
kPFCachePolicyCacheThenNetwork
-} PFCachePolicy;
+};
///--------------------------------------
/// @name Logging Levels
@@ -97,132 +137,252 @@ typedef NS_ENUM(uint8_t, PFLogLevel) {
/// @name Errors
///--------------------------------------
-extern NSString *const PFParseErrorDomain;
-
-/*! @abstract 1: Internal server error. No information available. */
-extern NSInteger const kPFErrorInternalServer;
-
-/*! @abstract 100: The connection to the Parse servers failed. */
-extern NSInteger const kPFErrorConnectionFailed;
-/*! @abstract 101: Object doesn't exist, or has an incorrect password. */
-extern NSInteger const kPFErrorObjectNotFound;
-/*! @abstract 102: You tried to find values matching a datatype that doesn't support exact database matching, like an array or a dictionary. */
-extern NSInteger const kPFErrorInvalidQuery;
-/*! @abstract 103: Missing or invalid classname. Classnames are case-sensitive. They must start with a letter, and a-zA-Z0-9_ are the only valid characters. */
-extern NSInteger const kPFErrorInvalidClassName;
-/*! @abstract 104: Missing object id. */
-extern NSInteger const kPFErrorMissingObjectId;
-/*! @abstract 105: Invalid key name. Keys are case-sensitive. They must start with a letter, and a-zA-Z0-9_ are the only valid characters. */
-extern NSInteger const kPFErrorInvalidKeyName;
-/*! @abstract 106: Malformed pointer. Pointers must be arrays of a classname and an object id. */
-extern NSInteger const kPFErrorInvalidPointer;
-/*! @abstract 107: Malformed json object. A json dictionary is expected. */
-extern NSInteger const kPFErrorInvalidJSON;
-/*! @abstract 108: Tried to access a feature only available internally. */
-extern NSInteger const kPFErrorCommandUnavailable;
-/*! @abstract 111: Field set to incorrect type. */
-extern NSInteger const kPFErrorIncorrectType;
-/*! @abstract 112: Invalid channel name. A channel name is either an empty string (the broadcast channel) or contains only a-zA-Z0-9_ characters and starts with a letter. */
-extern NSInteger const kPFErrorInvalidChannelName;
-/*! @abstract 114: Invalid device token. */
-extern NSInteger const kPFErrorInvalidDeviceToken;
-/*! @abstract 115: Push is misconfigured. See details to find out how. */
-extern NSInteger const kPFErrorPushMisconfigured;
-/*! @abstract 116: The object is too large. */
-extern NSInteger const kPFErrorObjectTooLarge;
-/*! @abstract 119: That operation isn't allowed for clients. */
-extern NSInteger const kPFErrorOperationForbidden;
-/*! @abstract 120: The results were not found in the cache. */
-extern NSInteger const kPFErrorCacheMiss;
-/*! @abstract 121: Keys in NSDictionary values may not include '$' or '.'. */
-extern NSInteger const kPFErrorInvalidNestedKey;
-/*! @abstract 122: Invalid file name. A file name contains only a-zA-Z0-9_. characters and is between 1 and 36 characters. */
-extern NSInteger const kPFErrorInvalidFileName;
-/*! @abstract 123: Invalid ACL. An ACL with an invalid format was saved. This should not happen if you use PFACL. */
-extern NSInteger const kPFErrorInvalidACL;
-/*! @abstract 124: The request timed out on the server. Typically this indicates the request is too expensive. */
-extern NSInteger const kPFErrorTimeout;
-/*! @abstract 125: The email address was invalid. */
-extern NSInteger const kPFErrorInvalidEmailAddress;
-/*! @abstract 137: A unique field was given a value that is already taken. */
-extern NSInteger const kPFErrorDuplicateValue;
-/*! @abstract 139: Role's name is invalid. */
-extern NSInteger const kPFErrorInvalidRoleName;
-/*! @abstract 140: Exceeded an application quota. Upgrade to resolve. */
-extern NSInteger const kPFErrorExceededQuota;
-/*! @abstract 141: Cloud Code script had an error. */
-extern NSInteger const kPFScriptError;
-/*! @abstract 142: Cloud Code validation failed. */
-extern NSInteger const kPFValidationError;
-/*! @abstract 143: Product purchase receipt is missing */
-extern NSInteger const kPFErrorReceiptMissing;
-/*! @abstract 144: Product purchase receipt is invalid */
-extern NSInteger const kPFErrorInvalidPurchaseReceipt;
-/*! @abstract 145: Payment is disabled on this device */
-extern NSInteger const kPFErrorPaymentDisabled;
-/*! @abstract 146: The product identifier is invalid */
-extern NSInteger const kPFErrorInvalidProductIdentifier;
-/*! @abstract 147: The product is not found in the App Store */
-extern NSInteger const kPFErrorProductNotFoundInAppStore;
-/*! @abstract 148: The Apple server response is not valid */
-extern NSInteger const kPFErrorInvalidServerResponse;
-/*! @abstract 149: Product fails to download due to file system error */
-extern NSInteger const kPFErrorProductDownloadFileSystemFailure;
-/*! @abstract 150: Fail to convert data to image. */
-extern NSInteger const kPFErrorInvalidImageData;
-/*! @abstract 151: Unsaved file. */
-extern NSInteger const kPFErrorUnsavedFile;
-/*! @abstract 153: Fail to delete file. */
-extern NSInteger const kPFErrorFileDeleteFailure;
-/*! @abstract 155: Application has exceeded its analytics request limit. */
-extern NSInteger const kPFErrorRequestLimitExceeded;
-/*! @abstract 160: Invalid event name. */
-extern NSInteger const kPFErrorInvalidEventName;
-/*! @abstract 200: Username is missing or empty */
-extern NSInteger const kPFErrorUsernameMissing;
-/*! @abstract 201: Password is missing or empty */
-extern NSInteger const kPFErrorUserPasswordMissing;
-/*! @abstract 202: Username has already been taken */
-extern NSInteger const kPFErrorUsernameTaken;
-/*! @abstract 203: Email has already been taken */
-extern NSInteger const kPFErrorUserEmailTaken;
-/*! @abstract 204: The email is missing, and must be specified */
-extern NSInteger const kPFErrorUserEmailMissing;
-/*! @abstract 205: A user with the specified email was not found */
-extern NSInteger const kPFErrorUserWithEmailNotFound;
-/*! @abstract 206: The user cannot be altered by a client without the session. */
-extern NSInteger const kPFErrorUserCannotBeAlteredWithoutSession;
-/*! @abstract 207: Users can only be created through sign up */
-extern NSInteger const kPFErrorUserCanOnlyBeCreatedThroughSignUp;
-/*! @abstract 208: An existing Facebook account already linked to another user. */
-extern NSInteger const kPFErrorFacebookAccountAlreadyLinked;
-/*! @abstract 208: An existing account already linked to another user. */
-extern NSInteger const kPFErrorAccountAlreadyLinked;
-/*! @abstract 209: User ID mismatch */
-extern NSInteger const kPFErrorUserIdMismatch;
-/*! @abstract 250: Facebook id missing from request */
-extern NSInteger const kPFErrorFacebookIdMissing;
-/*! @abstract 250: Linked id missing from request */
-extern NSInteger const kPFErrorLinkedIdMissing;
-/*! @abstract 251: Invalid Facebook session */
-extern NSInteger const kPFErrorFacebookInvalidSession;
-/*! @abstract 251: Invalid linked session */
-extern NSInteger const kPFErrorInvalidLinkedSession;
+extern NSString *const PF_NONNULL_S PFParseErrorDomain;
+
+/*!
+ `PFErrorCode` enum contains all custom error codes that are used as `code` for `NSError` for callbacks on all classes.
+
+ These codes are used when `domain` of `NSError` that you receive is set to `PFParseErrorDomain`.
+ */
+typedef NS_ENUM(NSInteger, PFErrorCode) {
+ /*!
+ @abstract Internal server error. No information available.
+ */
+ kPFErrorInternalServer = 1,
+ /*!
+ @abstract The connection to the Parse servers failed.
+ */
+ kPFErrorConnectionFailed = 100,
+ /*!
+ @abstract Object doesn't exist, or has an incorrect password.
+ */
+ kPFErrorObjectNotFound = 101,
+ /*!
+ @abstract You tried to find values matching a datatype that doesn't
+ support exact database matching, like an array or a dictionary.
+ */
+ kPFErrorInvalidQuery = 102,
+ /*!
+ @abstract Missing or invalid classname. Classnames are case-sensitive.
+ They must start with a letter, and `a-zA-Z0-9_` are the only valid characters.
+ */
+ kPFErrorInvalidClassName = 103,
+ /*!
+ @abstract Missing object id.
+ */
+ kPFErrorMissingObjectId = 104,
+ /*!
+ @abstract Invalid key name. Keys are case-sensitive.
+ They must start with a letter, and `a-zA-Z0-9_` are the only valid characters.
+ */
+ kPFErrorInvalidKeyName = 105,
+ /*!
+ @abstract Malformed pointer. Pointers must be arrays of a classname and an object id.
+ */
+ kPFErrorInvalidPointer = 106,
+ /*!
+ @abstract Malformed json object. A json dictionary is expected.
+ */
+ kPFErrorInvalidJSON = 107,
+ /*!
+ @abstract Tried to access a feature only available internally.
+ */
+ kPFErrorCommandUnavailable = 108,
+ /*!
+ @abstract Field set to incorrect type.
+ */
+ kPFErrorIncorrectType = 111,
+ /*!
+ @abstract Invalid channel name. A channel name is either an empty string (the broadcast channel)
+ or contains only `a-zA-Z0-9_` characters and starts with a letter.
+ */
+ kPFErrorInvalidChannelName = 112,
+ /*!
+ @abstract Invalid device token.
+ */
+ kPFErrorInvalidDeviceToken = 114,
+ /*!
+ @abstract Push is misconfigured. See details to find out how.
+ */
+ kPFErrorPushMisconfigured = 115,
+ /*!
+ @abstract The object is too large.
+ */
+ kPFErrorObjectTooLarge = 116,
+ /*!
+ @abstract That operation isn't allowed for clients.
+ */
+ kPFErrorOperationForbidden = 119,
+ /*!
+ @abstract The results were not found in the cache.
+ */
+ kPFErrorCacheMiss = 120,
+ /*!
+ @abstract Keys in `NSDictionary` values may not include `$` or `.`.
+ */
+ kPFErrorInvalidNestedKey = 121,
+ /*!
+ @abstract Invalid file name.
+ A file name can contain only `a-zA-Z0-9_.` characters and should be between 1 and 36 characters.
+ */
+ kPFErrorInvalidFileName = 122,
+ /*!
+ @abstract Invalid ACL. An ACL with an invalid format was saved. This should not happen if you use .
+ */
+ kPFErrorInvalidACL = 123,
+ /*!
+ @abstract The request timed out on the server. Typically this indicates the request is too expensive.
+ */
+ kPFErrorTimeout = 124,
+ /*!
+ @abstract The email address was invalid.
+ */
+ kPFErrorInvalidEmailAddress = 125,
+ /*!
+ A unique field was given a value that is already taken.
+ */
+ kPFErrorDuplicateValue = 137,
+ /*!
+ @abstract Role's name is invalid.
+ */
+ kPFErrorInvalidRoleName = 139,
+ /*!
+ @abstract Exceeded an application quota. Upgrade to resolve.
+ */
+ kPFErrorExceededQuota = 140,
+ /*!
+ @abstract Cloud Code script had an error.
+ */
+ kPFScriptError = 141,
+ /*!
+ @abstract Cloud Code validation failed.
+ */
+ kPFValidationError = 142,
+ /*!
+ @abstract Product purchase receipt is missing.
+ */
+ kPFErrorReceiptMissing = 143,
+ /*!
+ @abstract Product purchase receipt is invalid.
+ */
+ kPFErrorInvalidPurchaseReceipt = 144,
+ /*!
+ @abstract Payment is disabled on this device.
+ */
+ kPFErrorPaymentDisabled = 145,
+ /*!
+ @abstract The product identifier is invalid.
+ */
+ kPFErrorInvalidProductIdentifier = 146,
+ /*!
+ @abstract The product is not found in the App Store.
+ */
+ kPFErrorProductNotFoundInAppStore = 147,
+ /*!
+ @abstract The Apple server response is not valid.
+ */
+ kPFErrorInvalidServerResponse = 148,
+ /*!
+ @abstract Product fails to download due to file system error.
+ */
+ kPFErrorProductDownloadFileSystemFailure = 149,
+ /*!
+ @abstract Fail to convert data to image.
+ */
+ kPFErrorInvalidImageData = 150,
+ /*!
+ @abstract Unsaved file.
+ */
+ kPFErrorUnsavedFile = 151,
+ /*!
+ @abstract Fail to delete file.
+ */
+ kPFErrorFileDeleteFailure = 153,
+ /*!
+ @abstract Application has exceeded its request limit.
+ */
+ kPFErrorRequestLimitExceeded = 155,
+ /*!
+ @abstract Invalid event name.
+ */
+ kPFErrorInvalidEventName = 160,
+ /*!
+ @abstract Username is missing or empty.
+ */
+ kPFErrorUsernameMissing = 200,
+ /*!
+ @abstract Password is missing or empty.
+ */
+ kPFErrorUserPasswordMissing = 201,
+ /*!
+ @abstract Username has already been taken.
+ */
+ kPFErrorUsernameTaken = 202,
+ /*!
+ @abstract Email has already been taken.
+ */
+ kPFErrorUserEmailTaken = 203,
+ /*!
+ @abstract The email is missing, and must be specified.
+ */
+ kPFErrorUserEmailMissing = 204,
+ /*!
+ @abstract A user with the specified email was not found.
+ */
+ kPFErrorUserWithEmailNotFound = 205,
+ /*!
+ @abstract The user cannot be altered by a client without the session.
+ */
+ kPFErrorUserCannotBeAlteredWithoutSession = 206,
+ /*!
+ @abstract Users can only be created through sign up.
+ */
+ kPFErrorUserCanOnlyBeCreatedThroughSignUp = 207,
+ /*!
+ @abstract An existing Facebook account already linked to another user.
+ */
+ kPFErrorFacebookAccountAlreadyLinked = 208,
+ /*!
+ @abstract An existing account already linked to another user.
+ */
+ kPFErrorAccountAlreadyLinked = 208,
+ /*!
+ Error code indicating that the current session token is invalid.
+ */
+ kPFErrorInvalidSessionToken = 209,
+ kPFErrorUserIdMismatch = 209,
+ /*!
+ @abstract Facebook id missing from request.
+ */
+ kPFErrorFacebookIdMissing = 250,
+ /*!
+ @abstract Linked id missing from request.
+ */
+ kPFErrorLinkedIdMissing = 250,
+ /*!
+ @abstract Invalid Facebook session.
+ */
+ kPFErrorFacebookInvalidSession = 251,
+ /*!
+ @abstract Invalid linked session.
+ */
+ kPFErrorInvalidLinkedSession = 251,
+};
///--------------------------------------
/// @name Blocks
///--------------------------------------
-typedef void (^PFBooleanResultBlock)(BOOL succeeded, NSError *error);
-typedef void (^PFIntegerResultBlock)(int number, NSError *error);
-typedef void (^PFArrayResultBlock)(NSArray *objects, NSError *error);
-typedef void (^PFObjectResultBlock)(PFObject *object, NSError *error);
-typedef void (^PFSetResultBlock)(NSSet *channels, NSError *error);
-typedef void (^PFUserResultBlock)(PFUser *user, NSError *error);
-typedef void (^PFDataResultBlock)(NSData *data, NSError *error);
-typedef void (^PFDataStreamResultBlock)(NSInputStream *stream, NSError *error);
-typedef void (^PFStringResultBlock)(NSString *string, NSError *error);
-typedef void (^PFIdResultBlock)(id object, NSError *error);
+typedef void (^PFBooleanResultBlock)(BOOL succeeded, NSError *PF_NULLABLE_S error);
+typedef void (^PFIntegerResultBlock)(int number, NSError *PF_NULLABLE_S error);
+typedef void (^PFArrayResultBlock)(NSArray *PF_NULLABLE_S objects, NSError *PF_NULLABLE_S error);
+typedef void (^PFObjectResultBlock)(PFObject *PF_NULLABLE_S object, NSError *PF_NULLABLE_S error);
+typedef void (^PFSetResultBlock)(NSSet *PF_NULLABLE_S channels, NSError *PF_NULLABLE_S error);
+typedef void (^PFUserResultBlock)(PFUser *PF_NULLABLE_S user, NSError *PF_NULLABLE_S error);
+typedef void (^PFDataResultBlock)(NSData *PF_NULLABLE_S data, NSError *PF_NULLABLE_S error);
+typedef void (^PFDataStreamResultBlock)(NSInputStream *PF_NULLABLE_S stream, NSError *PF_NULLABLE_S error);
+typedef void (^PFStringResultBlock)(NSString *PF_NULLABLE_S string, NSError *PF_NULLABLE_S error);
+typedef void (^PFIdResultBlock)(PF_NULLABLE_S id object, NSError *PF_NULLABLE_S error);
typedef void (^PFProgressBlock)(int percentDone);
///--------------------------------------
@@ -230,13 +390,56 @@ typedef void (^PFProgressBlock)(int percentDone);
///--------------------------------------
#ifndef PARSE_DEPRECATED
-#ifdef __deprecated_msg
-#define PARSE_DEPRECATED(_MSG) __deprecated_msg(_MSG)
-#else
-#ifdef __deprecated
-#define PARSE_DEPRECATED(_MSG) __attribute__((deprecated))
-#else
-#define PARSE_DEPRECATED(_MSG)
+# ifdef __deprecated_msg
+# define PARSE_DEPRECATED(_MSG) __deprecated_msg(_MSG)
+# else
+# ifdef __deprecated
+# define PARSE_DEPRECATED(_MSG) __attribute__((deprecated))
+# else
+# define PARSE_DEPRECATED(_MSG)
+# endif
+# endif
+#endif
+
+///--------------------------------------
+/// @name Extensions Macros
+///--------------------------------------
+
+#ifndef PF_EXTENSION_UNAVAILABLE
+# if PARSE_IOS_ONLY
+# ifdef NS_EXTENSION_UNAVAILABLE_IOS
+# define PF_EXTENSION_UNAVAILABLE(_msg) NS_EXTENSION_UNAVAILABLE_IOS(_msg)
+# else
+# define PF_EXTENSION_UNAVAILABLE(_msg)
+# endif
+# else
+# ifdef NS_EXTENSION_UNAVAILABLE_MAC
+# define PF_EXTENSION_UNAVAILABLE(_msg) NS_EXTENSION_UNAVAILABLE_MAC(_msg)
+# else
+# define PF_EXTENSION_UNAVAILABLE(_msg)
+# endif
+# endif
#endif
+
+///--------------------------------------
+/// @name Swift Macros
+///--------------------------------------
+
+#ifndef PF_SWIFT_UNAVAILABLE
+# ifdef NS_SWIFT_UNAVAILABLE
+# define PF_SWIFT_UNAVAILABLE NS_SWIFT_UNAVAILABLE("")
+# else
+# define PF_SWIFT_UNAVAILABLE
+# endif
#endif
+
+///--------------------------------------
+/// @name Obj-C Generics Macros
+///--------------------------------------
+
+#if __has_feature(objc_generics) || __has_extension(objc_generics)
+# define PF_GENERIC(type)
+#else
+# define PF_GENERIC(type)
+# define PFGenericObject PFObject *
#endif
diff --git a/src/ios/Frameworks/Parse.framework/Headers/PFFile.h b/src/ios/Frameworks/Parse.framework/Headers/PFFile.h
index 82f7643f..7e8d81ae 100644
--- a/src/ios/Frameworks/Parse.framework/Headers/PFFile.h
+++ b/src/ios/Frameworks/Parse.framework/Headers/PFFile.h
@@ -1,18 +1,19 @@
-//
-// PFFile.h
-//
-// Copyright 2011-present Parse Inc. All rights reserved.
-//
+/**
+ * Copyright (c) 2015-present, Parse, LLC.
+ * All rights reserved.
+ *
+ * This source code is licensed under the BSD-style license found in the
+ * LICENSE file in the root directory of this source tree. An additional grant
+ * of patent rights can be found in the PATENTS file in the same directory.
+ */
#import
-#if TARGET_OS_IPHONE
+#import
+
#import
-#else
-#import
-#endif
-@class BFTask;
+PF_ASSUME_NONNULL_BEGIN
/*!
`PFFile` representes a file of binary data stored on the Parse servers.
@@ -43,33 +44,69 @@
@returns A new `PFFile` object.
*/
-+ (instancetype)fileWithName:(NSString *)name data:(NSData *)data;
++ (instancetype)fileWithName:(PF_NULLABLE NSString *)name data:(NSData *)data;
/*!
@abstract Creates a file with the contents of another file.
- @param name The name of the new `PFFile`. The file name must begin with and
- alphanumeric character, and consist of alphanumeric characters, periods,
- spaces, underscores, or dashes.
- @param path The path to the file that will be uploaded to Parse.
+ @warning This method raises an exception if the file at path is not accessible
+ or if there is not enough disk space left.
+
+ @param name The name of the new `PFFile`. The file name must begin with and alphanumeric character,
+ and consist of alphanumeric characters, periods, spaces, underscores, or dashes.
+ @param path The path to the file that will be uploaded to Parse.
+
+ @returns A new `PFFile` instance.
+ */
++ (instancetype)fileWithName:(PF_NULLABLE NSString *)name contentsAtPath:(NSString *)path;
+
+/*!
+ @abstract Creates a file with the contents of another file.
+
+ @param name The name of the new `PFFile`. The file name must begin with and alphanumeric character,
+ and consist of alphanumeric characters, periods, spaces, underscores, or dashes.
+ @param path The path to the file that will be uploaded to Parse.
+ @param error On input, a pointer to an error object.
+ If an error occurs, this pointer is set to an actual error object containing the error information.
+ You may specify `nil` for this parameter if you do not want the error information.
+
+ @returns A new `PFFile` instance or `nil` if the error occured.
*/
-+ (instancetype)fileWithName:(NSString *)name
- contentsAtPath:(NSString *)path;
++ (instancetype)fileWithName:(PF_NULLABLE NSString *)name contentsAtPath:(NSString *)path error:(NSError **)error;
/*!
@abstract Creates a file with given data, name and content type.
- @param name The name of the new `PFFile`. The file name must begin with and
- alphanumeric character, and consist of alphanumeric characters, periods,
- spaces, underscores, or dashes.
- @param data The contents of the new `PFFile`.
+ @warning This method raises an exception if the data supplied is not accessible or could not be saved.
+
+ @param name The name of the new `PFFile`. The file name must begin with and alphanumeric character,
+ and consist of alphanumeric characters, periods, spaces, underscores, or dashes.
+ @param data The contents of the new `PFFile`.
@param contentType Represents MIME type of the data.
- @returns A new `PFFile` object.
+ @returns A new `PFFile` instance.
*/
-+ (instancetype)fileWithName:(NSString *)name
++ (instancetype)fileWithName:(PF_NULLABLE NSString *)name
data:(NSData *)data
- contentType:(NSString *)contentType;
+ contentType:(PF_NULLABLE NSString *)contentType;
+
+/*!
+ @abstract Creates a file with given data, name and content type.
+
+ @param name The name of the new `PFFile`. The file name must begin with and alphanumeric character,
+ and consist of alphanumeric characters, periods, spaces, underscores, or dashes.
+ @param data The contents of the new `PFFile`.
+ @param contentType Represents MIME type of the data.
+ @param error On input, a pointer to an error object.
+ If an error occurs, this pointer is set to an actual error object containing the error information.
+ You may specify `nil` for this parameter if you do not want the error information.
+
+ @returns A new `PFFile` instance or `nil` if the error occured.
+ */
++ (instancetype)fileWithName:(PF_NULLABLE NSString *)name
+ data:(NSData *)data
+ contentType:(PF_NULLABLE NSString *)contentType
+ error:(NSError **)error;
/*!
@abstract Creates a file with given data and content type.
@@ -79,7 +116,7 @@
@returns A new `PFFile` object.
*/
-+ (instancetype)fileWithData:(NSData *)data contentType:(NSString *)contentType;
++ (instancetype)fileWithData:(NSData *)data contentType:(PF_NULLABLE NSString *)contentType;
/*!
@abstract The name of the file.
@@ -93,7 +130,7 @@
/*!
@abstract The url of the file.
*/
-@property (nonatomic, copy, readonly) NSString *url;
+@property (PF_NULLABLE_PROPERTY nonatomic, copy, readonly) NSString *url;
///--------------------------------------
/// @name Storing Data with Parse
@@ -109,7 +146,7 @@
@returns Returns whether the save succeeded.
*/
-- (BOOL)save;
+- (BOOL)save PF_SWIFT_UNAVAILABLE;
/*!
@abstract Saves the file *synchronously* and sets an error if it occurs.
@@ -127,12 +164,21 @@
*/
- (BFTask *)saveInBackground;
+/*!
+ @abstract Saves the file *asynchronously*
+
+ @param progressBlock The block should have the following argument signature: `^(int percentDone)`
+
+ @returns The task, that encapsulates the work being done.
+ */
+- (BFTask *)saveInBackgroundWithProgressBlock:(PF_NULLABLE PFProgressBlock)progressBlock;
+
/*!
@abstract Saves the file *asynchronously* and executes the given block.
@param block The block should have the following argument signature: `^(BOOL succeeded, NSError *error)`.
*/
-- (void)saveInBackgroundWithBlock:(PFBooleanResultBlock)block;
+- (void)saveInBackgroundWithBlock:(PF_NULLABLE PFBooleanResultBlock)block;
/*!
@abstract Saves the file *asynchronously* and executes the given block.
@@ -143,8 +189,8 @@
@param block The block should have the following argument signature: `^(BOOL succeeded, NSError *error)`
@param progressBlock The block should have the following argument signature: `^(int percentDone)`
*/
-- (void)saveInBackgroundWithBlock:(PFBooleanResultBlock)block
- progressBlock:(PFProgressBlock)progressBlock;
+- (void)saveInBackgroundWithBlock:(PF_NULLABLE PFBooleanResultBlock)block
+ progressBlock:(PF_NULLABLE PFProgressBlock)progressBlock;
/*
@abstract Saves the file *asynchronously* and calls the given callback.
@@ -155,7 +201,7 @@
`error` will be `nil` on success and set if there was an error.
`[result boolValue]` will tell you whether the call succeeded or not.
*/
-- (void)saveInBackgroundWithTarget:(id)target selector:(SEL)selector;
+- (void)saveInBackgroundWithTarget:(PF_NULLABLE_S id)target selector:(PF_NULLABLE_S SEL)selector;
///--------------------------------------
/// @name Getting Data from Parse
@@ -171,7 +217,7 @@
@returns The `NSData` object containing file data. Returns `nil` if there was an error in fetching.
*/
-- (NSData *)getData;
+- (PF_NULLABLE NSData *)getData PF_SWIFT_UNAVAILABLE;
/*!
@abstract This method is like but avoids ever holding the entire `PFFile` contents in memory at once.
@@ -180,7 +226,7 @@
@returns A stream containing the data. Returns `nil` if there was an error in fetching.
*/
-- (NSInputStream *)getDataStream;
+- (PF_NULLABLE NSInputStream *)getDataStream PF_SWIFT_UNAVAILABLE;
/*!
@abstract *Synchronously* gets the data from cache if available or fetches its contents from the network.
@@ -190,7 +236,7 @@
@returns The `NSData` object containing file data. Returns `nil` if there was an error in fetching.
*/
-- (NSData *)getData:(NSError **)error;
+- (PF_NULLABLE NSData *)getData:(NSError **)error;
/*!
@abstract This method is like but avoids ever holding the entire `PFFile` contents in memory at once.
@@ -200,18 +246,29 @@
@returns A stream containing the data. Returns nil if there was an error in
fetching.
*/
-- (NSInputStream *)getDataStream:(NSError **)error;
+- (PF_NULLABLE NSInputStream *)getDataStream:(NSError **)error;
/*!
- @abstract This method is like but avoids ever holding the entire `PFFile` contents in memory at once.
+ @abstract This method is like but it fetches asynchronously to avoid blocking the current thread.
+
+ @see getData
+
+ @returns The task, that encapsulates the work being done.
+ */
+- (BFTask *)getDataInBackground;
+
+/*!
+ @abstract This method is like but it fetches asynchronously to avoid blocking the current thread.
@discussion This can help applications with many large files avoid memory warnings.
@see getData
- @returns A stream containing the data. Returns `nil` if there was an error in fetching.
+ @param progressBlock The block should have the following argument signature: ^(int percentDone)
+
+ @returns The task, that encapsulates the work being done.
*/
-- (BFTask *)getDataInBackground;
+- (BFTask *)getDataInBackgroundWithProgressBlock:(PF_NULLABLE PFProgressBlock)progressBlock;
/*!
@abstract This method is like but avoids
@@ -223,12 +280,55 @@
*/
- (BFTask *)getDataStreamInBackground;
+/*!
+ @abstract This method is like , but yields a live-updating stream.
+
+ @discussion Instead of , which yields a stream that can be read from only after the request has
+ completed, this method gives you a stream directly written to by the HTTP session. As this stream is not pre-buffered,
+ it is strongly advised to use the `NSStreamDelegate` methods, in combination with a run loop, to consume the data in
+ the stream, to do proper async file downloading.
+
+ @note You MUST open this stream before reading from it.
+ @note Do NOT call on this task from the main thread. It may result in a deadlock.
+
+ @returns A task that produces a *live* stream that is being written to with the data from the server.
+ */
+- (BFTask *)getDataDownloadStreamInBackground;
+
+/*!
+ @abstract This method is like but avoids
+ ever holding the entire `PFFile` contents in memory at once.
+
+ @discussion This can help applications with many large files avoid memory warnings.
+ @param progressBlock The block should have the following argument signature: ^(int percentDone)
+
+ @returns The task, that encapsulates the work being done.
+ */
+- (BFTask *)getDataStreamInBackgroundWithProgressBlock:(PF_NULLABLE PFProgressBlock)progressBlock;
+
+/*!
+ @abstract This method is like , but yields a live-updating stream.
+
+ @discussion Instead of , which yields a stream that can be read from only after the request has
+ completed, this method gives you a stream directly written to by the HTTP session. As this stream is not pre-buffered,
+ it is strongly advised to use the `NSStreamDelegate` methods, in combination with a run loop, to consume the data in
+ the stream, to do proper async file downloading.
+
+ @note You MUST open this stream before reading from it.
+ @note Do NOT call on this task from the main thread. It may result in a deadlock.
+
+ @param progressBlock The block should have the following argument signature: `^(int percentDone)`
+
+ @returns A task that produces a *live* stream that is being written to with the data from the server.
+ */
+- (BFTask *)getDataDownloadStreamInBackgroundWithProgressBlock:(PF_NULLABLE PFProgressBlock)progressBlock;
+
/*!
@abstract *Asynchronously* gets the data from cache if available or fetches its contents from the network.
@param block The block should have the following argument signature: `^(NSData *result, NSError *error)`
*/
-- (void)getDataInBackgroundWithBlock:(PFDataResultBlock)block;
+- (void)getDataInBackgroundWithBlock:(PF_NULLABLE PFDataResultBlock)block;
/*!
@abstract This method is like but avoids
@@ -238,7 +338,7 @@
@param block The block should have the following argument signature: `(NSInputStream *result, NSError *error)`
*/
-- (void)getDataStreamInBackgroundWithBlock:(PFDataStreamResultBlock)block;
+- (void)getDataStreamInBackgroundWithBlock:(PF_NULLABLE PFDataStreamResultBlock)block;
/*!
@abstract *Asynchronously* gets the data from cache if available or fetches its contents from the network.
@@ -246,11 +346,11 @@
@discussion This method will execute the progressBlock periodically with the percent progress.
`progressBlock` will get called with `100` before `resultBlock` is called.
- @param resultBlock The block should have the following argument signature: (NSData *result, NSError *error)
- @param progressBlock The block should have the following argument signature: (int percentDone)
+ @param resultBlock The block should have the following argument signature: ^(NSData *result, NSError *error)
+ @param progressBlock The block should have the following argument signature: ^(int percentDone)
*/
-- (void)getDataInBackgroundWithBlock:(PFDataResultBlock)resultBlock
- progressBlock:(PFProgressBlock)progressBlock;
+- (void)getDataInBackgroundWithBlock:(PF_NULLABLE PFDataResultBlock)resultBlock
+ progressBlock:(PF_NULLABLE PFProgressBlock)progressBlock;
/*!
@abstract This method is like but avoids
@@ -261,8 +361,8 @@
@param resultBlock The block should have the following argument signature: `^(NSInputStream *result, NSError *error)`.
@param progressBlock The block should have the following argument signature: `^(int percentDone)`.
*/
-- (void)getDataStreamInBackgroundWithBlock:(PFDataStreamResultBlock)resultBlock
- progressBlock:(PFProgressBlock)progressBlock;
+- (void)getDataStreamInBackgroundWithBlock:(PF_NULLABLE PFDataStreamResultBlock)resultBlock
+ progressBlock:(PF_NULLABLE PFProgressBlock)progressBlock;
/*
@abstract *Asynchronously* gets the data from cache if available or fetches its contents from the network.
@@ -272,7 +372,7 @@
It should have the following signature: `(void)callbackWithResult:(NSData *)result error:(NSError *)error`.
`error` will be `nil` on success and set if there was an error.
*/
-- (void)getDataInBackgroundWithTarget:(id)target selector:(SEL)selector;
+- (void)getDataInBackgroundWithTarget:(PF_NULLABLE_S id)target selector:(PF_NULLABLE_S SEL)selector;
///--------------------------------------
/// @name Interrupting a Transfer
@@ -284,3 +384,5 @@
- (void)cancel;
@end
+
+PF_ASSUME_NONNULL_END
diff --git a/src/ios/Frameworks/Parse.framework/Headers/PFGeoPoint.h b/src/ios/Frameworks/Parse.framework/Headers/PFGeoPoint.h
index 0853aa5b..37d3bb09 100644
--- a/src/ios/Frameworks/Parse.framework/Headers/PFGeoPoint.h
+++ b/src/ios/Frameworks/Parse.framework/Headers/PFGeoPoint.h
@@ -1,16 +1,27 @@
-//
-// PFGeoPoint.h
-//
-// Copyright 2011-present Parse Inc. All rights reserved.
-//
+/**
+ * Copyright (c) 2015-present, Parse, LLC.
+ * All rights reserved.
+ *
+ * This source code is licensed under the BSD-style license found in the
+ * LICENSE file in the root directory of this source tree. An additional grant
+ * of patent rights can be found in the PATENTS file in the same directory.
+ */
-#import
#import
+#import
+
+#import
+
+PF_ASSUME_NONNULL_BEGIN
+
+@class PFGeoPoint;
+
+typedef void(^PFGeoPointResultBlock)(PFGeoPoint *PF_NULLABLE_S geoPoint, NSError *PF_NULLABLE_S error);
/*!
`PFGeoPoint` may be used to embed a latitude / longitude point as the value for a key in a .
It could be used to perform queries in a geospatial manner using <[PFQuery whereKey:nearGeoPoint:]>.
-
+
Currently, instances of may only have one key associated with a `PFGeoPoint` type.
*/
@interface PFGeoPoint : NSObject
@@ -24,7 +35,7 @@
@returns Returns a new `PFGeoPoint`.
*/
-+ (PFGeoPoint *)geoPoint;
++ (instancetype)geoPoint;
/*!
@abstract Creates a new `PFGeoPoint` object for the given `CLLocation`, set to the location's coordinates.
@@ -33,7 +44,7 @@
@returns Returns a new PFGeoPoint at specified location.
*/
-+ (PFGeoPoint *)geoPointWithLocation:(CLLocation *)location;
++ (instancetype)geoPointWithLocation:(PF_NULLABLE CLLocation *)location;
/*!
@abstract Create a new `PFGeoPoint` object with the specified latitude and longitude.
@@ -43,15 +54,15 @@
@returns New point object with specified latitude and longitude.
*/
-+ (PFGeoPoint *)geoPointWithLatitude:(double)latitude longitude:(double)longitude;
++ (instancetype)geoPointWithLatitude:(double)latitude longitude:(double)longitude;
/*!
@abstract Fetches the current device location and executes a block with a new `PFGeoPoint` object.
- @param geoPointHandler A block which takes the newly created `PFGeoPoint` as an argument.
+ @param resultBlock A block which takes the newly created `PFGeoPoint` as an argument.
It should have the following argument signature: `^(PFGeoPoint *geoPoint, NSError *error)`
*/
-+ (void)geoPointForCurrentLocationInBackground:(void(^)(PFGeoPoint *geoPoint, NSError *error))geoPointHandler;
++ (void)geoPointForCurrentLocationInBackground:(PF_NULLABLE PFGeoPointResultBlock)resultBlock;
///--------------------------------------
/// @name Controlling Position
@@ -78,7 +89,7 @@
@returns Distance in radians between the receiver and `point`.
*/
-- (double)distanceInRadiansTo:(PFGeoPoint *)point;
+- (double)distanceInRadiansTo:(PF_NULLABLE PFGeoPoint *)point;
/*!
@abstract Get distance in miles from this point to specified point.
@@ -87,7 +98,7 @@
@returns Distance in miles between the receiver and `point`.
*/
-- (double)distanceInMilesTo:(PFGeoPoint *)point;
+- (double)distanceInMilesTo:(PF_NULLABLE PFGeoPoint *)point;
/*!
@abstract Get distance in kilometers from this point to specified point.
@@ -96,6 +107,8 @@
@returns Distance in kilometers between the receiver and `point`.
*/
-- (double)distanceInKilometersTo:(PFGeoPoint *)point;
+- (double)distanceInKilometersTo:(PF_NULLABLE PFGeoPoint *)point;
@end
+
+PF_ASSUME_NONNULL_END
diff --git a/src/ios/Frameworks/Parse.framework/Headers/PFInstallation.h b/src/ios/Frameworks/Parse.framework/Headers/PFInstallation.h
index 98156c96..7907a751 100644
--- a/src/ios/Frameworks/Parse.framework/Headers/PFInstallation.h
+++ b/src/ios/Frameworks/Parse.framework/Headers/PFInstallation.h
@@ -1,14 +1,20 @@
-//
-// PFInstallation.h
-//
-// Copyright 2011-present Parse Inc. All rights reserved.
-//
+/**
+ * Copyright (c) 2015-present, Parse, LLC.
+ * All rights reserved.
+ *
+ * This source code is licensed under the BSD-style license found in the
+ * LICENSE file in the root directory of this source tree. An additional grant
+ * of patent rights can be found in the PATENTS file in the same directory.
+ */
#import
+#import
#import
#import
+PF_ASSUME_NONNULL_BEGIN
+
/*!
A Parse Framework Installation Object that is a local representation of an
installation persisted to the Parse cloud. This class is a subclass of a
@@ -25,32 +31,10 @@
`PFInstallation` objects which have a valid and are saved to
the Parse cloud can be used to target push notifications.
-
- This class is currently for iOS only. There is no `PFInstallation` for Parse
- applications running on OS X, because they cannot receive push notifications.
*/
@interface PFInstallation : PFObject
-/*!
- @abstract The name of the Installation class in the REST API.
-
- @discussion This is a required PFSubclassing method.
- */
-+ (NSString *)parseClassName;
-
-///--------------------------------------
-/// @name Targeting Installations
-///--------------------------------------
-
-/*!
- @abstract Creates a for `PFInstallation` objects.
-
- @discussion The resulting query can only be used for targeting a .
- Calling find methods on the resulting query will raise an exception.
- */
-+ (PFQuery *)query;
-
///--------------------------------------
/// @name Accessing the Current Installation
///--------------------------------------
@@ -66,13 +50,6 @@
*/
+ (instancetype)currentInstallation;
-/*!
- @abstract Sets the device token string property from an `NSData`-encoded token.
-
- @param deviceTokenData A token that identifies the device.
- */
-- (void)setDeviceTokenFromData:(NSData *)deviceTokenData;
-
///--------------------------------------
/// @name Installation Properties
///--------------------------------------
@@ -80,17 +57,17 @@
/*!
@abstract The device type for the `PFInstallation`.
*/
-@property (nonatomic, strong, readonly) NSString *deviceType;
+@property (nonatomic, copy, readonly) NSString *deviceType;
/*!
@abstract The installationId for the `PFInstallation`.
*/
-@property (nonatomic, strong, readonly) NSString *installationId;
+@property (nonatomic, copy, readonly) NSString *installationId;
/*!
@abstract The device token for the `PFInstallation`.
*/
-@property (nonatomic, strong) NSString *deviceToken;
+@property (PF_NULLABLE_PROPERTY nonatomic, copy) NSString *deviceToken;
/*!
@abstract The badge for the `PFInstallation`.
@@ -100,11 +77,37 @@
/*!
@abstract The name of the time zone for the `PFInstallation`.
*/
-@property (nonatomic, strong, readonly) NSString *timeZone;
+@property (PF_NULLABLE_PROPERTY nonatomic, copy, readonly) NSString *timeZone;
/*!
@abstract The channels for the `PFInstallation`.
*/
-@property (nonatomic, strong) NSArray *channels;
+@property (PF_NULLABLE_PROPERTY nonatomic, copy) NSArray *channels;
+
+/*!
+ @abstract Sets the device token string property from an `NSData`-encoded token.
+
+ @param deviceTokenData A token that identifies the device.
+ */
+- (void)setDeviceTokenFromData:(PF_NULLABLE NSData *)deviceTokenData;
+
+///--------------------------------------
+/// @name Querying for Installations
+///--------------------------------------
+
+/*!
+ @abstract Creates a for `PFInstallation` objects.
+
+ @discussion Only the following types of queries are allowed for installations:
+
+ - `[query getObjectWithId:]`
+ - `[query whereKey:@"installationId" equalTo:]`
+ - `[query whereKey:@"installationId" matchesKey: inQuery:]`
+
+ You can add additional query conditions, but one of the above must appear as a top-level `AND` clause in the query.
+ */
++ (PF_NULLABLE PFQuery *)query;
@end
+
+PF_ASSUME_NONNULL_END
diff --git a/src/ios/Frameworks/Parse.framework/Headers/PFNetworkActivityIndicatorManager.h b/src/ios/Frameworks/Parse.framework/Headers/PFNetworkActivityIndicatorManager.h
index 5dbd8070..d5b376a5 100644
--- a/src/ios/Frameworks/Parse.framework/Headers/PFNetworkActivityIndicatorManager.h
+++ b/src/ios/Frameworks/Parse.framework/Headers/PFNetworkActivityIndicatorManager.h
@@ -1,10 +1,18 @@
-//
-// PFNetworkActivityIndicatorManager.h
-//
-// Copyright 2011-present Parse Inc. All rights reserved.
-//
+/**
+ * Copyright (c) 2015-present, Parse, LLC.
+ * All rights reserved.
+ *
+ * This source code is licensed under the BSD-style license found in the
+ * LICENSE file in the root directory of this source tree. An additional grant
+ * of patent rights can be found in the PATENTS file in the same directory.
+ */
#import
+#import
+
+#import
+
+PF_ASSUME_NONNULL_BEGIN
/*!
`PFNetworkActivityIndicatorManager` manages the state of the network activity indicator in the status bar.
@@ -58,3 +66,5 @@
- (void)decrementActivityCount;
@end
+
+PF_ASSUME_NONNULL_END
diff --git a/src/ios/Frameworks/Parse.framework/Headers/PFNullability.h b/src/ios/Frameworks/Parse.framework/Headers/PFNullability.h
new file mode 100644
index 00000000..8c1b9584
--- /dev/null
+++ b/src/ios/Frameworks/Parse.framework/Headers/PFNullability.h
@@ -0,0 +1,47 @@
+/**
+ * Copyright (c) 2015-present, Parse, LLC.
+ * All rights reserved.
+ *
+ * This source code is licensed under the BSD-style license found in the
+ * LICENSE file in the root directory of this source tree. An additional grant
+ * of patent rights can be found in the PATENTS file in the same directory.
+ */
+
+#ifndef Parse_PFNullability_h
+#define Parse_PFNullability_h
+
+///--------------------------------------
+/// @name Nullability Annotation Support
+///--------------------------------------
+
+#if __has_feature(nullability)
+# define PF_NONNULL nonnull
+# define PF_NONNULL_S __nonnull
+# define PF_NULLABLE nullable
+# define PF_NULLABLE_S __nullable
+# define PF_NULLABLE_PROPERTY nullable,
+#else
+# define PF_NONNULL
+# define PF_NONNULL_S
+# define PF_NULLABLE
+# define PF_NULLABLE_S
+# define PF_NULLABLE_PROPERTY
+#endif
+
+#if __has_feature(assume_nonnull)
+# ifdef NS_ASSUME_NONNULL_BEGIN
+# define PF_ASSUME_NONNULL_BEGIN NS_ASSUME_NONNULL_BEGIN
+# else
+# define PF_ASSUME_NONNULL_BEGIN _Pragma("clang assume_nonnull begin")
+# endif
+# ifdef NS_ASSUME_NONNULL_END
+# define PF_ASSUME_NONNULL_END NS_ASSUME_NONNULL_END
+# else
+# define PF_ASSUME_NONNULL_END _Pragma("clang assume_nonnull end")
+# endif
+#else
+# define PF_ASSUME_NONNULL_BEGIN
+# define PF_ASSUME_NONNULL_END
+#endif
+
+#endif
diff --git a/src/ios/Frameworks/Parse.framework/Headers/PFObject+Subclass.h b/src/ios/Frameworks/Parse.framework/Headers/PFObject+Subclass.h
index bd246be9..bda5dad3 100644
--- a/src/ios/Frameworks/Parse.framework/Headers/PFObject+Subclass.h
+++ b/src/ios/Frameworks/Parse.framework/Headers/PFObject+Subclass.h
@@ -1,22 +1,24 @@
-//
-// PFObject+Subclass.h
-//
-// Copyright 2011-present Parse Inc. All rights reserved.
-//
+/**
+ * Copyright (c) 2015-present, Parse, LLC.
+ * All rights reserved.
+ *
+ * This source code is licensed under the BSD-style license found in the
+ * LICENSE file in the root directory of this source tree. An additional grant
+ * of patent rights can be found in the PATENTS file in the same directory.
+ */
#import
-#if TARGET_OS_IPHONE
+#import
#import
-#else
-#import
-#endif
+
+PF_ASSUME_NONNULL_BEGIN
@class PFQuery;
/*!
### Subclassing Notes
-
+
Developers can subclass `PFObject` for a more native object-oriented class structure.
Strongly-typed subclasses of `PFObject` must conform to the protocol
and must call before <[Parse setApplicationId:clientKey:]> is called.
@@ -26,19 +28,19 @@
are already implemented in the `PFObject+Subclass` category.
Including `PFObject+Subclass.h` in your implementation file provides these implementations automatically.
-
+
Subclasses support simpler initializers, query syntax, and dynamic synthesizers.
The following shows an example subclass:
-
+
\@interface MYGame : PFObject
// Accessing this property is the same as objectForKey:@"title"
- @property (nonatomic, strong) NSString *title;
+ @property (nonatomic, copy) NSString *title;
+ (NSString *)parseClassName;
@end
-
+
@implementation MYGame
@@ -61,13 +63,6 @@
/// @name Methods for Subclasses
///--------------------------------------
-/*!
- @abstract Designated initializer for subclasses.
- This method can only be called on subclasses which conform to .
- This method should not be overridden.
- */
-- (instancetype)init;
-
/*!
@abstract Creates an instance of the registered subclass with this class's .
@@ -91,7 +86,7 @@
@returns An instance of `PFObject` without data.
*/
-+ (instancetype)objectWithoutDataWithObjectId:(NSString *)objectId;
++ (instancetype)objectWithoutDataWithObjectId:(PF_NULLABLE NSString *)objectId;
/*!
@abstract Registers an Objective-C class for Parse to use for representing a given Parse class.
@@ -109,7 +104,7 @@
@discussion This method can only be called on subclasses which conform to .
A default implementation is provided by which should always be sufficient.
*/
-+ (PFQuery *)query;
++ (PF_NULLABLE PFQuery *)query;
/*!
@abstract Returns a query for objects of type with a given predicate.
@@ -123,6 +118,8 @@
@see [PFQuery queryWithClassName:predicate:]
*/
-+ (PFQuery *)queryWithPredicate:(NSPredicate *)predicate;
++ (PF_NULLABLE PFQuery *)queryWithPredicate:(PF_NULLABLE NSPredicate *)predicate;
@end
+
+PF_ASSUME_NONNULL_END
diff --git a/src/ios/Frameworks/Parse.framework/Headers/PFObject.h b/src/ios/Frameworks/Parse.framework/Headers/PFObject.h
index ed209db8..3a7965ad 100644
--- a/src/ios/Frameworks/Parse.framework/Headers/PFObject.h
+++ b/src/ios/Frameworks/Parse.framework/Headers/PFObject.h
@@ -1,21 +1,22 @@
-//
-// PFObject.h
-//
-// Copyright 2011-present Parse Inc. All rights reserved.
-//
+/**
+ * Copyright (c) 2015-present, Parse, LLC.
+ * All rights reserved.
+ *
+ * This source code is licensed under the BSD-style license found in the
+ * LICENSE file in the root directory of this source tree. An additional grant
+ * of patent rights can be found in the PATENTS file in the same directory.
+ */
#import
-#if TARGET_OS_IPHONE
+#import
+
#import
#import
-#else
-#import
-#import
-#endif
+
+PF_ASSUME_NONNULL_BEGIN
@protocol PFSubclassing;
-@class BFTask;
@class PFRelation;
/*!
@@ -26,7 +27,7 @@ extern NSString *const PFObjectDefaultPin;
/*!
The `PFObject` class is a local representation of data persisted to the Parse cloud.
This is the main class that is used to interact with objects in your app.
-*/
+ */
NS_REQUIRES_PROPERTY_DEFINITIONS
@interface PFObject : NSObject {
BOOL dirty;
@@ -38,11 +39,7 @@ NS_REQUIRES_PROPERTY_DEFINITIONS
// Every time a save is started, a new dictionary is added to the end.
// Whenever a save completes, the new data is put into fetchedData, and
// a dictionary is removed from the start.
- NSMutableArray *operationSetQueue;
-
- // Our best estimate as to what the current data is, based on
- // the last fetch from the server, and the set of pending operations.
- NSMutableDictionary *estimatedData;
+ NSMutableArray *PF_NULLABLE_S operationSetQueue;
}
///--------------------------------------
@@ -50,28 +47,24 @@ NS_REQUIRES_PROPERTY_DEFINITIONS
///--------------------------------------
/*!
- @abstract Creates a new PFObject with a class name.
+ @abstract Initializes a new empty `PFObject` instance with a class name.
- @param className A class name can be any alphanumeric string that begins with a letter.
+ @param newClassName A class name can be any alphanumeric string that begins with a letter.
It represents an object in your app, like a 'User' or a 'Document'.
@returns Returns the object that is instantiated with the given class name.
*/
-+ (instancetype)objectWithClassName:(NSString *)className;
+- (instancetype)initWithClassName:(NSString *)newClassName;
/*!
- @abstract Creates a reference to an existing PFObject for use in creating associations between PFObjects.
-
- @discussion Calling on this object will return `NO` until has been called.
- No network request will be made.
+ @abstract Creates a new PFObject with a class name.
- @param className The object's class.
- @param objectId The object id for the referenced object.
+ @param className A class name can be any alphanumeric string that begins with a letter.
+ It represents an object in your app, like a 'User' or a 'Document'.
- @returns A `PFObject` instance without data.
+ @returns Returns the object that is instantiated with the given class name.
*/
-+ (instancetype)objectWithoutDataWithClassName:(NSString *)className
- objectId:(NSString *)objectId;
++ (instancetype)objectWithClassName:(NSString *)className;
/*!
@abstract Creates a new `PFObject` with a class name, initialized with data
@@ -82,17 +75,20 @@ NS_REQUIRES_PROPERTY_DEFINITIONS
@returns A PFObject with the given class name and set with the given data.
*/
-+ (PFObject *)objectWithClassName:(NSString *)className dictionary:(NSDictionary *)dictionary;
++ (instancetype)objectWithClassName:(NSString *)className dictionary:(PF_NULLABLE NSDictionary *)dictionary;
/*!
- @abstract Initializes a new empty `PFObject` instance with a class name.
+ @abstract Creates a reference to an existing PFObject for use in creating associations between PFObjects.
- @param newClassName A class name can be any alphanumeric string that begins with a letter.
- It represents an object in your app, like a 'User' or a 'Document'.
+ @discussion Calling on this object will return `NO` until has been called.
+ No network request will be made.
- @returns Returns the object that is instantiated with the given class name.
+ @param className The object's class.
+ @param objectId The object id for the referenced object.
+
+ @returns A `PFObject` instance without data.
*/
-- (instancetype)initWithClassName:(NSString *)newClassName;
++ (instancetype)objectWithoutDataWithClassName:(NSString *)className objectId:(PF_NULLABLE NSString *)objectId;
///--------------------------------------
/// @name Managing Object Properties
@@ -106,22 +102,22 @@ NS_REQUIRES_PROPERTY_DEFINITIONS
/*!
@abstract The id of the object.
*/
-@property (nonatomic, strong) NSString *objectId;
+@property (PF_NULLABLE_PROPERTY nonatomic, strong) NSString *objectId;
/*!
@abstract When the object was last updated.
*/
-@property (nonatomic, strong, readonly) NSDate *updatedAt;
+@property (PF_NULLABLE_PROPERTY nonatomic, strong, readonly) NSDate *updatedAt;
/*!
@abstract When the object was created.
*/
-@property (nonatomic, strong, readonly) NSDate *createdAt;
+@property (PF_NULLABLE_PROPERTY nonatomic, strong, readonly) NSDate *createdAt;
/*!
@abstract The ACL for this object.
*/
-@property (nonatomic, strong) PFACL *ACL;
+@property (PF_NULLABLE_PROPERTY nonatomic, strong) PFACL *ACL;
/*!
@abstract Returns an array of the keys contained in this object.
@@ -140,13 +136,18 @@ NS_REQUIRES_PROPERTY_DEFINITIONS
@param key The key for which to return the corresponding value.
*/
-- (id)objectForKey:(NSString *)key;
+- (PF_NULLABLE_S id)objectForKey:(NSString *)key;
/*!
@abstract Sets the object associated with a given key.
- @param object The object.
- @param key The key.
+ @param object The object for `key`. A strong reference to the object is maintained by PFObject.
+ Raises an `NSInvalidArgumentException` if `object` is `nil`.
+ If you need to represent a `nil` value - use `NSNull`.
+ @param key The key for `object`.
+ Raises an `NSInvalidArgumentException` if `key` is `nil`.
+
+ @see setObject:forKeyedSubscript:
*/
- (void)setObject:(id)object forKey:(NSString *)key;
@@ -163,11 +164,11 @@ NS_REQUIRES_PROPERTY_DEFINITIONS
@discussion This method enables usage of literal syntax on `PFObject`.
E.g. `NSString *value = object[@"key"];`
- @see objectForKey:
-
@param key The key for which to return the corresponding value.
+
+ @see objectForKey:
*/
-- (id)objectForKeyedSubscript:(NSString *)key;
+- (PF_NULLABLE_S id)objectForKeyedSubscript:(NSString *)key;
/*!
@abstract Returns the value associated with a given key.
@@ -175,10 +176,13 @@ NS_REQUIRES_PROPERTY_DEFINITIONS
@discussion This method enables usage of literal syntax on `PFObject`.
E.g. `object[@"key"] = @"value";`
- @see setObject:forKey:
+ @param object The object for `key`. A strong reference to the object is maintained by PFObject.
+ Raises an `NSInvalidArgumentException` if `object` is `nil`.
+ If you need to represent a `nil` value - use `NSNull`.
+ @param key The key for `object`.
+ Raises an `NSInvalidArgumentException` if `key` is `nil`.
- @param object The object.
- @param key The key.
+ @see setObject:forKey:
*/
- (void)setObject:(id)object forKeyedSubscript:(NSString *)key;
@@ -198,6 +202,19 @@ NS_REQUIRES_PROPERTY_DEFINITIONS
*/
- (PFRelation *)relationforKey:(NSString *)key PARSE_DEPRECATED("Please use -relationForKey: instead.");
+/*!
+ @abstract Clears any changes to this object made since the last call to save and sets it back to the server state.
+ */
+- (void)revert;
+
+/*!
+ @abstract Clears any changes to this object's key that were done after last successful save and sets it back to the
+ server state.
+
+ @param key The key to revert changes for.
+ */
+- (void)revertObjectForKey:(NSString *)key;
+
///--------------------------------------
/// @name Array Accessors
///--------------------------------------
@@ -283,7 +300,7 @@ NS_REQUIRES_PROPERTY_DEFINITIONS
@returns Returns whether the save succeeded.
*/
-- (BOOL)save;
+- (BOOL)save PF_SWIFT_UNAVAILABLE;
/*!
@abstract *Synchronously* saves the `PFObject` and sets an error if it occurs.
@@ -307,7 +324,7 @@ NS_REQUIRES_PROPERTY_DEFINITIONS
@param block The block to execute.
It should have the following argument signature: `^(BOOL succeeded, NSError *error)`.
*/
-- (void)saveInBackgroundWithBlock:(PFBooleanResultBlock)block;
+- (void)saveInBackgroundWithBlock:(PF_NULLABLE PFBooleanResultBlock)block;
/*
@abstract Saves the `PFObject` asynchronously and calls the given callback.
@@ -318,12 +335,26 @@ NS_REQUIRES_PROPERTY_DEFINITIONS
`error` will be `nil` on success and set if there was an error.
`[result boolValue]` will tell you whether the call succeeded or not.
*/
-- (void)saveInBackgroundWithTarget:(id)target selector:(SEL)selector;
+- (void)saveInBackgroundWithTarget:(PF_NULLABLE_S id)target selector:(PF_NULLABLE_S SEL)selector;
/*!
- @see saveEventually:
+ @abstract Saves this object to the server at some unspecified time in the future,
+ even if Parse is currently inaccessible.
+
+ @discussion Use this when you may not have a solid network connection, and don't need to know when the save completes.
+ If there is some problem with the object such that it can't be saved, it will be silently discarded. If the save
+ completes successfully while the object is still in memory, then callback will be called.
+
+ Objects saved with this method will be stored locally in an on-disk cache until they can be delivered to Parse.
+ They will be sent immediately if possible. Otherwise, they will be sent the next time a network connection is
+ available. Objects saved this way will persist even after the app is closed, in which case they will be sent the
+ next time the app is opened. If more than 10MB of data is waiting to be sent, subsequent calls to
+ will cause old saves to be silently discarded until the connection can be re-established, and the queued objects
+ can be saved.
+
+ @returns The task that encapsulates the work being done.
*/
-- (void)saveEventually;
+- (BFTask *)saveEventually;
/*!
@abstract Saves this object to the server at some unspecified time in the future,
@@ -343,7 +374,7 @@ NS_REQUIRES_PROPERTY_DEFINITIONS
@param callback The block to execute.
It should have the following argument signature: `^(BOOL succeeded, NSError *error)`.
*/
-- (void)saveEventually:(PFBooleanResultBlock)callback;
+- (void)saveEventually:(PF_NULLABLE PFBooleanResultBlock)callback;
///--------------------------------------
/// @name Saving Many Objects
@@ -356,7 +387,7 @@ NS_REQUIRES_PROPERTY_DEFINITIONS
@returns Returns whether the save succeeded.
*/
-+ (BOOL)saveAll:(NSArray *)objects;
++ (BOOL)saveAll:(PF_NULLABLE NSArray *)objects PF_SWIFT_UNAVAILABLE;
/*!
@abstract Saves a collection of objects *synchronously* all at once and sets an error if necessary.
@@ -366,7 +397,7 @@ NS_REQUIRES_PROPERTY_DEFINITIONS
@returns Returns whether the save succeeded.
*/
-+ (BOOL)saveAll:(NSArray *)objects error:(NSError **)error;
++ (BOOL)saveAll:(PF_NULLABLE NSArray *)objects error:(NSError **)error;
/*!
@abstract Saves a collection of objects all at once *asynchronously*.
@@ -375,7 +406,7 @@ NS_REQUIRES_PROPERTY_DEFINITIONS
@returns The task that encapsulates the work being done.
*/
-+ (BFTask *)saveAllInBackground:(NSArray *)objects;
++ (BFTask *)saveAllInBackground:(PF_NULLABLE NSArray *)objects;
/*!
@abstract Saves a collection of objects all at once `asynchronously` and executes the block when done.
@@ -384,8 +415,8 @@ NS_REQUIRES_PROPERTY_DEFINITIONS
@param block The block to execute.
It should have the following argument signature: `^(BOOL succeeded, NSError *error)`.
*/
-+ (void)saveAllInBackground:(NSArray *)objects
- block:(PFBooleanResultBlock)block;
++ (void)saveAllInBackground:(PF_NULLABLE NSArray *)objects
+ block:(PF_NULLABLE PFBooleanResultBlock)block;
/*
@abstract Saves a collection of objects all at once *asynchronously* and calls a callback when done.
@@ -397,9 +428,9 @@ NS_REQUIRES_PROPERTY_DEFINITIONS
`error` will be `nil` on success and set if there was an error.
`[result boolValue]` will tell you whether the call succeeded or not.
*/
-+ (void)saveAllInBackground:(NSArray *)objects
- target:(id)target
- selector:(SEL)selector;
++ (void)saveAllInBackground:(PF_NULLABLE NSArray *)objects
+ target:(PF_NULLABLE_S id)target
+ selector:(PF_NULLABLE_S SEL)selector;
///--------------------------------------
/// @name Deleting Many Objects
@@ -412,7 +443,7 @@ NS_REQUIRES_PROPERTY_DEFINITIONS
@returns Returns whether the delete succeeded.
*/
-+ (BOOL)deleteAll:(NSArray *)objects;
++ (BOOL)deleteAll:(PF_NULLABLE NSArray *)objects PF_SWIFT_UNAVAILABLE;
/*!
@abstract *Synchronously* deletes a collection of objects all at once and sets an error if necessary.
@@ -422,14 +453,14 @@ NS_REQUIRES_PROPERTY_DEFINITIONS
@returns Returns whether the delete succeeded.
*/
-+ (BOOL)deleteAll:(NSArray *)objects error:(NSError **)error;
++ (BOOL)deleteAll:(PF_NULLABLE NSArray *)objects error:(NSError **)error;
/*!
@abstract Deletes a collection of objects all at once asynchronously.
@param objects The array of objects to delete.
@returns The task that encapsulates the work being done.
*/
-+ (BFTask *)deleteAllInBackground:(NSArray *)objects;
++ (BFTask *)deleteAllInBackground:(PF_NULLABLE NSArray *)objects;
/*!
@abstract Deletes a collection of objects all at once *asynchronously* and executes the block when done.
@@ -438,8 +469,8 @@ NS_REQUIRES_PROPERTY_DEFINITIONS
@param block The block to execute.
It should have the following argument signature: `^(BOOL succeeded, NSError *error)`.
*/
-+ (void)deleteAllInBackground:(NSArray *)objects
- block:(PFBooleanResultBlock)block;
++ (void)deleteAllInBackground:(PF_NULLABLE NSArray *)objects
+ block:(PF_NULLABLE PFBooleanResultBlock)block;
/*
@abstract Deletes a collection of objects all at once *asynchronously* and calls a callback when done.
@@ -451,9 +482,9 @@ NS_REQUIRES_PROPERTY_DEFINITIONS
`error` will be `nil` on success and set if there was an error.
`[result boolValue]` will tell you whether the call succeeded or not.
*/
-+ (void)deleteAllInBackground:(NSArray *)objects
- target:(id)target
- selector:(SEL)selector;
++ (void)deleteAllInBackground:(PF_NULLABLE NSArray *)objects
+ target:(PF_NULLABLE_S id)target
+ selector:(PF_NULLABLE_S SEL)selector;
///--------------------------------------
/// @name Getting an Object
@@ -473,7 +504,7 @@ NS_REQUIRES_PROPERTY_DEFINITIONS
@deprecated Please use `-fetch` instead.
*/
-- (void)refresh PARSE_DEPRECATED("Please use `-fetch` instead.");
+- (PF_NULLABLE instancetype)refresh PF_SWIFT_UNAVAILABLE PARSE_DEPRECATED("Please use `-fetch` instead.");
/*!
@abstract *Synchronously* refreshes the `PFObject` with the current data from the server and sets an error if it occurs.
@@ -482,7 +513,7 @@ NS_REQUIRES_PROPERTY_DEFINITIONS
@deprecated Please use `-fetch:` instead.
*/
-- (void)refresh:(NSError **)error PARSE_DEPRECATED("Please use `-fetch:` instead.");
+- (PF_NULLABLE instancetype)refresh:(NSError **)error PARSE_DEPRECATED("Please use `-fetch:` instead.");
/*!
@abstract *Asynchronously* refreshes the `PFObject` and executes the given callback block.
@@ -492,7 +523,7 @@ NS_REQUIRES_PROPERTY_DEFINITIONS
@deprecated Please use `-fetchInBackgroundWithBlock:` instead.
*/
-- (void)refreshInBackgroundWithBlock:(PFObjectResultBlock)block PARSE_DEPRECATED("Please use `-fetchInBackgroundWithBlock:` instead.");
+- (void)refreshInBackgroundWithBlock:(PF_NULLABLE PFObjectResultBlock)block PARSE_DEPRECATED("Please use `-fetchInBackgroundWithBlock:` instead.");
/*
@abstract *Asynchronously* refreshes the `PFObject` and calls the given callback.
@@ -505,33 +536,33 @@ NS_REQUIRES_PROPERTY_DEFINITIONS
@deprecated Please use `fetchInBackgroundWithTarget:selector:` instead.
*/
-- (void)refreshInBackgroundWithTarget:(id)target
- selector:(SEL)selector PARSE_DEPRECATED("Please use `fetchInBackgroundWithTarget:selector:` instead.");
+- (void)refreshInBackgroundWithTarget:(PF_NULLABLE_S id)target
+ selector:(PF_NULLABLE_S SEL)selector PARSE_DEPRECATED("Please use `fetchInBackgroundWithTarget:selector:` instead.");
#endif
/*!
@abstract *Synchronously* fetches the PFObject with the current data from the server.
*/
-- (void)fetch;
+- (PF_NULLABLE instancetype)fetch PF_SWIFT_UNAVAILABLE;
/*!
@abstract *Synchronously* fetches the PFObject with the current data from the server and sets an error if it occurs.
@param error Pointer to an `NSError` that will be set if necessary.
*/
-- (void)fetch:(NSError **)error;
+- (PF_NULLABLE instancetype)fetch:(NSError **)error;
/*!
@abstract *Synchronously* fetches the `PFObject` data from the server if is `NO`.
*/
-- (PFObject *)fetchIfNeeded;
+- (PF_NULLABLE instancetype)fetchIfNeeded PF_SWIFT_UNAVAILABLE;
/*!
@abstract *Synchronously* fetches the `PFObject` data from the server if is `NO`.
@param error Pointer to an `NSError` that will be set if necessary.
*/
-- (PFObject *)fetchIfNeeded:(NSError **)error;
+- (PF_NULLABLE instancetype)fetchIfNeeded:(NSError **)error;
/*!
@abstract Fetches the `PFObject` *asynchronously* and sets it as a result for the task.
@@ -546,7 +577,7 @@ NS_REQUIRES_PROPERTY_DEFINITIONS
@param block The block to execute.
It should have the following argument signature: `^(PFObject *object, NSError *error)`.
*/
-- (void)fetchInBackgroundWithBlock:(PFObjectResultBlock)block;
+- (void)fetchInBackgroundWithBlock:(PF_NULLABLE PFObjectResultBlock)block;
/*
@abstract Fetches the `PFObject *asynchronously* and calls the given callback.
@@ -557,7 +588,7 @@ NS_REQUIRES_PROPERTY_DEFINITIONS
`error` will be `nil` on success and set if there was an error.
`refreshedObject` will be the `PFObject` with the refreshed data.
*/
-- (void)fetchInBackgroundWithTarget:(id)target selector:(SEL)selector;
+- (void)fetchInBackgroundWithTarget:(PF_NULLABLE_S id)target selector:(PF_NULLABLE_S SEL)selector;
/*!
@abstract Fetches the `PFObject` data *asynchronously* if isDataAvailable is `NO`,
@@ -573,7 +604,7 @@ NS_REQUIRES_PROPERTY_DEFINITIONS
@param block The block to execute.
It should have the following argument signature: `^(PFObject *object, NSError *error)`.
*/
-- (void)fetchIfNeededInBackgroundWithBlock:(PFObjectResultBlock)block;
+- (void)fetchIfNeededInBackgroundWithBlock:(PF_NULLABLE PFObjectResultBlock)block;
/*
@abstract Fetches the PFObject's data asynchronously if isDataAvailable is false, then calls the callback.
@@ -584,8 +615,7 @@ NS_REQUIRES_PROPERTY_DEFINITIONS
`error` will be `nil` on success and set if there was an error.
`refreshedObject` will be the `PFObject` with the refreshed data.
*/
-- (void)fetchIfNeededInBackgroundWithTarget:(id)target
- selector:(SEL)selector;
+- (void)fetchIfNeededInBackgroundWithTarget:(PF_NULLABLE_S id)target selector:(PF_NULLABLE_S SEL)selector;
///--------------------------------------
/// @name Getting Many Objects
@@ -596,7 +626,7 @@ NS_REQUIRES_PROPERTY_DEFINITIONS
@param objects The list of objects to fetch.
*/
-+ (void)fetchAll:(NSArray *)objects;
++ (PF_NULLABLE NSArray *)fetchAll:(PF_NULLABLE NSArray *)objects PF_SWIFT_UNAVAILABLE;
/*!
@abstract *Synchronously* fetches all of the `PFObject` objects with the current data from the server
@@ -605,13 +635,13 @@ NS_REQUIRES_PROPERTY_DEFINITIONS
@param objects The list of objects to fetch.
@param error Pointer to an `NSError` that will be set if necessary.
*/
-+ (void)fetchAll:(NSArray *)objects error:(NSError **)error;
++ (PF_NULLABLE NSArray *)fetchAll:(PF_NULLABLE NSArray *)objects error:(NSError **)error;
/*!
@abstract *Synchronously* fetches all of the `PFObject` objects with the current data from the server.
@param objects The list of objects to fetch.
*/
-+ (void)fetchAllIfNeeded:(NSArray *)objects;
++ (PF_NULLABLE NSArray *)fetchAllIfNeeded:(PF_NULLABLE NSArray *)objects PF_SWIFT_UNAVAILABLE;
/*!
@abstract *Synchronously* fetches all of the `PFObject` objects with the current data from the server
@@ -620,7 +650,7 @@ NS_REQUIRES_PROPERTY_DEFINITIONS
@param objects The list of objects to fetch.
@param error Pointer to an `NSError` that will be set if necessary.
*/
-+ (void)fetchAllIfNeeded:(NSArray *)objects error:(NSError **)error;
++ (PF_NULLABLE NSArray *)fetchAllIfNeeded:(PF_NULLABLE NSArray *)objects error:(NSError **)error;
/*!
@abstract Fetches all of the `PFObject` objects with the current data from the server *asynchronously*.
@@ -629,7 +659,7 @@ NS_REQUIRES_PROPERTY_DEFINITIONS
@returns The task that encapsulates the work being done.
*/
-+ (BFTask *)fetchAllInBackground:(NSArray *)objects;
++ (BFTask *)fetchAllInBackground:(PF_NULLABLE NSArray *)objects;
/*!
@abstract Fetches all of the `PFObject` objects with the current data from the server *asynchronously*
@@ -639,8 +669,8 @@ NS_REQUIRES_PROPERTY_DEFINITIONS
@param block The block to execute.
It should have the following argument signature: `^(NSArray *objects, NSError *error)`.
*/
-+ (void)fetchAllInBackground:(NSArray *)objects
- block:(PFArrayResultBlock)block;
++ (void)fetchAllInBackground:(PF_NULLABLE NSArray *)objects
+ block:(PF_NULLABLE PFArrayResultBlock)block;
/*
@abstract Fetches all of the `PFObject` objects with the current data from the server *asynchronously*
@@ -653,9 +683,9 @@ NS_REQUIRES_PROPERTY_DEFINITIONS
`error` will be `nil` on success and set if there was an error.
`fetchedObjects` will the array of `PFObject` objects that were fetched.
*/
-+ (void)fetchAllInBackground:(NSArray *)objects
- target:(id)target
- selector:(SEL)selector;
++ (void)fetchAllInBackground:(PF_NULLABLE NSArray *)objects
+ target:(PF_NULLABLE_S id)target
+ selector:(PF_NULLABLE_S SEL)selector;
/*!
@abstract Fetches all of the `PFObject` objects with the current data from the server *asynchronously*.
@@ -664,7 +694,7 @@ NS_REQUIRES_PROPERTY_DEFINITIONS
@returns The task that encapsulates the work being done.
*/
-+ (BFTask *)fetchAllIfNeededInBackground:(NSArray *)objects;
++ (BFTask *)fetchAllIfNeededInBackground:(PF_NULLABLE NSArray *)objects;
/*!
@abstract Fetches all of the PFObjects with the current data from the server *asynchronously*
@@ -674,8 +704,8 @@ NS_REQUIRES_PROPERTY_DEFINITIONS
@param block The block to execute.
It should have the following argument signature: `^(NSArray *objects, NSError *error)`.
*/
-+ (void)fetchAllIfNeededInBackground:(NSArray *)objects
- block:(PFArrayResultBlock)block;
++ (void)fetchAllIfNeededInBackground:(PF_NULLABLE NSArray *)objects
+ block:(PF_NULLABLE PFArrayResultBlock)block;
/*
@abstract Fetches all of the PFObjects with the current data from the server *asynchronously*
@@ -688,9 +718,9 @@ NS_REQUIRES_PROPERTY_DEFINITIONS
`error` will be `nil` on success and set if there was an error.
`fetchedObjects` will the array of `PFObject` objects that were fetched.
*/
-+ (void)fetchAllIfNeededInBackground:(NSArray *)objects
- target:(id)target
- selector:(SEL)selector;
++ (void)fetchAllIfNeededInBackground:(PF_NULLABLE NSArray *)objects
+ target:(PF_NULLABLE_S id)target
+ selector:(PF_NULLABLE_S SEL)selector;
///--------------------------------------
/// @name Fetching From Local Datastore
@@ -700,7 +730,7 @@ NS_REQUIRES_PROPERTY_DEFINITIONS
@abstract *Synchronously* loads data from the local datastore into this object,
if it has not been fetched from the server already.
*/
-- (void)fetchFromLocalDatastore;
+- (PF_NULLABLE instancetype)fetchFromLocalDatastore PF_SWIFT_UNAVAILABLE;
/*!
@abstract *Synchronously* loads data from the local datastore into this object, if it has not been fetched
@@ -711,7 +741,7 @@ NS_REQUIRES_PROPERTY_DEFINITIONS
@param error Pointer to an `NSError` that will be set if necessary.
*/
-- (void)fetchFromLocalDatastore:(NSError **)error;
+- (PF_NULLABLE instancetype)fetchFromLocalDatastore:(NSError **)error;
/*!
@abstract *Asynchronously* loads data from the local datastore into this object,
@@ -728,7 +758,7 @@ NS_REQUIRES_PROPERTY_DEFINITIONS
@param block The block to execute.
It should have the following argument signature: `^(PFObject *object, NSError *error)`.
*/
-- (void)fetchFromLocalDatastoreInBackgroundWithBlock:(PFObjectResultBlock)block;
+- (void)fetchFromLocalDatastoreInBackgroundWithBlock:(PF_NULLABLE PFObjectResultBlock)block;
///--------------------------------------
/// @name Deleting an Object
@@ -739,7 +769,7 @@ NS_REQUIRES_PROPERTY_DEFINITIONS
@returns Returns whether the delete succeeded.
*/
-- (BOOL)delete;
+- (BOOL)delete PF_SWIFT_UNAVAILABLE;
/*!
@abstract *Synchronously* deletes the `PFObject` and sets an error if it occurs.
@@ -763,7 +793,7 @@ NS_REQUIRES_PROPERTY_DEFINITIONS
@param block The block to execute.
It should have the following argument signature: `^(BOOL succeeded, NSError *error)`.
*/
-- (void)deleteInBackgroundWithBlock:(PFBooleanResultBlock)block;
+- (void)deleteInBackgroundWithBlock:(PF_NULLABLE PFBooleanResultBlock)block;
/*
@abstract Deletes the `PFObject` *asynchronously* and calls the given callback.
@@ -774,8 +804,8 @@ NS_REQUIRES_PROPERTY_DEFINITIONS
`error` will be `nil` on success and set if there was an error.
`[result boolValue]` will tell you whether the call succeeded or not.
*/
-- (void)deleteInBackgroundWithTarget:(id)target
- selector:(SEL)selector;
+- (void)deleteInBackgroundWithTarget:(PF_NULLABLE_S id)target
+ selector:(PF_NULLABLE_S SEL)selector;
/*!
@abstract Deletes this object from the server at some unspecified time in the future,
@@ -791,8 +821,10 @@ NS_REQUIRES_PROPERTY_DEFINITIONS
next time the app is opened. If more than 10MB of or commands are waiting
to be sent, subsequent calls to or will cause old requests to be silently discarded
until the connection can be re-established, and the queued requests can go through.
+
+ @returns The task that encapsulates the work being done.
*/
-- (void)deleteEventually;
+- (BFTask *)deleteEventually;
///--------------------------------------
/// @name Dirtiness
@@ -834,7 +866,7 @@ NS_REQUIRES_PROPERTY_DEFINITIONS
@see unpin:
@see PFObjectDefaultPin
*/
-- (BOOL)pin;
+- (BOOL)pin PF_SWIFT_UNAVAILABLE;
/*!
@abstract *Synchronously* stores the object and every object it points to in the local datastore, recursively,
@@ -868,7 +900,7 @@ NS_REQUIRES_PROPERTY_DEFINITIONS
@see unpinWithName:
*/
-- (BOOL)pinWithName:(NSString *)name;
+- (BOOL)pinWithName:(NSString *)name PF_SWIFT_UNAVAILABLE;
/*!
@abstract *Synchronously* stores the object and every object it points to in the local datastore, recursively.
@@ -919,7 +951,7 @@ NS_REQUIRES_PROPERTY_DEFINITIONS
@see unpinInBackgroundWithBlock:
@see PFObjectDefaultPin
*/
-- (void)pinInBackgroundWithBlock:(PFBooleanResultBlock)block;
+- (void)pinInBackgroundWithBlock:(PF_NULLABLE PFBooleanResultBlock)block;
/*!
@abstract *Asynchronously* stores the object and every object it points to in the local datastore, recursively.
@@ -951,8 +983,7 @@ NS_REQUIRES_PROPERTY_DEFINITIONS
@see unpinInBackgroundWithName:block:
*/
-- (void)pinInBackgroundWithName:(NSString *)name
- block:(PFBooleanResultBlock)block;
+- (void)pinInBackgroundWithName:(NSString *)name block:(PF_NULLABLE PFBooleanResultBlock)block;
///--------------------------------------
/// @name Pinning Many Objects
@@ -974,7 +1005,7 @@ NS_REQUIRES_PROPERTY_DEFINITIONS
@see unpinAll:
@see PFObjectDefaultPin
*/
-+ (BOOL)pinAll:(NSArray *)objects;
++ (BOOL)pinAll:(PF_NULLABLE NSArray *)objects PF_SWIFT_UNAVAILABLE;
/*!
@abstract *Synchronously* stores the objects and every object they point to in the local datastore, recursively,
@@ -993,7 +1024,7 @@ NS_REQUIRES_PROPERTY_DEFINITIONS
@see unpinAll:error:
@see PFObjectDefaultPin
*/
-+ (BOOL)pinAll:(NSArray *)objects error:(NSError **)error;
++ (BOOL)pinAll:(PF_NULLABLE NSArray *)objects error:(NSError **)error;
/*!
@abstract *Synchronously* stores the objects and every object they point to in the local datastore, recursively.
@@ -1010,7 +1041,7 @@ NS_REQUIRES_PROPERTY_DEFINITIONS
@see unpinAll:withName:
*/
-+ (BOOL)pinAll:(NSArray *)objects withName:(NSString *)name;
++ (BOOL)pinAll:(PF_NULLABLE NSArray *)objects withName:(NSString *)name PF_SWIFT_UNAVAILABLE;
/*!
@abstract *Synchronously* stores the objects and every object they point to in the local datastore, recursively.
@@ -1028,7 +1059,7 @@ NS_REQUIRES_PROPERTY_DEFINITIONS
@see unpinAll:withName:error:
*/
-+ (BOOL)pinAll:(NSArray *)objects
++ (BOOL)pinAll:(PF_NULLABLE NSArray *)objects
withName:(NSString *)name
error:(NSError **)error;
@@ -1048,7 +1079,7 @@ NS_REQUIRES_PROPERTY_DEFINITIONS
@see unpinAllInBackground:
@see PFObjectDefaultPin
*/
-+ (BFTask *)pinAllInBackground:(NSArray *)objects;
++ (BFTask *)pinAllInBackground:(PF_NULLABLE NSArray *)objects;
/*!
@abstract *Asynchronously* stores the objects and every object they point to in the local datastore, recursively,
@@ -1066,8 +1097,7 @@ NS_REQUIRES_PROPERTY_DEFINITIONS
@see unpinAllInBackground:block:
@see PFObjectDefaultPin
*/
-+ (void)pinAllInBackground:(NSArray *)objects
- block:(PFBooleanResultBlock)block;
++ (void)pinAllInBackground:(PF_NULLABLE NSArray *)objects block:(PF_NULLABLE PFBooleanResultBlock)block;
/*!
@abstract *Asynchronously* stores the objects and every object they point to in the local datastore, recursively.
@@ -1084,8 +1114,7 @@ NS_REQUIRES_PROPERTY_DEFINITIONS
@see unpinAllInBackground:withName:
*/
-+ (BFTask *)pinAllInBackground:(NSArray *)objects
- withName:(NSString *)name;
++ (BFTask *)pinAllInBackground:(PF_NULLABLE NSArray *)objects withName:(NSString *)name;
/*!
@abstract *Asynchronously* stores the objects and every object they point to in the local datastore, recursively.
@@ -1102,9 +1131,9 @@ NS_REQUIRES_PROPERTY_DEFINITIONS
@see unpinAllInBackground:withName:block:
*/
-+ (void)pinAllInBackground:(NSArray *)objects
++ (void)pinAllInBackground:(PF_NULLABLE NSArray *)objects
withName:(NSString *)name
- block:(PFBooleanResultBlock)block;
+ block:(PF_NULLABLE PFBooleanResultBlock)block;
///--------------------------------------
/// @name Unpinning
@@ -1119,7 +1148,7 @@ NS_REQUIRES_PROPERTY_DEFINITIONS
@see pin:
@see PFObjectDefaultPin
*/
-- (BOOL)unpin;
+- (BOOL)unpin PF_SWIFT_UNAVAILABLE;
/*!
@abstract *Synchronously* removes the object and every object it points to in the local datastore, recursively,
@@ -1143,7 +1172,7 @@ NS_REQUIRES_PROPERTY_DEFINITIONS
@see pinWithName:
*/
-- (BOOL)unpinWithName:(NSString *)name;
+- (BOOL)unpinWithName:(NSString *)name PF_SWIFT_UNAVAILABLE;
/*!
@abstract *Synchronously* removes the object and every object it points to in the local datastore, recursively.
@@ -1179,7 +1208,7 @@ NS_REQUIRES_PROPERTY_DEFINITIONS
@see pinInBackgroundWithBlock:
@see PFObjectDefaultPin
*/
-- (void)unpinInBackgroundWithBlock:(PFBooleanResultBlock)block;
+- (void)unpinInBackgroundWithBlock:(PF_NULLABLE PFBooleanResultBlock)block;
/*!
@abstract *Asynchronously* removes the object and every object it points to in the local datastore, recursively.
@@ -1201,8 +1230,7 @@ NS_REQUIRES_PROPERTY_DEFINITIONS
@see pinInBackgroundWithName:block:
*/
-- (void)unpinInBackgroundWithName:(NSString *)name
- block:(PFBooleanResultBlock)block;
+- (void)unpinInBackgroundWithName:(NSString *)name block:(PF_NULLABLE PFBooleanResultBlock)block;
///--------------------------------------
/// @name Unpinning Many Objects
@@ -1216,7 +1244,7 @@ NS_REQUIRES_PROPERTY_DEFINITIONS
@see PFObjectDefaultPin
*/
-+ (BOOL)unpinAllObjects;
++ (BOOL)unpinAllObjects PF_SWIFT_UNAVAILABLE;
/*!
@abstract *Synchronously* removes all objects in the local datastore
@@ -1237,7 +1265,7 @@ NS_REQUIRES_PROPERTY_DEFINITIONS
@returns Returns whether the unpin succeeded.
*/
-+ (BOOL)unpinAllObjectsWithName:(NSString *)name;
++ (BOOL)unpinAllObjectsWithName:(NSString *)name PF_SWIFT_UNAVAILABLE;
/*!
@abstract *Synchronously* removes all objects with the specified pin name.
@@ -1269,7 +1297,7 @@ NS_REQUIRES_PROPERTY_DEFINITIONS
@see PFObjectDefaultPin
*/
-+ (void)unpinAllObjectsInBackgroundWithBlock:(PFBooleanResultBlock)block;
++ (void)unpinAllObjectsInBackgroundWithBlock:(PF_NULLABLE PFBooleanResultBlock)block;
/*!
@abstract *Asynchronously* removes all objects with the specified pin name.
@@ -1287,8 +1315,7 @@ NS_REQUIRES_PROPERTY_DEFINITIONS
@param block The block to execute.
It should have the following argument signature: `^(BOOL succeeded, NSError *error)`.
*/
-+ (void)unpinAllObjectsInBackgroundWithName:(NSString *)name
- block:(PFBooleanResultBlock)block;
++ (void)unpinAllObjectsInBackgroundWithName:(NSString *)name block:(PF_NULLABLE PFBooleanResultBlock)block;
/*!
@abstract *Synchronously* removes the objects and every object they point to in the local datastore, recursively,
@@ -1301,7 +1328,7 @@ NS_REQUIRES_PROPERTY_DEFINITIONS
@see pinAll:
@see PFObjectDefaultPin
*/
-+ (BOOL)unpinAll:(NSArray *)objects;
++ (BOOL)unpinAll:(PF_NULLABLE NSArray *)objects PF_SWIFT_UNAVAILABLE;
/*!
@abstract *Synchronously* removes the objects and every object they point to in the local datastore, recursively,
@@ -1315,7 +1342,7 @@ NS_REQUIRES_PROPERTY_DEFINITIONS
@see pinAll:error:
@see PFObjectDefaultPin
*/
-+ (BOOL)unpinAll:(NSArray *)objects error:(NSError **)error;
++ (BOOL)unpinAll:(PF_NULLABLE NSArray *)objects error:(NSError **)error;
/*!
@abstract *Synchronously* removes the objects and every object they point to in the local datastore, recursively.
@@ -1327,7 +1354,7 @@ NS_REQUIRES_PROPERTY_DEFINITIONS
@see pinAll:withName:
*/
-+ (BOOL)unpinAll:(NSArray *)objects withName:(NSString *)name;
++ (BOOL)unpinAll:(PF_NULLABLE NSArray *)objects withName:(NSString *)name PF_SWIFT_UNAVAILABLE;
/*!
@abstract *Synchronously* removes the objects and every object they point to in the local datastore, recursively.
@@ -1340,7 +1367,7 @@ NS_REQUIRES_PROPERTY_DEFINITIONS
@see pinAll:withName:error:
*/
-+ (BOOL)unpinAll:(NSArray *)objects
++ (BOOL)unpinAll:(PF_NULLABLE NSArray *)objects
withName:(NSString *)name
error:(NSError **)error;
@@ -1355,7 +1382,7 @@ NS_REQUIRES_PROPERTY_DEFINITIONS
@see pinAllInBackground:
@see PFObjectDefaultPin
*/
-+ (BFTask *)unpinAllInBackground:(NSArray *)objects;
++ (BFTask *)unpinAllInBackground:(PF_NULLABLE NSArray *)objects;
/*!
@abstract *Asynchronously* removes the objects and every object they point to in the local datastore, recursively,
@@ -1368,8 +1395,7 @@ NS_REQUIRES_PROPERTY_DEFINITIONS
@see pinAllInBackground:block:
@see PFObjectDefaultPin
*/
-+ (void)unpinAllInBackground:(NSArray *)objects
- block:(PFBooleanResultBlock)block;
++ (void)unpinAllInBackground:(PF_NULLABLE NSArray *)objects block:(PF_NULLABLE PFBooleanResultBlock)block;
/*!
@abstract *Asynchronously* removes the objects and every object they point to in the local datastore, recursively.
@@ -1381,8 +1407,7 @@ NS_REQUIRES_PROPERTY_DEFINITIONS
@see pinAllInBackground:withName:
*/
-+ (BFTask *)unpinAllInBackground:(NSArray *)objects
- withName:(NSString *)name;
++ (BFTask *)unpinAllInBackground:(PF_NULLABLE NSArray *)objects withName:(NSString *)name;
/*!
@abstract *Asynchronously* removes the objects and every object they point to in the local datastore, recursively.
@@ -1394,8 +1419,10 @@ NS_REQUIRES_PROPERTY_DEFINITIONS
@see pinAllInBackground:withName:block:
*/
-+ (void)unpinAllInBackground:(NSArray *)objects
++ (void)unpinAllInBackground:(PF_NULLABLE NSArray *)objects
withName:(NSString *)name
- block:(PFBooleanResultBlock)block;
+ block:(PF_NULLABLE PFBooleanResultBlock)block;
@end
+
+PF_ASSUME_NONNULL_END
diff --git a/src/ios/Frameworks/Parse.framework/Headers/PFProduct.h b/src/ios/Frameworks/Parse.framework/Headers/PFProduct.h
index cd57a25e..8bdf1ae6 100644
--- a/src/ios/Frameworks/Parse.framework/Headers/PFProduct.h
+++ b/src/ios/Frameworks/Parse.framework/Headers/PFProduct.h
@@ -1,13 +1,21 @@
-//
-// PFProduct.h
-//
-// Copyright 2011-present Parse Inc. All rights reserved.
-//
+/**
+ * Copyright (c) 2015-present, Parse, LLC.
+ * All rights reserved.
+ *
+ * This source code is licensed under the BSD-style license found in the
+ * LICENSE file in the root directory of this source tree. An additional grant
+ * of patent rights can be found in the PATENTS file in the same directory.
+ */
+
+#import
#import
+#import
#import
#import
+PF_ASSUME_NONNULL_BEGIN
+
/*!
The `PFProduct` class represents an in-app purchase product on the Parse server.
By default, products can only be created via the Data Browser. Saving a `PFProduct` will result in error.
@@ -17,22 +25,6 @@
*/
@interface PFProduct : PFObject
-/*!
- @abstract The name of the Installation class in the REST API.
-
- @discussion This is a required PFSubclassing method.
- */
-+ (NSString *)parseClassName;
-
-///--------------------------------------
-/// @name Querying for Products
-///--------------------------------------
-
-/*!
- @abstract A that could be used to fetch all product instances from Parse.
- */
-+ (PFQuery *)query;
-
///--------------------------------------
/// @name Product-specific Properties
///--------------------------------------
@@ -42,35 +34,37 @@
@discussion This should match the product identifier in iTunes Connect exactly.
*/
-@property (nonatomic, strong) NSString *productIdentifier;
+@property (PF_NULLABLE_PROPERTY nonatomic, strong) NSString *productIdentifier;
/*!
@abstract The icon of the product.
*/
-@property (nonatomic, strong) PFFile *icon;
+@property (PF_NULLABLE_PROPERTY nonatomic, strong) PFFile *icon;
/*!
@abstract The title of the product.
- */
-@property (nonatomic, strong) NSString *title;
+ */
+@property (PF_NULLABLE_PROPERTY nonatomic, strong) NSString *title;
/*!
@abstract The subtitle of the product.
*/
-@property (nonatomic, strong) NSString *subtitle;
+@property (PF_NULLABLE_PROPERTY nonatomic, strong) NSString *subtitle;
/*!
@abstract The order in which the product information is displayed in .
@discussion The product with a smaller order is displayed earlier in the .
*/
-@property (nonatomic, strong) NSNumber *order;
+@property (PF_NULLABLE_PROPERTY nonatomic, strong) NSNumber *order;
/*!
@abstract The name of the associated download.
@discussion If there is no downloadable asset, it should be `nil`.
*/
-@property (nonatomic, strong, readonly) NSString *downloadName;
+@property (PF_NULLABLE_PROPERTY nonatomic, strong, readonly) NSString *downloadName;
@end
+
+PF_ASSUME_NONNULL_END
diff --git a/src/ios/Frameworks/Parse.framework/Headers/PFPurchase.h b/src/ios/Frameworks/Parse.framework/Headers/PFPurchase.h
index 3a8e6618..ee818741 100644
--- a/src/ios/Frameworks/Parse.framework/Headers/PFPurchase.h
+++ b/src/ios/Frameworks/Parse.framework/Headers/PFPurchase.h
@@ -1,16 +1,22 @@
-//
-// PFPurchase.h
-//
-// Copyright 2011-present Parse Inc. All rights reserved.
-//
+/**
+ * Copyright (c) 2015-present, Parse, LLC.
+ * All rights reserved.
+ *
+ * This source code is licensed under the BSD-style license found in the
+ * LICENSE file in the root directory of this source tree. An additional grant
+ * of patent rights can be found in the PATENTS file in the same directory.
+ */
#import
#import
#import
+#import
@class PFProduct;
+PF_ASSUME_NONNULL_BEGIN
+
/*!
`PFPurchase` provides a set of APIs for working with in-app purchases.
@@ -62,7 +68,7 @@
*/
+ (void)downloadAssetForTransaction:(SKPaymentTransaction *)transaction
completion:(void(^)(NSString *filePath, NSError *error))completion
- progress:(PFProgressBlock)progress;
+ progress:(PF_NULLABLE PFProgressBlock)progress;
/*!
@abstract *Asynchronously* restore completed transactions for the current user.
@@ -75,13 +81,15 @@
*/
+ (void)restore;
-/*
+/*!
@abstract Returns a content path of the asset of a product, if it was purchased and downloaded.
@discussion To download and verify purchases use .
@warning This method will return `nil`, if the purchase wasn't verified or if the asset was not downloaded.
*/
-+ (NSString *)assetContentPathForProduct:(PFProduct *)product;
++ (PF_NULLABLE NSString *)assetContentPathForProduct:(PFProduct *)product;
@end
+
+PF_ASSUME_NONNULL_END
diff --git a/src/ios/Frameworks/Parse.framework/Headers/PFPush.h b/src/ios/Frameworks/Parse.framework/Headers/PFPush.h
index 961a8065..afdca65f 100644
--- a/src/ios/Frameworks/Parse.framework/Headers/PFPush.h
+++ b/src/ios/Frameworks/Parse.framework/Headers/PFPush.h
@@ -1,25 +1,27 @@
-//
-// PFPush.h
-//
-// Copyright 2011-present Parse Inc. All rights reserved.
-//
+/**
+ * Copyright (c) 2015-present, Parse, LLC.
+ * All rights reserved.
+ *
+ * This source code is licensed under the BSD-style license found in the
+ * LICENSE file in the root directory of this source tree. An additional grant
+ * of patent rights can be found in the PATENTS file in the same directory.
+ */
#import
+#import
+
#import
-@class BFTask;
@class PFQuery;
+PF_ASSUME_NONNULL_BEGIN
+
/*!
The `PFPush` class defines a push notification that can be sent from a client device.
The preferred way of modifying or retrieving channel subscriptions is to use
the class, instead of the class methods in `PFPush`.
-
- This class is currently for iOS only. Parse does not handle Push Notifications
- to Parse applications running on OS X. Push Notifications can be sent from OS X
- applications via Cloud Code or the REST API to push-enabled devices (e.g. iOS or Android).
*/
@interface PFPush : NSObject
@@ -27,7 +29,7 @@
/// @name Creating a Push Notification
///--------------------------------------
-+ (PFPush *)push;
++ (instancetype)push;
///--------------------------------------
/// @name Configuring a Push Notification
@@ -39,7 +41,7 @@
@param channel The channel to set for this push.
The channel name must start with a letter and contain only letters, numbers, dashes, and underscores.
*/
-- (void)setChannel:(NSString *)channel;
+- (void)setChannel:(PF_NULLABLE NSString *)channel;
/*!
@abstract Sets the array of channels on which this push notification will be sent.
@@ -47,7 +49,7 @@
@param channels The array of channels to set for this push.
Each channel name must start with a letter and contain only letters, numbers, dashes, and underscores.
*/
-- (void)setChannels:(NSArray *)channels;
+- (void)setChannels:(PF_NULLABLE NSArray *)channels;
/*!
@abstract Sets an installation query to which this push notification will be sent.
@@ -56,7 +58,7 @@
@param query The installation query to set for this push.
*/
-- (void)setQuery:(PFQuery *)query;
+- (void)setQuery:(PF_NULLABLE PFQuery *)query;
/*!
@abstract Sets an alert message for this push notification.
@@ -65,7 +67,7 @@
@param message The message to send in this push.
*/
-- (void)setMessage:(NSString *)message;
+- (void)setMessage:(PF_NULLABLE NSString *)message;
/*!
@abstract Sets an arbitrary data payload for this push notification.
@@ -76,7 +78,7 @@
@param data The data to send in this push.
*/
-- (void)setData:(NSDictionary *)data;
+- (void)setData:(PF_NULLABLE NSDictionary *)data;
/*!
@abstract Sets whether this push will go to Android devices.
@@ -85,7 +87,7 @@
@deprecated Please use a `[PFInstallation query]` with a constraint on deviceType instead.
*/
-- (void)setPushToAndroid:(BOOL)pushToAndroid PARSE_DEPRECATED("Please use a [PFInstallation query] with a constraint on deviceType.");
+- (void)setPushToAndroid:(BOOL)pushToAndroid PARSE_DEPRECATED("Please use a [PFInstallation query] with a constraint on deviceType. This method is deprecated and won't do anything.");
/*!
@abstract Sets whether this push will go to iOS devices.
@@ -94,7 +96,7 @@
@deprecated Please use a `[PFInstallation query]` with a constraint on deviceType instead.
*/
-- (void)setPushToIOS:(BOOL)pushToIOS PARSE_DEPRECATED("Please use a [PFInstallation query] with a constraint on deviceType.");
+- (void)setPushToIOS:(BOOL)pushToIOS PARSE_DEPRECATED("Please use a [PFInstallation query] with a constraint on deviceType. This method is deprecated and won't do anything.");
/*!
@abstract Sets the expiration time for this notification.
@@ -108,7 +110,7 @@
@param date The time at which the notification should expire.
*/
-- (void)expireAtDate:(NSDate *)date;
+- (void)expireAtDate:(PF_NULLABLE NSDate *)date;
/*!
@abstract Sets the time interval after which this notification should expire.
@@ -169,7 +171,7 @@
*/
+ (void)sendPushMessageToChannelInBackground:(NSString *)channel
withMessage:(NSString *)message
- block:(PFBooleanResultBlock)block;
+ block:(PF_NULLABLE PFBooleanResultBlock)block;
/*
@abstract *Asynchronously* send a push message to a channel.
@@ -185,8 +187,8 @@
*/
+ (void)sendPushMessageToChannelInBackground:(NSString *)channel
withMessage:(NSString *)message
- target:(id)target
- selector:(SEL)selector;
+ target:(PF_NULLABLE_S id)target
+ selector:(PF_NULLABLE_S SEL)selector;
/*!
@abstract Send a push message to a query.
@@ -223,7 +225,7 @@
*/
+ (void)sendPushMessageToQueryInBackground:(PFQuery *)query
withMessage:(NSString *)message
- block:(PFBooleanResultBlock)block;
+ block:(PF_NULLABLE PFBooleanResultBlock)block;
/*!
@abstract *Synchronously* send this push message.
@@ -246,7 +248,7 @@
@param block The block to execute.
It should have the following argument signature: `^(BOOL succeeded, NSError *error)`.
*/
-- (void)sendPushInBackgroundWithBlock:(PFBooleanResultBlock)block;
+- (void)sendPushInBackgroundWithBlock:(PF_NULLABLE PFBooleanResultBlock)block;
/*
@abstract *Asynchronously* send this push message and calls the given callback.
@@ -257,7 +259,7 @@
`error` will be `nil` on success and set if there was an error.
`[result boolValue]` will tell you whether the call succeeded or not.
*/
-- (void)sendPushInBackgroundWithTarget:(id)target selector:(SEL)selector;
+- (void)sendPushInBackgroundWithTarget:(PF_NULLABLE_S id)target selector:(PF_NULLABLE_S SEL)selector;
/*!
@abstract *Synchronously* send a push message with arbitrary data to a channel.
@@ -302,7 +304,7 @@
*/
+ (void)sendPushDataToChannelInBackground:(NSString *)channel
withData:(NSDictionary *)data
- block:(PFBooleanResultBlock)block;
+ block:(PF_NULLABLE PFBooleanResultBlock)block;
/*
@abstract *Asynchronously* send a push message with arbitrary data to a channel.
@@ -320,8 +322,8 @@
*/
+ (void)sendPushDataToChannelInBackground:(NSString *)channel
withData:(NSDictionary *)data
- target:(id)target
- selector:(SEL)selector;
+ target:(PF_NULLABLE_S id)target
+ selector:(PF_NULLABLE_S SEL)selector;
/*!
@abstract *Synchronously* send a push message with arbitrary data to a query.
@@ -366,7 +368,7 @@
*/
+ (void)sendPushDataToQueryInBackground:(PFQuery *)query
withData:(NSDictionary *)data
- block:(PFBooleanResultBlock)block;
+ block:(PF_NULLABLE PFBooleanResultBlock)block;
///--------------------------------------
/// @name Handling Notifications
@@ -377,10 +379,14 @@
could be used to mimic the behavior of iOS push notifications while the app is backgrounded or not running.
@discussion Call this from `application:didReceiveRemoteNotification:`.
+ If push has a dictionary containing loc-key and loc-args in the alert,
+ we support up to 10 items in loc-args (`NSRangeException` if limit exceeded).
+
+ @warning This method is available only on iOS.
@param userInfo The userInfo dictionary you get in `appplication:didReceiveRemoteNotification:`.
*/
-+ (void)handlePush:(NSDictionary *)userInfo;
++ (void)handlePush:(PF_NULLABLE NSDictionary *)userInfo NS_AVAILABLE_IOS(3_0) PF_EXTENSION_UNAVAILABLE("");
///--------------------------------------
/// @name Managing Channel Subscriptions
@@ -403,7 +409,7 @@
@returns Returns an `NSSet` containing all the channel names this device is subscribed to.
*/
-+ (NSSet *)getSubscribedChannels:(NSError **)error;
++ (PF_NULLABLE NSSet *)getSubscribedChannels:(NSError **)error;
/*!
@abstract *Asynchronously* get all the channels that this device is subscribed to.
@@ -460,7 +466,7 @@
It should have the following argument signature: `^(BOOL succeeded, NSError *error)`
*/
+ (void)subscribeToChannelInBackground:(NSString *)channel
- block:(PFBooleanResultBlock)block;
+ block:(PF_NULLABLE PFBooleanResultBlock)block;
/*
@abstract *Asynchronously* subscribes the device to a channel of push notifications and calls the given callback.
@@ -474,8 +480,8 @@
`[result boolValue]` will tell you whether the call succeeded or not.
*/
+ (void)subscribeToChannelInBackground:(NSString *)channel
- target:(id)target
- selector:(SEL)selector;
+ target:(PF_NULLABLE_S id)target
+ selector:(PF_NULLABLE_S SEL)selector;
/*!
@abstract *Synchronously* unsubscribes the device to a channel of push notifications.
@@ -504,7 +510,7 @@
It should have the following argument signature: `^(BOOL succeeded, NSError *error)`.
*/
+ (void)unsubscribeFromChannelInBackground:(NSString *)channel
- block:(PFBooleanResultBlock)block;
+ block:(PF_NULLABLE PFBooleanResultBlock)block;
/*
@abstract *Asynchronously* unsubscribes the device from a channel of push notifications and calls the given callback.
@@ -517,7 +523,9 @@
`[result boolValue]` will tell you whether the call succeeded or not.
*/
+ (void)unsubscribeFromChannelInBackground:(NSString *)channel
- target:(id)target
- selector:(SEL)selector;
+ target:(PF_NULLABLE_S id)target
+ selector:(PF_NULLABLE_S SEL)selector;
@end
+
+PF_ASSUME_NONNULL_END
diff --git a/src/ios/Frameworks/Parse.framework/Headers/PFQuery.h b/src/ios/Frameworks/Parse.framework/Headers/PFQuery.h
index e78f98a3..43c8f04c 100644
--- a/src/ios/Frameworks/Parse.framework/Headers/PFQuery.h
+++ b/src/ios/Frameworks/Parse.framework/Headers/PFQuery.h
@@ -1,34 +1,45 @@
-//
-// PFQuery.h
-//
-// Copyright 2011-present Parse Inc. All rights reserved.
-//
+/**
+ * Copyright (c) 2015-present, Parse, LLC.
+ * All rights reserved.
+ *
+ * This source code is licensed under the BSD-style license found in the
+ * LICENSE file in the root directory of this source tree. An additional grant
+ * of patent rights can be found in the PATENTS file in the same directory.
+ */
#import
-#if TARGET_OS_IPHONE
+#import
+
#import
#import
#import
#import
-#else
-#import
-#import
-#import
-#import
-#endif
-@class BFTask;
+PF_ASSUME_NONNULL_BEGIN
/*!
The `PFQuery` class defines a query that is used to query for s.
*/
-@interface PFQuery : NSObject
+@interface PFQuery PF_GENERIC(PFGenericObject : PFObject *) : NSObject
+
+///--------------------------------------
+/// @name Blocks
+///--------------------------------------
+
+typedef void (^PFQueryArrayResultBlock)(NSArray PF_GENERIC(PFGenericObject) * PF_NULLABLE_S objects, NSError * PF_NULLABLE_S error);
///--------------------------------------
/// @name Creating a Query for a Class
///--------------------------------------
+/*!
+ @abstract Initializes the query with a class name.
+
+ @param className The class name.
+ */
+- (instancetype)initWithClassName:(NSString *)className;
+
/*!
@abstract Returns a `PFQuery` for a given class.
@@ -36,7 +47,7 @@
@returns A `PFQuery` object.
*/
-+ (PFQuery *)queryWithClassName:(NSString *)className;
++ (instancetype)queryWithClassName:(NSString *)className;
/*!
@abstract Creates a PFQuery with the constraints given by predicate.
@@ -60,16 +71,10 @@
@param className The class to query on.
@param predicate The predicate to create conditions from.
*/
-+ (PFQuery *)queryWithClassName:(NSString *)className predicate:(NSPredicate *)predicate;
++ (instancetype)queryWithClassName:(NSString *)className predicate:(PF_NULLABLE NSPredicate *)predicate;
/*!
- Initializes the query with a class name.
- @param newClassName The class name.
- */
-- (instancetype)initWithClassName:(NSString *)newClassName;
-
-/*!
- The class name to query for
+ The class name to query for.
*/
@property (nonatomic, strong) NSString *parseClassName;
@@ -84,8 +89,10 @@
the included object are also fetch.
@param key The key to load child s for.
+
+ @returns The same instance of `PFQuery` as the receiver. This allows method chaining.
*/
-- (void)includeKey:(NSString *)key;
+- (instancetype)includeKey:(NSString *)key;
/*!
@abstract Make the query restrict the fields of the returned s to include only the provided keys.
@@ -93,38 +100,48 @@
@discussion If this is called multiple times, then all of the keys specified in each of the calls will be included.
@param keys The keys to include in the result.
+
+ @returns The same instance of `PFQuery` as the receiver. This allows method chaining.
*/
-- (void)selectKeys:(NSArray *)keys;
+- (instancetype)selectKeys:(NSArray *)keys;
/*!
@abstract Add a constraint that requires a particular key exists.
@param key The key that should exist.
+
+ @returns The same instance of `PFQuery` as the receiver. This allows method chaining.
*/
-- (void)whereKeyExists:(NSString *)key;
+- (instancetype)whereKeyExists:(NSString *)key;
/*!
@abstract Add a constraint that requires a key not exist.
@param key The key that should not exist.
+
+ @returns The same instance of `PFQuery` as the receiver. This allows method chaining.
*/
-- (void)whereKeyDoesNotExist:(NSString *)key;
+- (instancetype)whereKeyDoesNotExist:(NSString *)key;
/*!
@abstract Add a constraint to the query that requires a particular key's object to be equal to the provided object.
@param key The key to be constrained.
@param object The object that must be equalled.
+
+ @returns The same instance of `PFQuery` as the receiver. This allows method chaining.
*/
-- (void)whereKey:(NSString *)key equalTo:(id)object;
+- (instancetype)whereKey:(NSString *)key equalTo:(id)object;
/*!
@abstract Add a constraint to the query that requires a particular key's object to be less than the provided object.
@param key The key to be constrained.
@param object The object that provides an upper bound.
+
+ @returns The same instance of `PFQuery` as the receiver. This allows method chaining.
*/
-- (void)whereKey:(NSString *)key lessThan:(id)object;
+- (instancetype)whereKey:(NSString *)key lessThan:(id)object;
/*!
@abstract Add a constraint to the query that requires a particular key's object
@@ -132,8 +149,10 @@
@param key The key to be constrained.
@param object The object that must be equalled.
+
+ @returns The same instance of `PFQuery` as the receiver. This allows method chaining.
*/
-- (void)whereKey:(NSString *)key lessThanOrEqualTo:(id)object;
+- (instancetype)whereKey:(NSString *)key lessThanOrEqualTo:(id)object;
/*!
@abstract Add a constraint to the query that requires a particular key's object
@@ -141,8 +160,10 @@
@param key The key to be constrained.
@param object The object that must be equalled.
+
+ @returns The same instance of `PFQuery` as the receiver. This allows method chaining.
*/
-- (void)whereKey:(NSString *)key greaterThan:(id)object;
+- (instancetype)whereKey:(NSString *)key greaterThan:(id)object;
/*!
@abstract Add a constraint to the query that requires a particular key's
@@ -150,8 +171,10 @@
@param key The key to be constrained.
@param object The object that must be equalled.
+
+ @returns The same instance of `PFQuery` as the receiver. This allows method chaining.
*/
-- (void)whereKey:(NSString *)key greaterThanOrEqualTo:(id)object;
+- (instancetype)whereKey:(NSString *)key greaterThanOrEqualTo:(id)object;
/*!
@abstract Add a constraint to the query that requires a particular key's object
@@ -159,8 +182,10 @@
@param key The key to be constrained.
@param object The object that must not be equalled.
+
+ @returns The same instance of `PFQuery` as the receiver. This allows method chaining.
*/
-- (void)whereKey:(NSString *)key notEqualTo:(id)object;
+- (instancetype)whereKey:(NSString *)key notEqualTo:(id)object;
/*!
@abstract Add a constraint to the query that requires a particular key's object
@@ -168,8 +193,10 @@
@param key The key to be constrained.
@param array The possible values for the key's object.
+
+ @returns The same instance of `PFQuery` as the receiver. This allows method chaining.
*/
-- (void)whereKey:(NSString *)key containedIn:(NSArray *)array;
+- (instancetype)whereKey:(NSString *)key containedIn:(NSArray *)array;
/*!
@abstract Add a constraint to the query that requires a particular key's object
@@ -177,8 +204,10 @@
@param key The key to be constrained.
@param array The list of values the key's object should not be.
+
+ @returns The same instance of `PFQuery` as the receiver. This allows method chaining.
*/
-- (void)whereKey:(NSString *)key notContainedIn:(NSArray *)array;
+- (instancetype)whereKey:(NSString *)key notContainedIn:(NSArray *)array;
/*!
@abstract Add a constraint to the query that requires a particular key's array
@@ -186,8 +215,10 @@
@param key The key to be constrained.
@param array The array of values to search for.
+
+ @returns The same instance of `PFQuery` as the receiver. This allows method chaining.
*/
-- (void)whereKey:(NSString *)key containsAllObjectsInArray:(NSArray *)array;
+- (instancetype)whereKey:(NSString *)key containsAllObjectsInArray:(NSArray *)array;
///--------------------------------------
/// @name Adding Location Constraints
@@ -202,8 +233,10 @@
@param key The key to be constrained.
@param geopoint The reference point represented as a .
+
+ @returns The same instance of `PFQuery` as the receiver. This allows method chaining.
*/
-- (void)whereKey:(NSString *)key nearGeoPoint:(PFGeoPoint *)geopoint;
+- (instancetype)whereKey:(NSString *)key nearGeoPoint:(PFGeoPoint *)geopoint;
/*!
@abstract Add a constraint to the query that requires a particular key's coordinates (specified via )
@@ -215,8 +248,12 @@
@param key The key to be constrained.
@param geopoint The reference point represented as a .
@param maxDistance Maximum distance in miles.
+
+ @returns The same instance of `PFQuery` as the receiver. This allows method chaining.
*/
-- (void)whereKey:(NSString *)key nearGeoPoint:(PFGeoPoint *)geopoint withinMiles:(double)maxDistance;
+- (instancetype)whereKey:(NSString *)key
+ nearGeoPoint:(PFGeoPoint *)geopoint
+ withinMiles:(double)maxDistance;
/*!
@abstract Add a constraint to the query that requires a particular key's coordinates (specified via )
@@ -228,8 +265,12 @@
@param key The key to be constrained.
@param geopoint The reference point represented as a .
@param maxDistance Maximum distance in kilometers.
+
+ @returns The same instance of `PFQuery` as the receiver. This allows method chaining.
*/
-- (void)whereKey:(NSString *)key nearGeoPoint:(PFGeoPoint *)geopoint withinKilometers:(double)maxDistance;
+- (instancetype)whereKey:(NSString *)key
+ nearGeoPoint:(PFGeoPoint *)geopoint
+ withinKilometers:(double)maxDistance;
/*!
Add a constraint to the query that requires a particular key's coordinates (specified via ) be near
@@ -239,8 +280,12 @@
@param key The key to be constrained.
@param geopoint The reference point as a .
@param maxDistance Maximum distance in radians.
+
+ @returns The same instance of `PFQuery` as the receiver. This allows method chaining.
*/
-- (void)whereKey:(NSString *)key nearGeoPoint:(PFGeoPoint *)geopoint withinRadians:(double)maxDistance;
+- (instancetype)whereKey:(NSString *)key
+ nearGeoPoint:(PFGeoPoint *)geopoint
+ withinRadians:(double)maxDistance;
/*!
@abstract Add a constraint to the query that requires a particular key's coordinates (specified via ) be
@@ -249,8 +294,10 @@
@param key The key to be constrained.
@param southwest The lower-left inclusive corner of the box.
@param northeast The upper-right inclusive corner of the box.
+
+ @returns The same instance of `PFQuery` as the receiver. This allows method chaining.
*/
-- (void)whereKey:(NSString *)key withinGeoBoxFromSouthwest:(PFGeoPoint *)southwest toNortheast:(PFGeoPoint *)northeast;
+- (instancetype)whereKey:(NSString *)key withinGeoBoxFromSouthwest:(PFGeoPoint *)southwest toNortheast:(PFGeoPoint *)northeast;
///--------------------------------------
/// @name Adding String Constraints
@@ -263,8 +310,10 @@
@param key The key that the string to match is stored in.
@param regex The regular expression pattern to match.
+
+ @returns The same instance of `PFQuery` as the receiver. This allows method chaining.
*/
-- (void)whereKey:(NSString *)key matchesRegex:(NSString *)regex;
+- (instancetype)whereKey:(NSString *)key matchesRegex:(NSString *)regex;
/*!
@abstract Add a regular expression constraint for finding string values that match the provided regular expression.
@@ -276,8 +325,12 @@
@param modifiers Any of the following supported PCRE modifiers:
- `i` - Case insensitive search
- `m` - Search across multiple lines of input
+
+ @returns The same instance of `PFQuery` as the receiver. This allows method chaining.
*/
-- (void)whereKey:(NSString *)key matchesRegex:(NSString *)regex modifiers:(NSString *)modifiers;
+- (instancetype)whereKey:(NSString *)key
+ matchesRegex:(NSString *)regex
+ modifiers:(PF_NULLABLE NSString *)modifiers;
/*!
@abstract Add a constraint for finding string values that contain a provided substring.
@@ -286,8 +339,10 @@
@param key The key that the string to match is stored in.
@param substring The substring that the value must contain.
+
+ @returns The same instance of `PFQuery` as the receiver. This allows method chaining.
*/
-- (void)whereKey:(NSString *)key containsString:(NSString *)substring;
+- (instancetype)whereKey:(NSString *)key containsString:(PF_NULLABLE NSString *)substring;
/*!
@abstract Add a constraint for finding string values that start with a provided prefix.
@@ -296,8 +351,10 @@
@param key The key that the string to match is stored in.
@param prefix The substring that the value must start with.
+
+ @returns The same instance of `PFQuery` as the receiver. This allows method chaining.
*/
-- (void)whereKey:(NSString *)key hasPrefix:(NSString *)prefix;
+- (instancetype)whereKey:(NSString *)key hasPrefix:(PF_NULLABLE NSString *)prefix;
/*!
@abstract Add a constraint for finding string values that end with a provided suffix.
@@ -306,8 +363,10 @@
@param key The key that the string to match is stored in.
@param suffix The substring that the value must end with.
+
+ @returns The same instance of `PFQuery` as the receiver. This allows method chaining.
*/
-- (void)whereKey:(NSString *)key hasSuffix:(NSString *)suffix;
+- (instancetype)whereKey:(NSString *)key hasSuffix:(PF_NULLABLE NSString *)suffix;
///--------------------------------------
/// @name Adding Subqueries
@@ -320,7 +379,7 @@
@returns An instance of `PFQuery` that is the `or` of the passed in queries.
*/
-+ (PFQuery *)orQueryWithSubqueries:(NSArray *)queries;
++ (instancetype)orQueryWithSubqueries:(NSArray *)queries;
/*!
@abstract Adds a constraint that requires that a key's value matches a value in another key
@@ -329,8 +388,12 @@
@param key The key that the value is stored.
@param otherKey The key in objects in the returned by the sub query whose value should match.
@param query The query to run.
+
+ @returns The same instance of `PFQuery` as the receiver. This allows method chaining.
*/
-- (void)whereKey:(NSString *)key matchesKey:(NSString *)otherKey inQuery:(PFQuery *)query;
+- (instancetype)whereKey:(NSString *)key
+ matchesKey:(NSString *)otherKey
+ inQuery:(PFQuery *)query;
/*!
@abstract Adds a constraint that requires that a key's value `NOT` match a value in another key
@@ -339,8 +402,12 @@
@param key The key that the value is stored.
@param otherKey The key in objects in the returned by the sub query whose value should match.
@param query The query to run.
+
+ @returns The same instance of `PFQuery` as the receiver. This allows method chaining.
*/
-- (void)whereKey:(NSString *)key doesNotMatchKey:(NSString *)otherKey inQuery:(PFQuery *)query;
+- (instancetype)whereKey:(NSString *)key
+ doesNotMatchKey:(NSString *)otherKey
+ inQuery:(PFQuery *)query;
/*!
@abstract Add a constraint that requires that a key's value matches a `PFQuery` constraint.
@@ -349,8 +416,10 @@
@param key The key that the value is stored in
@param query The query the value should match
+
+ @returns The same instance of `PFQuery` as the receiver. This allows method chaining.
*/
-- (void)whereKey:(NSString *)key matchesQuery:(PFQuery *)query;
+- (instancetype)whereKey:(NSString *)key matchesQuery:(PFQuery *)query;
/*!
@abstract Add a constraint that requires that a key's value to not match a `PFQuery` constraint.
@@ -359,8 +428,10 @@
@param key The key that the value is stored in
@param query The query the value should not match
+
+ @returns The same instance of `PFQuery` as the receiver. This allows method chaining.
*/
-- (void)whereKey:(NSString *)key doesNotMatchQuery:(PFQuery *)query;
+- (instancetype)whereKey:(NSString *)key doesNotMatchQuery:(PFQuery *)query;
///--------------------------------------
/// @name Sorting
@@ -370,47 +441,59 @@
@abstract Sort the results in *ascending* order with the given key.
@param key The key to order by.
+
+ @returns The same instance of `PFQuery` as the receiver. This allows method chaining.
*/
-- (void)orderByAscending:(NSString *)key;
+- (instancetype)orderByAscending:(NSString *)key;
/*!
@abstract Additionally sort in *ascending* order by the given key.
@discussion The previous keys provided will precedence over this key.
- @param key The key to order bye
+ @param key The key to order by.
*/
-- (void)addAscendingOrder:(NSString *)key;
+- (instancetype)addAscendingOrder:(NSString *)key;
/*!
@abstract Sort the results in *descending* order with the given key.
@param key The key to order by.
+
+ @returns The same instance of `PFQuery` as the receiver. This allows method chaining.
*/
-- (void)orderByDescending:(NSString *)key;
+- (instancetype)orderByDescending:(NSString *)key;
/*!
@abstract Additionally sort in *descending* order by the given key.
@discussion The previous keys provided will precedence over this key.
- @param key The key to order bye
+ @param key The key to order by.
*/
-- (void)addDescendingOrder:(NSString *)key;
+- (instancetype)addDescendingOrder:(NSString *)key;
/*!
@abstract Sort the results using a given sort descriptor.
+ @warning If a `sortDescriptor` has custom `selector` or `comparator` - they aren't going to be used.
+
@param sortDescriptor The `NSSortDescriptor` to use to sort the results of the query.
+
+ @returns The same instance of `PFQuery` as the receiver. This allows method chaining.
*/
-- (void)orderBySortDescriptor:(NSSortDescriptor *)sortDescriptor;
+- (instancetype)orderBySortDescriptor:(NSSortDescriptor *)sortDescriptor;
/*!
@abstract Sort the results using a given array of sort descriptors.
+ @warning If a `sortDescriptor` has custom `selector` or `comparator` - they aren't going to be used.
+
@param sortDescriptors An array of `NSSortDescriptor` objects to use to sort the results of the query.
+
+ @returns The same instance of `PFQuery` as the receiver. This allows method chaining.
*/
-- (void)orderBySortDescriptors:(NSArray *)sortDescriptors;
+- (instancetype)orderBySortDescriptors:(PF_NULLABLE NSArray *)sortDescriptors;
///--------------------------------------
/// @name Getting Objects by ID
@@ -424,8 +507,8 @@
@returns The if found. Returns `nil` if the object isn't found, or if there was an error.
*/
-+ (PFObject *)getObjectOfClass:(NSString *)objectClass
- objectId:(NSString *)objectId;
++ (PF_NULLABLE PFGenericObject)getObjectOfClass:(NSString *)objectClass
+ objectId:(NSString *)objectId PF_SWIFT_UNAVAILABLE;
/*!
@abstract Returns a with a given class and id and sets an error if necessary.
@@ -436,9 +519,9 @@
@returns The if found. Returns `nil` if the object isn't found, or if there was an `error`.
*/
-+ (PFObject *)getObjectOfClass:(NSString *)objectClass
- objectId:(NSString *)objectId
- error:(NSError **)error;
++ (PF_NULLABLE PFGenericObject)getObjectOfClass:(NSString *)objectClass
+ objectId:(NSString *)objectId
+ error:(NSError **)error;
/*!
@abstract Returns a with the given id.
@@ -450,7 +533,7 @@
@returns The if found. Returns nil if the object isn't found, or if there was an error.
*/
-- (PFObject *)getObjectWithId:(NSString *)objectId;
+- (PF_NULLABLE PFGenericObject)getObjectWithId:(NSString *)objectId PF_SWIFT_UNAVAILABLE;
/*!
@abstract Returns a with the given id and sets an error if necessary.
@@ -463,7 +546,7 @@
@returns The if found. Returns nil if the object isn't found, or if there was an error.
*/
-- (PFObject *)getObjectWithId:(NSString *)objectId error:(NSError **)error;
+- (PF_NULLABLE PFGenericObject)getObjectWithId:(NSString *)objectId error:(NSError **)error;
/*!
@abstract Gets a asynchronously and calls the given block with the result.
@@ -478,7 +561,7 @@
- (BFTask *)getObjectInBackgroundWithId:(NSString *)objectId;
/*!
- @asbtract Gets a asynchronously and calls the given block with the result.
+ @abstract Gets a asynchronously and calls the given block with the result.
@warning This method mutates the query.
It will reset limit to `1`, skip to `0` and remove all conditions, leaving only `objectId`.
@@ -488,7 +571,7 @@
The block should have the following argument signature: `^(NSArray *object, NSError *error)`
*/
- (void)getObjectInBackgroundWithId:(NSString *)objectId
- block:(PFObjectResultBlock)block;
+ block:(PF_NULLABLE void(^)(PFGenericObject PF_NULLABLE_S object, NSError *PF_NULLABLE_S error))block;
/*
@abstract Gets a asynchronously.
@@ -502,21 +585,21 @@
Result will be `nil` if error is set and vice versa.
*/
- (void)getObjectInBackgroundWithId:(NSString *)objectId
- target:(id)target
- selector:(SEL)selector;
+ target:(PF_NULLABLE_S id)target
+ selector:(PF_NULLABLE_S SEL)selector;
///--------------------------------------
/// @name Getting User Objects
///--------------------------------------
/*!
- @asbtract Returns a with a given id.
+ @abstract Returns a with a given id.
@param objectId The id of the object that is being requested.
@returns The PFUser if found. Returns nil if the object isn't found, or if there was an error.
*/
-+ (PFUser *)getUserObjectWithId:(NSString *)objectId;
++ (PF_NULLABLE PFUser *)getUserObjectWithId:(NSString *)objectId PF_SWIFT_UNAVAILABLE;
/*!
Returns a PFUser with a given class and id and sets an error if necessary.
@@ -524,24 +607,24 @@
@param error Pointer to an NSError that will be set if necessary.
@result The PFUser if found. Returns nil if the object isn't found, or if there was an error.
*/
-+ (PFUser *)getUserObjectWithId:(NSString *)objectId
- error:(NSError **)error;
++ (PF_NULLABLE PFUser *)getUserObjectWithId:(NSString *)objectId
+ error:(NSError **)error;
/*!
@deprecated Please use [PFUser query] instead.
*/
-+ (PFQuery *)queryForUser PARSE_DEPRECATED("Use [PFUser query] instead.");
++ (instancetype)queryForUser PARSE_DEPRECATED("Use [PFUser query] instead.");
///--------------------------------------
/// @name Getting all Matches for a Query
///--------------------------------------
/*!
- @asbtract Finds objects *synchronously* based on the constructed query.
+ @abstract Finds objects *synchronously* based on the constructed query.
@returns Returns an array of objects that were found.
*/
-- (NSArray *)findObjects;
+- (PF_NULLABLE NSArray PF_GENERIC(PFGenericObject) *)findObjects PF_SWIFT_UNAVAILABLE;
/*!
@abstract Finds objects *synchronously* based on the constructed query and sets an error if there was one.
@@ -550,10 +633,10 @@
@returns Returns an array of objects that were found.
*/
-- (NSArray *)findObjects:(NSError **)error;
+- (PF_NULLABLE NSArray PF_GENERIC(PFGenericObject) *)findObjects:(NSError **)error;
/*!
- @asbtract Finds objects *asynchronously* and sets the `NSArray` of objects as a result of the task.
+ @abstract Finds objects *asynchronously* and sets the `NSArray` of objects as a result of the task.
@returns The task, that encapsulates the work being done.
*/
@@ -565,7 +648,7 @@
@param block The block to execute.
It should have the following argument signature: `^(NSArray *objects, NSError *error)`
*/
-- (void)findObjectsInBackgroundWithBlock:(PFArrayResultBlock)block;
+- (void)findObjectsInBackgroundWithBlock:(PF_NULLABLE PFQueryArrayResultBlock)block;
/*
@abstract Finds objects *asynchronously* and calls the given callback with the results.
@@ -575,7 +658,7 @@
It should have the following signature: `(void)callbackWithResult:(id)result error:(NSError *)error`.
Result will be `nil` if error is set and vice versa.
*/
-- (void)findObjectsInBackgroundWithTarget:(id)target selector:(SEL)selector;
+- (void)findObjectsInBackgroundWithTarget:(PF_NULLABLE_S id)target selector:(PF_NULLABLE_S SEL)selector;
///--------------------------------------
/// @name Getting the First Match in a Query
@@ -588,7 +671,7 @@
@returns Returns a , or `nil` if none was found.
*/
-- (PFObject *)getFirstObject;
+- (PF_NULLABLE PFGenericObject)getFirstObject PF_SWIFT_UNAVAILABLE;
/*!
@abstract Gets an object *synchronously* based on the constructed query and sets an error if any occurred.
@@ -599,7 +682,7 @@
@returns Returns a , or `nil` if none was found.
*/
-- (PFObject *)getFirstObject:(NSError **)error;
+- (PF_NULLABLE PFGenericObject)getFirstObject:(NSError **)error;
/*!
@abstract Gets an object *asynchronously* and sets it as a result of the task.
@@ -620,7 +703,7 @@
`result` will be `nil` if `error` is set OR no object was found matching the query.
`error` will be `nil` if `result` is set OR if the query succeeded, but found no results.
*/
-- (void)getFirstObjectInBackgroundWithBlock:(PFObjectResultBlock)block;
+- (void)getFirstObjectInBackgroundWithBlock:(PF_NULLABLE void(^)(PFGenericObject PF_NULLABLE_S object, NSError *PF_NULLABLE_S error))block;
/*
@abstract Gets an object *asynchronously* and calls the given callback with the results.
@@ -633,7 +716,7 @@
`result` will be `nil` if `error` is set OR no object was found matching the query.
`error` will be `nil` if `result` is set OR if the query succeeded, but found no results.
*/
-- (void)getFirstObjectInBackgroundWithTarget:(id)target selector:(SEL)selector;
+- (void)getFirstObjectInBackgroundWithTarget:(PF_NULLABLE_S id)target selector:(PF_NULLABLE_S SEL)selector;
///--------------------------------------
/// @name Counting the Matches in a Query
@@ -644,7 +727,7 @@
@returns Returns the number of objects that match the query, or `-1` if there is an error.
*/
-- (NSInteger)countObjects;
+- (NSInteger)countObjects PF_SWIFT_UNAVAILABLE;
/*!
@abstract Counts objects *synchronously* based on the constructed query and sets an error if there was one.
@@ -668,7 +751,7 @@
@param block The block to execute.
It should have the following argument signature: `^(int count, NSError *error)`
*/
-- (void)countObjectsInBackgroundWithBlock:(PFIntegerResultBlock)block;
+- (void)countObjectsInBackgroundWithBlock:(PF_NULLABLE PFIntegerResultBlock)block;
/*
@abstract Counts objects *asynchronously* and calls the given callback with the count.
@@ -677,14 +760,14 @@
@param selector The selector to call.
It should have the following signature: `(void)callbackWithResult:(NSNumber *)result error:(NSError *)error`.
*/
-- (void)countObjectsInBackgroundWithTarget:(id)target selector:(SEL)selector;
+- (void)countObjectsInBackgroundWithTarget:(PF_NULLABLE_S id)target selector:(PF_NULLABLE_S SEL)selector;
///--------------------------------------
/// @name Cancelling a Query
///--------------------------------------
/*!
- @asbtract Cancels the current network request (if any). Ensures that callbacks won't be called.
+ @abstract Cancels the current network request (if any). Ensures that callbacks won't be called.
*/
- (void)cancel;
@@ -720,8 +803,8 @@
*/
@property (assign, readwrite) PFCachePolicy cachePolicy;
-/* !
- @asbtract The age after which a cached value will be ignored
+/*!
+ @abstract The age after which a cached value will be ignored
*/
@property (assign, readwrite) NSTimeInterval maxCacheAge;
@@ -749,33 +832,50 @@
/*!
@abstract Change the source of this query to all pinned objects.
- Requires Pinning to be enabled.
+ @warning Requires Local Datastore to be enabled.
+
+ @returns The same instance of `PFQuery` as the receiver. This allows method chaining.
@see cachePolicy
*/
-- (PFQuery *)fromLocalDatastore;
+- (instancetype)fromLocalDatastore;
/*!
@abstract Change the source of this query to the default group of pinned objects.
- Requires Pinning to be enabled.
+ @warning Requires Local Datastore to be enabled.
+
+ @returns The same instance of `PFQuery` as the receiver. This allows method chaining.
@see PFObjectDefaultPin
@see cachePolicy
*/
-- (PFQuery *)fromPin;
+- (instancetype)fromPin;
/*!
@abstract Change the source of this query to a specific group of pinned objects.
- Requires Pinning to be enabled.
+ @warning Requires Local Datastore to be enabled.
@param name The pinned group.
+ @returns The same instance of `PFQuery` as the receiver. This allows method chaining.
+
@see PFObjectDefaultPin
@see cachePolicy
*/
-- (PFQuery *)fromPinWithName:(NSString *)name;
+- (instancetype)fromPinWithName:(PF_NULLABLE NSString *)name;
+
+/*!
+ @abstract Ignore ACLs when querying from the Local Datastore.
+
+ @discussion This is particularly useful when querying for objects with Role based ACLs set on them.
+
+ @warning Requires Local Datastore to be enabled.
+
+ @returns The same instance of `PFQuery` as the receiver. This allows method chaining.
+ */
+- (instancetype)ignoreACLs;
///--------------------------------------
/// @name Advanced Settings
@@ -789,3 +889,5 @@
@property (nonatomic, assign) BOOL trace;
@end
+
+PF_ASSUME_NONNULL_END
diff --git a/src/ios/Frameworks/Parse.framework/Headers/PFRelation.h b/src/ios/Frameworks/Parse.framework/Headers/PFRelation.h
index f4254a1a..af64ff90 100644
--- a/src/ios/Frameworks/Parse.framework/Headers/PFRelation.h
+++ b/src/ios/Frameworks/Parse.framework/Headers/PFRelation.h
@@ -1,18 +1,19 @@
-//
-// PFRelation.h
-//
-// Copyright 2011-present Parse Inc. All rights reserved.
-//
+/**
+ * Copyright (c) 2015-present, Parse, LLC.
+ * All rights reserved.
+ *
+ * This source code is licensed under the BSD-style license found in the
+ * LICENSE file in the root directory of this source tree. An additional grant
+ * of patent rights can be found in the PATENTS file in the same directory.
+ */
#import
-#if TARGET_OS_IPHONE
+#import
#import
#import
-#else
-#import
-#import
-#endif
+
+PF_ASSUME_NONNULL_BEGIN
/*!
The `PFRelation` class that is used to access all of the children of a many-to-many relationship.
@@ -23,7 +24,7 @@
/*!
@abstract The name of the class of the target child objects.
*/
-@property (nonatomic, strong) NSString *targetClass;
+@property (PF_NULLABLE_PROPERTY nonatomic, copy) NSString *targetClass;
///--------------------------------------
/// @name Accessing Objects
@@ -32,7 +33,7 @@
/*!
@abstract Returns a object that can be used to get objects in this relation.
*/
-- (PFQuery *)query;
+- (PF_NULLABLE PFQuery *)query;
///--------------------------------------
/// @name Modifying Relations
@@ -53,3 +54,5 @@
- (void)removeObject:(PFObject *)object;
@end
+
+PF_ASSUME_NONNULL_END
diff --git a/src/ios/Frameworks/Parse.framework/Headers/PFRole.h b/src/ios/Frameworks/Parse.framework/Headers/PFRole.h
index 3afa87c5..18d21c9f 100644
--- a/src/ios/Frameworks/Parse.framework/Headers/PFRole.h
+++ b/src/ios/Frameworks/Parse.framework/Headers/PFRole.h
@@ -1,18 +1,19 @@
-//
-// PFRole.h
-//
-// Copyright 2011-present Parse Inc. All rights reserved.
-//
+/**
+ * Copyright (c) 2015-present, Parse, LLC.
+ * All rights reserved.
+ *
+ * This source code is licensed under the BSD-style license found in the
+ * LICENSE file in the root directory of this source tree. An additional grant
+ * of patent rights can be found in the PATENTS file in the same directory.
+ */
#import
-#if TARGET_OS_IPHONE
+#import
#import
#import
-#else
-#import
-#import
-#endif
+
+PF_ASSUME_NONNULL_BEGIN
/*!
The `PFRole` class represents a Role on the Parse server.
@@ -23,7 +24,7 @@
Roles must have a name (which cannot be changed after creation of the role), and must specify an ACL.
*/
-@interface PFRole : PFObject
+@interface PFRole : PFObject
///--------------------------------------
/// @name Creating a New Role
@@ -32,35 +33,35 @@
/*!
@abstract Constructs a new `PFRole` with the given name.
If no default ACL has been specified, you must provide an ACL for the role.
-
+
@param name The name of the Role to create.
*/
- (instancetype)initWithName:(NSString *)name;
/*!
@abstract Constructs a new `PFRole` with the given name.
-
+
@param name The name of the Role to create.
@param acl The ACL for this role. Roles must have an ACL.
*/
-- (instancetype)initWithName:(NSString *)name acl:(PFACL *)acl;
+- (instancetype)initWithName:(NSString *)name acl:(PF_NULLABLE PFACL *)acl;
/*!
@abstract Constructs a new `PFRole` with the given name.
@discussion If no default ACL has been specified, you must provide an ACL for the role.
-
+
@param name The name of the Role to create.
*/
+ (instancetype)roleWithName:(NSString *)name;
/*!
@abstract Constructs a new `PFRole` with the given name.
-
+
@param name The name of the Role to create.
@param acl The ACL for this role. Roles must have an ACL.
*/
-+ (instancetype)roleWithName:(NSString *)name acl:(PFACL *)acl;
++ (instancetype)roleWithName:(NSString *)name acl:(PF_NULLABLE PFACL *)acl;
///--------------------------------------
/// @name Role-specific Properties
@@ -94,13 +95,6 @@
*/
@property (nonatomic, strong, readonly) PFRelation *roles;
-///--------------------------------------
-/// @name Querying for Roles
-///--------------------------------------
-
-/*!
- @abstract Creates a for `PFRole` objects.
- */
-+ (PFQuery *)query;
-
@end
+
+PF_ASSUME_NONNULL_END
diff --git a/src/ios/Frameworks/Parse.framework/Headers/PFSession.h b/src/ios/Frameworks/Parse.framework/Headers/PFSession.h
new file mode 100644
index 00000000..ebbe6cec
--- /dev/null
+++ b/src/ios/Frameworks/Parse.framework/Headers/PFSession.h
@@ -0,0 +1,52 @@
+/**
+ * Copyright (c) 2015-present, Parse, LLC.
+ * All rights reserved.
+ *
+ * This source code is licensed under the BSD-style license found in the
+ * LICENSE file in the root directory of this source tree. An additional grant
+ * of patent rights can be found in the PATENTS file in the same directory.
+ */
+
+#import
+
+#import
+
+#import
+#import
+
+PF_ASSUME_NONNULL_BEGIN
+
+@class PFSession;
+
+typedef void(^PFSessionResultBlock)(PFSession *PF_NULLABLE_S session, NSError *PF_NULLABLE_S error);
+
+/*!
+ `PFSession` is a local representation of a session.
+ This class is a subclass of a ,
+ and retains the same functionality as any other subclass of .
+ */
+@interface PFSession : PFObject
+
+/*!
+ @abstract The session token string for this session.
+ */
+@property (PF_NULLABLE_PROPERTY nonatomic, copy, readonly) NSString *sessionToken;
+
+/*!
+ *Asynchronously* fetches a `PFSession` object related to the current user.
+
+ @returns A task that is `completed` with an instance of `PFSession` class or is `faulted` if the operation fails.
+ */
++ (BFTask *)getCurrentSessionInBackground;
+
+/*!
+ *Asynchronously* fetches a `PFSession` object related to the current user.
+
+ @param block The block to execute when the operation completes.
+ It should have the following argument signature: `^(PFSession *session, NSError *error)`.
+ */
++ (void)getCurrentSessionInBackgroundWithBlock:(PF_NULLABLE PFSessionResultBlock)block;
+
+@end
+
+PF_ASSUME_NONNULL_END
diff --git a/src/ios/Frameworks/Parse.framework/Headers/PFSubclassing.h b/src/ios/Frameworks/Parse.framework/Headers/PFSubclassing.h
index 7c8781ce..5e406875 100644
--- a/src/ios/Frameworks/Parse.framework/Headers/PFSubclassing.h
+++ b/src/ios/Frameworks/Parse.framework/Headers/PFSubclassing.h
@@ -1,17 +1,24 @@
-//
-// PFSubclassing.h
-//
-// Copyright 2011-present Parse Inc. All rights reserved.
-//
+/**
+ * Copyright (c) 2015-present, Parse, LLC.
+ * All rights reserved.
+ *
+ * This source code is licensed under the BSD-style license found in the
+ * LICENSE file in the root directory of this source tree. An additional grant
+ * of patent rights can be found in the PATENTS file in the same directory.
+ */
#import
+#import
+
@class PFQuery;
+PF_ASSUME_NONNULL_BEGIN
+
/*!
If a subclass of conforms to `PFSubclassing` and calls ,
Parse framework will be able to use that class as the native class for a Parse cloud object.
-
+
Classes conforming to this protocol should subclass and
include `PFObject+Subclass.h` in their implementation file.
This ensures the methods in the Subclass category of are exposed in its subclasses only.
@@ -41,8 +48,8 @@
@returns A new without data.
*/
-+ (instancetype)objectWithoutDataWithObjectId:(NSString *)objectId;
-
++ (instancetype)objectWithoutDataWithObjectId:(PF_NULLABLE NSString *)objectId;
+
/*!
@abstract The name of the class as seen in the REST API.
*/
@@ -53,7 +60,7 @@
@discussion A default implementation is provided by which should always be sufficient.
*/
-+ (PFQuery *)query;
++ (PF_NULLABLE PFQuery *)query;
/*!
@abstract Returns a query for objects of this type with a given predicate.
@@ -66,7 +73,7 @@
@see [PFQuery queryWithClassName:predicate:]
*/
-+ (PFQuery *)queryWithPredicate:(NSPredicate *)predicate;
++ (PF_NULLABLE PFQuery *)queryWithPredicate:(PF_NULLABLE NSPredicate *)predicate;
/*!
@abstract Lets Parse know this class should be used to instantiate all objects with class type .
@@ -76,3 +83,5 @@
+ (void)registerSubclass;
@end
+
+PF_ASSUME_NONNULL_END
diff --git a/src/ios/Frameworks/Parse.framework/Headers/PFUser.h b/src/ios/Frameworks/Parse.framework/Headers/PFUser.h
index 9f3ebc85..a90c49d7 100644
--- a/src/ios/Frameworks/Parse.framework/Headers/PFUser.h
+++ b/src/ios/Frameworks/Parse.framework/Headers/PFUser.h
@@ -1,20 +1,25 @@
-//
-// PFUser.h
-//
-// Copyright 2011-present Parse Inc. All rights reserved.
-//
+/**
+ * Copyright (c) 2015-present, Parse, LLC.
+ * All rights reserved.
+ *
+ * This source code is licensed under the BSD-style license found in the
+ * LICENSE file in the root directory of this source tree. An additional grant
+ * of patent rights can be found in the PATENTS file in the same directory.
+ */
#import
-#if TARGET_OS_IPHONE
+#import
+
#import
#import
#import
-#else
-#import
-#import
-#import
-#endif
+
+PF_ASSUME_NONNULL_BEGIN
+
+typedef void(^PFUserSessionUpgradeResultBlock)(NSError *PF_NULLABLE_S error);
+typedef void(^PFUserLogoutResultBlock)(NSError *PF_NULLABLE_S error);
+
@class PFQuery;
@@ -22,20 +27,13 @@
The `PFUser` class is a local representation of a user persisted to the Parse Data.
This class is a subclass of a , and retains the same functionality of a ,
but also extends it with various user specific methods, like authentication, signing up, and validation uniqueness.
-
+
Many APIs responsible for linking a `PFUser` with Facebook or Twitter have been deprecated in favor of dedicated
utilities for each social network. See , and for more information.
*/
@interface PFUser : PFObject
-/*!
- @abstract The name of the `PFUser` class in the REST API.
-
- @discussion This is a required method.
- */
-+ (NSString *)parseClassName;
-
///--------------------------------------
/// @name Accessing the Current User
///--------------------------------------
@@ -45,14 +43,14 @@
@returns Returns a `PFUser` that is the currently logged in user. If there is none, returns `nil`.
*/
-+ (instancetype)currentUser;
++ (PF_NULLABLE instancetype)currentUser;
/*!
@abstract The session token for the `PFUser`.
@discussion This is set by the server upon successful authentication.
*/
-@property (nonatomic, strong) NSString *sessionToken;
+@property (PF_NULLABLE_PROPERTY nonatomic, copy, readonly) NSString *sessionToken;
/*!
@abstract Whether the `PFUser` was just created from a request.
@@ -80,11 +78,11 @@
@returns Returns a new `PFUser` object.
*/
-+ (PFUser *)user;
++ (instancetype)user;
/*!
@abstract Enables automatic creation of anonymous users.
-
+
@discussion After calling this method, will always have a value.
The user will only be created on the server once the user has been saved,
or once an object with a relation to that user or an ACL that refers to the user has been saved.
@@ -97,7 +95,7 @@
/*!
@abstract The username for the `PFUser`.
*/
-@property (nonatomic, strong) NSString *username;
+@property (PF_NULLABLE_PROPERTY nonatomic, strong) NSString *username;
/**!
@abstract The password for the `PFUser`.
@@ -105,12 +103,12 @@
@discussion This will not be filled in from the server with the password.
It is only meant to be set.
*/
-@property (nonatomic, strong) NSString *password;
+@property (PF_NULLABLE_PROPERTY nonatomic, strong) NSString *password;
/*!
@abstract The email for the `PFUser`.
*/
-@property (nonatomic, strong) NSString *email;
+@property (PF_NULLABLE_PROPERTY nonatomic, strong) NSString *email;
/*!
@abstract Signs up the user *synchronously*.
@@ -121,7 +119,7 @@
@returns Returns `YES` if the sign up was successful, otherwise `NO`.
*/
-- (BOOL)signUp;
+- (BOOL)signUp PF_SWIFT_UNAVAILABLE;
/*!
@abstract Signs up the user *synchronously*.
@@ -130,7 +128,7 @@
@warning Make sure that password and username are set before calling this method.
- @param error Error object to set on error.
+ @param error Error object to set on error.
@returns Returns whether the sign up was successful.
*/
@@ -157,9 +155,9 @@
@param block The block to execute.
It should have the following argument signature: `^(BOOL succeeded, NSError *error)`.
*/
-- (void)signUpInBackgroundWithBlock:(PFBooleanResultBlock)block;
+- (void)signUpInBackgroundWithBlock:(PF_NULLABLE PFBooleanResultBlock)block;
-/*
+/*!
@abstract Signs up the user *asynchronously*.
@discussion This will also enforce that the username isn't already taken.
@@ -172,7 +170,7 @@
`error` will be `nil` on success and set if there was an error.
`[result boolValue]` will tell you whether the call succeeded or not.
*/
-- (void)signUpInBackgroundWithTarget:(id)target selector:(SEL)selector;
+- (void)signUpInBackgroundWithTarget:(PF_NULLABLE_S id)target selector:(PF_NULLABLE_S SEL)selector;
///--------------------------------------
/// @name Logging In
@@ -190,8 +188,8 @@
@returns Returns an instance of the `PFUser` on success.
If login failed for either wrong password or wrong username, returns `nil`.
*/
-+ (instancetype)logInWithUsername:(NSString *)username
- password:(NSString *)password;
++ (PF_NULLABLE instancetype)logInWithUsername:(NSString *)username
+ password:(NSString *)password PF_SWIFT_UNAVAILABLE;
/*!
@abstract Makes a *synchronous* request to login a user with specified credentials.
@@ -206,9 +204,9 @@
@returns Returns an instance of the `PFUser` on success.
If login failed for either wrong password or wrong username, returns `nil`.
*/
-+ (instancetype)logInWithUsername:(NSString *)username
- password:(NSString *)password
- error:(NSError **)error;
++ (PF_NULLABLE instancetype)logInWithUsername:(NSString *)username
+ password:(NSString *)password
+ error:(NSError **)error;
/*!
@abstract Makes an *asynchronous* request to login a user with specified credentials.
@@ -224,7 +222,7 @@
+ (BFTask *)logInWithUsernameInBackground:(NSString *)username
password:(NSString *)password;
-/*
+/*!
@abstract Makes an *asynchronous* request to login a user with specified credentials.
@discussion Returns an instance of the successfully logged in `PFUser`.
@@ -238,8 +236,8 @@
*/
+ (void)logInWithUsernameInBackground:(NSString *)username
password:(NSString *)password
- target:(id)target
- selector:(SEL)selector;
+ target:(PF_NULLABLE_S id)target
+ selector:(PF_NULLABLE_S SEL)selector;
/*!
@abstract Makes an *asynchronous* request to log in a user with specified credentials.
@@ -254,7 +252,7 @@
*/
+ (void)logInWithUsernameInBackground:(NSString *)username
password:(NSString *)password
- block:(PFUserResultBlock)block;
+ block:(PF_NULLABLE PFUserResultBlock)block;
///--------------------------------------
/// @name Becoming a User
@@ -271,7 +269,7 @@
@returns Returns an instance of the `PFUser` on success.
If becoming a user fails due to incorrect token, it returns `nil`.
*/
-+ (instancetype)become:(NSString *)sessionToken;
++ (PF_NULLABLE instancetype)become:(NSString *)sessionToken PF_SWIFT_UNAVAILABLE;
/*!
@abstract Makes a *synchronous* request to become a user with the given session token.
@@ -285,8 +283,7 @@
@returns Returns an instance of the `PFUser` on success.
If becoming a user fails due to incorrect token, it returns `nil`.
*/
-+ (instancetype)become:(NSString *)sessionToken
- error:(NSError **)error;
++ (PF_NULLABLE instancetype)become:(NSString *)sessionToken error:(NSError **)error;
/*!
@abstract Makes an *asynchronous* request to become a user with the given session token.
@@ -300,20 +297,17 @@
*/
+ (BFTask *)becomeInBackground:(NSString *)sessionToken;
-/*
+/*!
@abstract Makes an *asynchronous* request to become a user with the given session token.
@discussion Returns an instance of the successfully logged in `PFUser`. This also caches the user locally
so that calls to will use the latest logged in user.
@param sessionToken The session token for the user.
- @param target Target object for the selector.
- @param selector The selector that will be called when the asynchrounous request is complete.
- It should have the following signature: `(void)callbackWithUser:(PFUser *)user error:(NSError *)error`.
+ @param block The block to execute.
+ The block should have the following argument signature: `^(PFUser *user, NSError *error)`.
*/
-+ (void)becomeInBackground:(NSString *)sessionToken
- target:(id)target
- selector:(SEL)selector;
++ (void)becomeInBackground:(NSString *)sessionToken block:(PF_NULLABLE PFUserResultBlock)block;
/*!
@abstract Makes an *asynchronous* request to become a user with the given session token.
@@ -322,10 +316,40 @@
so that calls to will use the latest logged in user.
@param sessionToken The session token for the user.
- @param block The block to execute. The block should have the following argument signature: (PFUser *user, NSError *error)
+ @param target Target object for the selector.
+ @param selector The selector that will be called when the asynchrounous request is complete.
+ It should have the following signature: `(void)callbackWithUser:(PFUser *)user error:(NSError *)error`.
*/
+ (void)becomeInBackground:(NSString *)sessionToken
- block:(PFUserResultBlock)block;
+ target:(PF_NULLABLE_S id)target
+ selector:(PF_NULLABLE_S SEL)selector;
+
+///--------------------------------------
+/// @name Revocable Session
+///--------------------------------------
+
+/*!
+ @abstract Enables revocable sessions and migrates the currentUser session token to use revocable session if needed.
+
+ @discussion This method is required if you want to use APIs
+ and you application's 'Require Revocable Session' setting is turned off on `http://parse.com` app settings.
+ After returned `BFTask` completes - class and APIs will be available for use.
+
+ @returns An instance of `BFTask` that is completed when
+ revocable sessions are enabled and currentUser token is migrated.
+ */
++ (BFTask *)enableRevocableSessionInBackground;
+
+/*!
+ @abstract Enables revocable sessions and upgrades the currentUser session token to use revocable session if needed.
+
+ @discussion This method is required if you want to use APIs
+ and legacy sessions are enabled in your application settings on `http://parse.com/`.
+ After returned `BFTask` completes - class and APIs will be available for use.
+
+ @param block Block that will be called when revocable sessions are enabled and currentUser token is migrated.
+ */
++ (void)enableRevocableSessionInBackgroundWithBlock:(PF_NULLABLE PFUserSessionUpgradeResultBlock)block;
///--------------------------------------
/// @name Logging Out
@@ -336,6 +360,28 @@
*/
+ (void)logOut;
+/*!
+ @abstract *Asynchronously* logs out the currently logged in user.
+
+ @discussion This will also remove the session from disk, log out of linked services
+ and all future calls to will return `nil`. This is preferrable to using ,
+ unless your code is already running from a background thread.
+
+ @returns An instance of `BFTask`, that is resolved with `nil` result when logging out completes.
+ */
++ (BFTask *)logOutInBackground;
+
+/*!
+ @abstract *Asynchronously* logs out the currently logged in user.
+
+ @discussion This will also remove the session from disk, log out of linked services
+ and all future calls to