Skip to content

Commit 47df435

Browse files
committed
Merge remote-tracking branch 'ParsePlatform/master' into release/1.15.0
* 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
2 parents 66002bd + ba0afd1 commit 47df435

File tree

66 files changed

+501
-210
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

66 files changed

+501
-210
lines changed

.travis.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ branches:
33
- master
44
language: objective-c
55
os: osx
6-
osx_image: xcode7.3
6+
osx_image: xcode8.3
77
env:
88
global:
99
- LC_CTYPE=en_US.UTF-8
@@ -35,4 +35,4 @@ after_success:
3535
- |
3636
if [ "$TEST_TYPE" = iOS ] || [ "$TEST_TYPE" = macOS ]; then
3737
bash <(curl -s https://codecov.io/bash)
38-
fi
38+
fi

Cartfile.resolved

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
github "BoltsFramework/Bolts-ObjC" "1.8.4"
2-
github "erikdoe/OCMock" "v3.3.1"
2+
github "erikdoe/OCMock" "v3.4"

Configurations/ParseUnitTests-iOS.xcconfig

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ PRODUCT_NAME = ParseUnitTests-iOS
1414
PRODUCT_MODULE_NAME = ParseUnitTests
1515
PRODUCT_BUNDLE_IDENTIFIER = com.parse.unit.ios
1616

17+
SWIFT_VERSION = 3.0
18+
1719
IPHONEOS_DEPLOYMENT_TARGET = 8.0
1820

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

Configurations/ParseUnitTests-macOS.xcconfig

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ PRODUCT_NAME = ParseUnitTests-macOS
1414
PRODUCT_MODULE_NAME = ParseUnitTests
1515
PRODUCT_BUNDLE_IDENTIFIER = com.parse.unit.macOS
1616

17+
SWIFT_VERSION = 3.0
18+
1719
INFOPLIST_FILE = $(SRCROOT)/Tests/Resources/ParseUnitTests-OSX-Info.plist
1820

1921
USER_HEADER_SEARCH_PATHS = $(inherited) $(PARSE_DIR)/Parse/Internal/**

Parse.podspec

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
Pod::Spec.new do |s|
22
s.name = 'Parse'
3-
s.version = '1.14.4'
3+
s.version = '1.15.0'
44
s.license = { :type => 'BSD', :file => 'LICENSE' }
5-
s.homepage = 'https://www.parse.com/'
5+
s.homepage = 'http://parseplatform.org/'
66
s.summary = 'A library that gives you access to the powerful Parse cloud platform from your iOS/OS X/watchOS/tvOS app.'
77
s.authors = 'Parse'
88

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

1111
s.platform = :ios, :osx, :tvos, :watchos
1212
s.ios.deployment_target = '7.0'

Parse.xcodeproj/project.pbxproj

Lines changed: 116 additions & 65 deletions
Large diffs are not rendered by default.

Parse.xcodeproj/xcshareddata/xcschemes/Parse-iOS-Dynamic.xcscheme

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<Scheme
3-
LastUpgradeVersion = "0730"
3+
LastUpgradeVersion = "0830"
44
version = "1.3">
55
<BuildAction
66
parallelizeBuildables = "YES"

Parse.xcodeproj/xcshareddata/xcschemes/Parse-iOS.xcscheme

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<Scheme
3-
LastUpgradeVersion = "0730"
3+
LastUpgradeVersion = "0830"
44
version = "1.3">
55
<BuildAction
66
parallelizeBuildables = "YES"

Parse.xcodeproj/xcshareddata/xcschemes/Parse-macOS.xcscheme

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<Scheme
3-
LastUpgradeVersion = "0730"
3+
LastUpgradeVersion = "0830"
44
version = "1.3">
55
<BuildAction
66
parallelizeBuildables = "YES"

Parse.xcodeproj/xcshareddata/xcschemes/Parse-tvOS-Dynamic.xcscheme

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<Scheme
3-
LastUpgradeVersion = "0730"
3+
LastUpgradeVersion = "0830"
44
version = "1.3">
55
<BuildAction
66
parallelizeBuildables = "YES"

Parse.xcodeproj/xcshareddata/xcschemes/Parse-tvOS.xcscheme

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<Scheme
3-
LastUpgradeVersion = "0730"
3+
LastUpgradeVersion = "0830"
44
version = "1.3">
55
<BuildAction
66
parallelizeBuildables = "YES"

Parse.xcodeproj/xcshareddata/xcschemes/Parse-watchOS-Dynamic.xcscheme

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<Scheme
3-
LastUpgradeVersion = "0730"
3+
LastUpgradeVersion = "0830"
44
version = "1.3">
55
<BuildAction
66
parallelizeBuildables = "YES"

Parse.xcodeproj/xcshareddata/xcschemes/Parse-watchOS.xcscheme

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<Scheme
3-
LastUpgradeVersion = "0730"
3+
LastUpgradeVersion = "0830"
44
version = "1.3">
55
<BuildAction
66
parallelizeBuildables = "YES"

Parse/Internal/LocalDataStore/OfflineStore/PFOfflineStore.m

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1019,6 +1019,16 @@ - (void)updateObjectIdForObject:(PFObject *)object
10191019
oldObjectId:(NSString *)oldObjectId
10201020
newObjectId:(NSString *)newObjectId {
10211021
if (oldObjectId != nil) {
1022+
#if TARGET_OS_IOS
1023+
if ([object isKindOfClass:[PFInstallation class]]
1024+
&& newObjectId == nil) {
1025+
NSString *key = [self _generateKeyForClassName:object.parseClassName objectId:oldObjectId];
1026+
@synchronized(self.lock) {
1027+
[self.classNameAndObjectIdToObjectMap removeObjectForKey:key];
1028+
}
1029+
return;
1030+
}
1031+
#endif
10221032
PFConsistencyAssert([oldObjectId isEqualToString:newObjectId], @"objectIds cannot be changed in offline mode.");
10231033
return;
10241034
}

Parse/Internal/Object/State/PFObjectState.m

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
#import "PFMutableObjectState.h"
1616
#import "PFObjectConstants.h"
1717
#import "PFObjectUtilities.h"
18+
#import "PFFieldOperation.h"
1819

1920
@implementation PFObjectState
2021

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

131132
- (void)setServerDataObject:(id)object forKey:(NSString *)key {
132-
_serverData[key] = object;
133+
if (!object || [object isKindOfClass:[PFDeleteOperation class]]) {
134+
[self removeServerDataObjectForKey:key];
135+
} else {
136+
_serverData[key] = object;
137+
}
133138
}
134139

135140
- (void)removeServerDataObjectForKey:(NSString *)key {

Parse/Internal/ParseManager.m

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
#import "PFUser.h"
2828
#import "PFURLSessionCommandRunner.h"
2929
#import "PFPersistenceController.h"
30+
#import "ParseManagerPrivate.h"
3031

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

305306
#pragma mark CommandRunner
306307

308+
// Set Command Runner. Used for testing.
309+
- (void)setCommandRunner:(id<PFCommandRunning>)commandRunner {
310+
_commandRunner = commandRunner;
311+
}
312+
307313
- (id<PFCommandRunning>)commandRunner {
308314
__block id<PFCommandRunning> runner = nil;
309315
dispatch_sync(_commandRunnerAccessQueue, ^{

Parse/Internal/ParseManagerPrivate.h

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
/**
2+
* Copyright (c) 2015-present, Parse, LLC.
3+
* All rights reserved.
4+
*
5+
* This source code is licensed under the BSD-style license found in the
6+
* LICENSE file in the root directory of this source tree. An additional grant
7+
* of patent rights can be found in the PATENTS file in the same directory.
8+
*/
9+
10+
#import "ParseManager.h"
11+
12+
@interface ParseManager ()
13+
14+
- (void)setCommandRunner:(id<PFCommandRunning>)commandRunner;
15+
16+
@end

Parse/Internal/Query/PFQueryConstants.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ extern NSString *const PFQueryKeyNotContainedIn;
2121
extern NSString *const PFQueryKeyContainsAll;
2222
extern NSString *const PFQueryKeyNearSphere;
2323
extern NSString *const PFQueryKeyWithin;
24+
extern NSString *const PFQueryKeyGeoWithin;
2425
extern NSString *const PFQueryKeyRegex;
2526
extern NSString *const PFQueryKeyExists;
2627
extern NSString *const PFQueryKeyInQuery;
@@ -35,6 +36,7 @@ extern NSString *const PFQueryKeyObject;
3536

3637
extern NSString *const PFQueryOptionKeyMaxDistance;
3738
extern NSString *const PFQueryOptionKeyBox;
39+
extern NSString *const PFQueryOptionKeyPolygon;
3840
extern NSString *const PFQueryOptionKeyRegexOptions;
3941

4042
NS_ASSUME_NONNULL_END

Parse/Internal/Query/PFQueryConstants.m

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
NSString *const PFQueryKeyContainsAll = @"$all";
2020
NSString *const PFQueryKeyNearSphere = @"$nearSphere";
2121
NSString *const PFQueryKeyWithin = @"$within";
22+
NSString *const PFQueryKeyGeoWithin = @"$geoWithin";
2223
NSString *const PFQueryKeyRegex = @"$regex";
2324
NSString *const PFQueryKeyExists = @"$exists";
2425
NSString *const PFQueryKeyInQuery = @"$inQuery";
@@ -33,4 +34,5 @@
3334

3435
NSString *const PFQueryOptionKeyMaxDistance = @"$maxDistance";
3536
NSString *const PFQueryOptionKeyBox = @"$box";
37+
NSString *const PFQueryOptionKeyPolygon = @"$polygon";
3638
NSString *const PFQueryOptionKeyRegexOptions = @"$options";

Parse/PFConstants.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
#pragma mark - SDK Version
1414
///--------------------------------------
1515

16-
#define PARSE_VERSION @"1.14.4"
16+
#define PARSE_VERSION @"1.15.0"
1717

1818
///--------------------------------------
1919
#pragma mark - Platform
File renamed without changes.
File renamed without changes.

Parse/Internal/PFEncoder.h renamed to Parse/PFEncoder.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,6 @@
1111

1212
#import <Parse/PFConstants.h>
1313

14-
#import "PFMacros.h"
15-
1614
@class BFTask<__covariant BFGenericType>;
1715
@class PFObject;
1816
@class PFOfflineStore;

Parse/Internal/PFEncoder.m renamed to Parse/PFEncoder.m

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
#import "PFObjectPrivate.h"
2020
#import "PFOfflineStore.h"
2121
#import "PFRelationPrivate.h"
22+
#import "PFMacros.h"
2223

2324
@implementation PFEncoder
2425

Parse/PFInstallation.m

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,8 @@
2828
#import "PFQueryPrivate.h"
2929
#import "Parse_Private.h"
3030
#import "PFErrorUtilities.h"
31+
#import "PFObjectState_Private.h"
32+
#import "PFObjectConstants.h"
3133

3234
@implementation PFInstallation (Private)
3335

@@ -36,7 +38,8 @@ @implementation PFInstallation (Private)
3638
+ (void)initialize {
3739
static dispatch_once_t onceToken;
3840
dispatch_once(&onceToken, ^{
39-
protectedKeys = PF_SET(PFInstallationKeyDeviceType,
41+
protectedKeys = PF_SET(PFObjectObjectIdRESTKey,
42+
PFInstallationKeyDeviceType,
4043
PFInstallationKeyInstallationId,
4144
PFInstallationKeyTimeZone,
4245
PFInstallationKeyLocaleIdentifier,
@@ -83,6 +86,14 @@ - (NSString *)displayClassName {
8386
return NSStringFromClass([PFInstallation class]);
8487
}
8588

89+
///--------------------------------------
90+
#pragma mark - Properties
91+
///--------------------------------------
92+
93+
- (void) setObjectId:(NSString *)objectId {
94+
PFParameterAssertionFailure(@"Installation's objectIds cannot be changed");
95+
}
96+
8697
///--------------------------------------
8798
#pragma mark - Command Handlers
8899
///--------------------------------------
@@ -223,16 +234,13 @@ - (void)setChannels:(NSArray<NSString *> *)channels {
223234

224235
- (BFTask *)saveAsync:(BFTask *)toAwait {
225236
return [[super saveAsync:toAwait] continueWithBlock:^id(BFTask *task) {
226-
// Do not attempt to resave an object if LDS is enabled, since changing objectId is not allowed.
227-
if ([Parse _currentManager].offlineStoreLoaded) {
228-
return task;
229-
}
230-
231237
if (task.error.code == kPFErrorObjectNotFound) {
232238
@synchronized (self.lock) {
233239
// Retry the fetch as a save operation because this Installation was deleted on the server.
234240
// We always want [currentInstallation save] to succeed.
235-
self.objectId = nil;
241+
PFObjectState *state = [PFObjectState stateWithState:self._state];
242+
state.objectId = nil;
243+
self._state = state;
236244
[self _markAllFieldsDirty];
237245
return [super saveAsync:nil];
238246
}

Parse/PFObject.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -268,7 +268,7 @@ + (void)collectDirtyChildren:(id)node
268268
// Recurse into this object's children looking for dirty children.
269269
// We only need to look at the child object's current estimated data,
270270
// because that's the only data that might need to be saved now.
271-
toSearch = [object->_estimatedData.dictionaryRepresentation copy];
271+
toSearch = [object._estimatedData.dictionaryRepresentation copy];
272272
}
273273

274274
[self collectDirtyChildren:toSearch

Parse/PFQuery.h

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -308,6 +308,21 @@ typedef void (^PFQueryArrayResultBlock)(NSArray<PFGenericObject> *_Nullable obje
308308
*/
309309
- (instancetype)whereKey:(NSString *)key withinGeoBoxFromSouthwest:(PFGeoPoint *)southwest toNortheast:(PFGeoPoint *)northeast;
310310

311+
/**
312+
* Add a constraint to the query that requires a particular key's
313+
* coordinates be contained within and on the bounds of a given polygon
314+
* Supports closed and open (last point is connected to first) paths.
315+
* (Requires [email protected])
316+
*
317+
* Polygon must have at least 3 points
318+
*
319+
* @param key The key to be constrained.
320+
* @param points The polygon points as an Array of `PFGeoPoint`'s.
321+
*
322+
* @return The same instance of `PFQuery` as the receiver. This allows method chaining.
323+
*/
324+
- (instancetype)whereKey:(NSString *)key withinPolygon:(NSArray<PFGeoPoint *> *)points;
325+
311326
///--------------------------------------
312327
#pragma mark - Adding String Constraints
313328
///--------------------------------------

Parse/PFQuery.m

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -301,6 +301,11 @@ - (instancetype)whereKey:(NSString *)key withinGeoBoxFromSouthwest:(PFGeoPoint *
301301
return [self whereKey:key condition:PFQueryKeyWithin object:dictionary];
302302
}
303303

304+
- (instancetype)whereKey:(NSString *)key withinPolygon:(NSArray<PFGeoPoint *> *)points {
305+
NSDictionary *dictionary = @{ PFQueryOptionKeyPolygon : points };
306+
return [self whereKey:key condition:PFQueryKeyGeoWithin object:dictionary];
307+
}
308+
304309
- (instancetype)whereKey:(NSString *)key matchesRegex:(NSString *)regex {
305310
return [self whereKey:key condition:PFQueryKeyRegex object:regex];
306311
}

Parse/Parse.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@
2020
#import <Parse/PFConfig.h>
2121
#import <Parse/PFConfig+Synchronous.h>
2222
#import <Parse/PFConstants.h>
23+
#import <Parse/PFDecoder.h>
24+
#import <Parse/PFEncoder.h>
2325
#import <Parse/PFFile.h>
2426
#import <Parse/PFFile+Deprecated.h>
2527
#import <Parse/PFFile+Synchronous.h>

Parse/Resources/Parse-OSX.Info.plist

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,10 @@
1313
<key>CFBundlePackageType</key>
1414
<string>FMWK</string>
1515
<key>CFBundleShortVersionString</key>
16-
<string>1.14.4</string>
16+
<string>1.15.0</string>
1717
<key>CFBundleSignature</key>
1818
<string>????</string>
1919
<key>CFBundleVersion</key>
20-
<string>1.14.4</string>
20+
<string>1.15.0</string>
2121
</dict>
2222
</plist>

Parse/Resources/Parse-iOS.Info.plist

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
<key>CFBundlePackageType</key>
1414
<string>FMWK</string>
1515
<key>CFBundleShortVersionString</key>
16-
<string>1.14.4</string>
16+
<string>1.15.0</string>
1717
<key>CFBundleSignature</key>
1818
<string>????</string>
1919
<key>CFBundleSupportedPlatforms</key>
@@ -22,7 +22,7 @@
2222
<string>iPhoneOS</string>
2323
</array>
2424
<key>CFBundleVersion</key>
25-
<string>1.14.4</string>
25+
<string>1.15.0</string>
2626
<key>MinimumOSVersion</key>
2727
<string>6.0</string>
2828
</dict>

Parse/Resources/Parse-tvOS.Info.plist

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,11 @@
1515
<key>CFBundlePackageType</key>
1616
<string>FMWK</string>
1717
<key>CFBundleShortVersionString</key>
18-
<string>1.14.4</string>
18+
<string>1.15.0</string>
1919
<key>CFBundleSignature</key>
2020
<string>????</string>
2121
<key>CFBundleVersion</key>
22-
<string>1.14.4</string>
22+
<string>1.15.0</string>
2323
<key>NSPrincipalClass</key>
2424
<string></string>
2525
</dict>

0 commit comments

Comments
 (0)