Skip to content

Commit

Permalink
Merge remote-tracking branch 'ParsePlatform/master' into release/1.15.0
Browse files Browse the repository at this point in the history
* ParsePlatform/master:
  ⚡️ Release 1.15.0 (parse-community#1153)
  ⚡ Release 1.14.5 (parse-community#1152)
  Add withinPolygon to Query (parse-community#1150)
  Use getter instead accessing instance variable (parse-community#1026)
  Makes PFEncoder and PFDecoder public for LiveQuery (parse-community#1149)
  Let the iOS SDK handle Delete ops when sent from the server (parse-community#928)
  Outputing offending bundle in assert message. (parse-community#1000)
  Update documentation links (parse-community#1102)
  Swift 3 (parse-community#1145)
  Allowing to re-save installation if LDS is enabled (parse-community#1125)
  Removed or replaced the broken links in the README (parse-community#1141)
  update pod spec homepage (parse-community#1135)
  Update podspec link
  Update links
  • Loading branch information
tkhoa87 committed Jun 30, 2017
2 parents 66002bd + ba0afd1 commit 47df435
Show file tree
Hide file tree
Showing 66 changed files with 501 additions and 210 deletions.
4 changes: 2 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ branches:
- master
language: objective-c
os: osx
osx_image: xcode7.3
osx_image: xcode8.3
env:
global:
- LC_CTYPE=en_US.UTF-8
Expand Down Expand Up @@ -35,4 +35,4 @@ after_success:
- |
if [ "$TEST_TYPE" = iOS ] || [ "$TEST_TYPE" = macOS ]; then
bash <(curl -s https://codecov.io/bash)
fi
fi
2 changes: 1 addition & 1 deletion Cartfile.resolved
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
github "BoltsFramework/Bolts-ObjC" "1.8.4"
github "erikdoe/OCMock" "v3.3.1"
github "erikdoe/OCMock" "v3.4"
2 changes: 2 additions & 0 deletions Configurations/ParseUnitTests-iOS.xcconfig
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ PRODUCT_NAME = ParseUnitTests-iOS
PRODUCT_MODULE_NAME = ParseUnitTests
PRODUCT_BUNDLE_IDENTIFIER = com.parse.unit.ios

SWIFT_VERSION = 3.0

IPHONEOS_DEPLOYMENT_TARGET = 8.0

INFOPLIST_FILE = $(SRCROOT)/Tests/Resources/ParseUnitTests-iOS-Info.plist
Expand Down
2 changes: 2 additions & 0 deletions Configurations/ParseUnitTests-macOS.xcconfig
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ PRODUCT_NAME = ParseUnitTests-macOS
PRODUCT_MODULE_NAME = ParseUnitTests
PRODUCT_BUNDLE_IDENTIFIER = com.parse.unit.macOS

SWIFT_VERSION = 3.0

INFOPLIST_FILE = $(SRCROOT)/Tests/Resources/ParseUnitTests-OSX-Info.plist

USER_HEADER_SEARCH_PATHS = $(inherited) $(PARSE_DIR)/Parse/Internal/**
Expand Down
6 changes: 3 additions & 3 deletions Parse.podspec
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
Pod::Spec.new do |s|
s.name = 'Parse'
s.version = '1.14.4'
s.version = '1.15.0'
s.license = { :type => 'BSD', :file => 'LICENSE' }
s.homepage = 'https://www.parse.com/'
s.homepage = 'http://parseplatform.org/'
s.summary = 'A library that gives you access to the powerful Parse cloud platform from your iOS/OS X/watchOS/tvOS app.'
s.authors = 'Parse'

s.source = { :git => "https://github.com/ParsePlatform/Parse-SDK-iOS-OSX.git", :tag => s.version.to_s }
s.source = { :git => "https://github.com/parse-community/Parse-SDK-iOS-OSX.git", :tag => s.version.to_s }

s.platform = :ios, :osx, :tvos, :watchos
s.ios.deployment_target = '7.0'
Expand Down
181 changes: 116 additions & 65 deletions Parse.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0730"
LastUpgradeVersion = "0830"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
Expand Down
2 changes: 1 addition & 1 deletion Parse.xcodeproj/xcshareddata/xcschemes/Parse-iOS.xcscheme
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0730"
LastUpgradeVersion = "0830"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0730"
LastUpgradeVersion = "0830"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0730"
LastUpgradeVersion = "0830"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
Expand Down
2 changes: 1 addition & 1 deletion Parse.xcodeproj/xcshareddata/xcschemes/Parse-tvOS.xcscheme
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0730"
LastUpgradeVersion = "0830"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0730"
LastUpgradeVersion = "0830"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0730"
LastUpgradeVersion = "0830"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
Expand Down
10 changes: 10 additions & 0 deletions Parse/Internal/LocalDataStore/OfflineStore/PFOfflineStore.m
Original file line number Diff line number Diff line change
Expand Up @@ -1019,6 +1019,16 @@ - (void)updateObjectIdForObject:(PFObject *)object
oldObjectId:(NSString *)oldObjectId
newObjectId:(NSString *)newObjectId {
if (oldObjectId != nil) {
#if TARGET_OS_IOS
if ([object isKindOfClass:[PFInstallation class]]
&& newObjectId == nil) {
NSString *key = [self _generateKeyForClassName:object.parseClassName objectId:oldObjectId];
@synchronized(self.lock) {
[self.classNameAndObjectIdToObjectMap removeObjectForKey:key];
}
return;
}
#endif
PFConsistencyAssert([oldObjectId isEqualToString:newObjectId], @"objectIds cannot be changed in offline mode.");
return;
}
Expand Down
7 changes: 6 additions & 1 deletion Parse/Internal/Object/State/PFObjectState.m
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
#import "PFMutableObjectState.h"
#import "PFObjectConstants.h"
#import "PFObjectUtilities.h"
#import "PFFieldOperation.h"

@implementation PFObjectState

Expand Down Expand Up @@ -129,7 +130,11 @@ - (NSDictionary *)dictionaryRepresentationWithObjectEncoder:(PFEncoder *)objectE
#pragma mark Accessors

- (void)setServerDataObject:(id)object forKey:(NSString *)key {
_serverData[key] = object;
if (!object || [object isKindOfClass:[PFDeleteOperation class]]) {
[self removeServerDataObjectForKey:key];
} else {
_serverData[key] = object;
}
}

- (void)removeServerDataObjectForKey:(NSString *)key {
Expand Down
6 changes: 6 additions & 0 deletions Parse/Internal/ParseManager.m
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
#import "PFUser.h"
#import "PFURLSessionCommandRunner.h"
#import "PFPersistenceController.h"
#import "ParseManagerPrivate.h"

#if !TARGET_OS_WATCH && !TARGET_OS_TV
#import "PFPushManager.h"
Expand Down Expand Up @@ -304,6 +305,11 @@ - (PFInstallationIdentifierStore *)installationIdentifierStore {

#pragma mark CommandRunner

// Set Command Runner. Used for testing.
- (void)setCommandRunner:(id<PFCommandRunning>)commandRunner {
_commandRunner = commandRunner;
}

- (id<PFCommandRunning>)commandRunner {
__block id<PFCommandRunning> runner = nil;
dispatch_sync(_commandRunnerAccessQueue, ^{
Expand Down
16 changes: 16 additions & 0 deletions Parse/Internal/ParseManagerPrivate.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
/**
* 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 "ParseManager.h"

@interface ParseManager ()

- (void)setCommandRunner:(id<PFCommandRunning>)commandRunner;

@end
2 changes: 2 additions & 0 deletions Parse/Internal/Query/PFQueryConstants.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ extern NSString *const PFQueryKeyNotContainedIn;
extern NSString *const PFQueryKeyContainsAll;
extern NSString *const PFQueryKeyNearSphere;
extern NSString *const PFQueryKeyWithin;
extern NSString *const PFQueryKeyGeoWithin;
extern NSString *const PFQueryKeyRegex;
extern NSString *const PFQueryKeyExists;
extern NSString *const PFQueryKeyInQuery;
Expand All @@ -35,6 +36,7 @@ extern NSString *const PFQueryKeyObject;

extern NSString *const PFQueryOptionKeyMaxDistance;
extern NSString *const PFQueryOptionKeyBox;
extern NSString *const PFQueryOptionKeyPolygon;
extern NSString *const PFQueryOptionKeyRegexOptions;

NS_ASSUME_NONNULL_END
2 changes: 2 additions & 0 deletions Parse/Internal/Query/PFQueryConstants.m
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
NSString *const PFQueryKeyContainsAll = @"$all";
NSString *const PFQueryKeyNearSphere = @"$nearSphere";
NSString *const PFQueryKeyWithin = @"$within";
NSString *const PFQueryKeyGeoWithin = @"$geoWithin";
NSString *const PFQueryKeyRegex = @"$regex";
NSString *const PFQueryKeyExists = @"$exists";
NSString *const PFQueryKeyInQuery = @"$inQuery";
Expand All @@ -33,4 +34,5 @@

NSString *const PFQueryOptionKeyMaxDistance = @"$maxDistance";
NSString *const PFQueryOptionKeyBox = @"$box";
NSString *const PFQueryOptionKeyPolygon = @"$polygon";
NSString *const PFQueryOptionKeyRegexOptions = @"$options";
2 changes: 1 addition & 1 deletion Parse/PFConstants.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
#pragma mark - SDK Version
///--------------------------------------

#define PARSE_VERSION @"1.14.4"
#define PARSE_VERSION @"1.15.0"

///--------------------------------------
#pragma mark - Platform
Expand Down
File renamed without changes.
File renamed without changes.
2 changes: 0 additions & 2 deletions Parse/Internal/PFEncoder.h → Parse/PFEncoder.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@

#import <Parse/PFConstants.h>

#import "PFMacros.h"

@class BFTask<__covariant BFGenericType>;
@class PFObject;
@class PFOfflineStore;
Expand Down
1 change: 1 addition & 0 deletions Parse/Internal/PFEncoder.m → Parse/PFEncoder.m
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
#import "PFObjectPrivate.h"
#import "PFOfflineStore.h"
#import "PFRelationPrivate.h"
#import "PFMacros.h"

@implementation PFEncoder

Expand Down
22 changes: 15 additions & 7 deletions Parse/PFInstallation.m
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@
#import "PFQueryPrivate.h"
#import "Parse_Private.h"
#import "PFErrorUtilities.h"
#import "PFObjectState_Private.h"
#import "PFObjectConstants.h"

@implementation PFInstallation (Private)

Expand All @@ -36,7 +38,8 @@ @implementation PFInstallation (Private)
+ (void)initialize {
static dispatch_once_t onceToken;
dispatch_once(&onceToken, ^{
protectedKeys = PF_SET(PFInstallationKeyDeviceType,
protectedKeys = PF_SET(PFObjectObjectIdRESTKey,
PFInstallationKeyDeviceType,
PFInstallationKeyInstallationId,
PFInstallationKeyTimeZone,
PFInstallationKeyLocaleIdentifier,
Expand Down Expand Up @@ -83,6 +86,14 @@ - (NSString *)displayClassName {
return NSStringFromClass([PFInstallation class]);
}

///--------------------------------------
#pragma mark - Properties
///--------------------------------------

- (void) setObjectId:(NSString *)objectId {
PFParameterAssertionFailure(@"Installation's objectIds cannot be changed");
}

///--------------------------------------
#pragma mark - Command Handlers
///--------------------------------------
Expand Down Expand Up @@ -223,16 +234,13 @@ - (void)setChannels:(NSArray<NSString *> *)channels {

- (BFTask *)saveAsync:(BFTask *)toAwait {
return [[super saveAsync:toAwait] continueWithBlock:^id(BFTask *task) {
// Do not attempt to resave an object if LDS is enabled, since changing objectId is not allowed.
if ([Parse _currentManager].offlineStoreLoaded) {
return task;
}

if (task.error.code == kPFErrorObjectNotFound) {
@synchronized (self.lock) {
// Retry the fetch as a save operation because this Installation was deleted on the server.
// We always want [currentInstallation save] to succeed.
self.objectId = nil;
PFObjectState *state = [PFObjectState stateWithState:self._state];
state.objectId = nil;
self._state = state;
[self _markAllFieldsDirty];
return [super saveAsync:nil];
}
Expand Down
2 changes: 1 addition & 1 deletion Parse/PFObject.m
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,7 @@ + (void)collectDirtyChildren:(id)node
// Recurse into this object's children looking for dirty children.
// We only need to look at the child object's current estimated data,
// because that's the only data that might need to be saved now.
toSearch = [object->_estimatedData.dictionaryRepresentation copy];
toSearch = [object._estimatedData.dictionaryRepresentation copy];
}

[self collectDirtyChildren:toSearch
Expand Down
15 changes: 15 additions & 0 deletions Parse/PFQuery.h
Original file line number Diff line number Diff line change
Expand Up @@ -308,6 +308,21 @@ typedef void (^PFQueryArrayResultBlock)(NSArray<PFGenericObject> *_Nullable obje
*/
- (instancetype)whereKey:(NSString *)key withinGeoBoxFromSouthwest:(PFGeoPoint *)southwest toNortheast:(PFGeoPoint *)northeast;

/**
* Add a constraint to the query that requires a particular key's
* coordinates be contained within and on the bounds of a given polygon
* Supports closed and open (last point is connected to first) paths.
* (Requires [email protected])
*
* Polygon must have at least 3 points
*
* @param key The key to be constrained.
* @param points The polygon points as an Array of `PFGeoPoint`'s.
*
* @return The same instance of `PFQuery` as the receiver. This allows method chaining.
*/
- (instancetype)whereKey:(NSString *)key withinPolygon:(NSArray<PFGeoPoint *> *)points;

///--------------------------------------
#pragma mark - Adding String Constraints
///--------------------------------------
Expand Down
5 changes: 5 additions & 0 deletions Parse/PFQuery.m
Original file line number Diff line number Diff line change
Expand Up @@ -301,6 +301,11 @@ - (instancetype)whereKey:(NSString *)key withinGeoBoxFromSouthwest:(PFGeoPoint *
return [self whereKey:key condition:PFQueryKeyWithin object:dictionary];
}

- (instancetype)whereKey:(NSString *)key withinPolygon:(NSArray<PFGeoPoint *> *)points {
NSDictionary *dictionary = @{ PFQueryOptionKeyPolygon : points };
return [self whereKey:key condition:PFQueryKeyGeoWithin object:dictionary];
}

- (instancetype)whereKey:(NSString *)key matchesRegex:(NSString *)regex {
return [self whereKey:key condition:PFQueryKeyRegex object:regex];
}
Expand Down
2 changes: 2 additions & 0 deletions Parse/Parse.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@
#import <Parse/PFConfig.h>
#import <Parse/PFConfig+Synchronous.h>
#import <Parse/PFConstants.h>
#import <Parse/PFDecoder.h>
#import <Parse/PFEncoder.h>
#import <Parse/PFFile.h>
#import <Parse/PFFile+Deprecated.h>
#import <Parse/PFFile+Synchronous.h>
Expand Down
4 changes: 2 additions & 2 deletions Parse/Resources/Parse-OSX.Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@
<key>CFBundlePackageType</key>
<string>FMWK</string>
<key>CFBundleShortVersionString</key>
<string>1.14.4</string>
<string>1.15.0</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>1.14.4</string>
<string>1.15.0</string>
</dict>
</plist>
4 changes: 2 additions & 2 deletions Parse/Resources/Parse-iOS.Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
<key>CFBundlePackageType</key>
<string>FMWK</string>
<key>CFBundleShortVersionString</key>
<string>1.14.4</string>
<string>1.15.0</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleSupportedPlatforms</key>
Expand All @@ -22,7 +22,7 @@
<string>iPhoneOS</string>
</array>
<key>CFBundleVersion</key>
<string>1.14.4</string>
<string>1.15.0</string>
<key>MinimumOSVersion</key>
<string>6.0</string>
</dict>
Expand Down
4 changes: 2 additions & 2 deletions Parse/Resources/Parse-tvOS.Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@
<key>CFBundlePackageType</key>
<string>FMWK</string>
<key>CFBundleShortVersionString</key>
<string>1.14.4</string>
<string>1.15.0</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>1.14.4</string>
<string>1.15.0</string>
<key>NSPrincipalClass</key>
<string></string>
</dict>
Expand Down
Loading

0 comments on commit 47df435

Please sign in to comment.