Skip to content

Commit f1311ee

Browse files
authored
feat: Remove ParseFacebookUtils and ParseTwitterUtils (#1779)
BREAKING CHANGE: Removes convenience modules `ParseFacebookUtils` and `ParseTwitterUtils`, instead manually add the 3rd party authentication service SDK to log in and provide the authentication data to `PFUser.logInWithAuthType` to link the Parse User.
1 parent dd05d41 commit f1311ee

File tree

150 files changed

+97
-11542
lines changed

Some content is hidden

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

150 files changed

+97
-11542
lines changed

.github/workflows/ci.yml

-2
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,6 @@ jobs:
2020
script:
2121
- test:ios
2222
- test:macos
23-
- test:facebook_utils:ios
24-
- test:twitter_utils:ios
2523
- test:parseui:all
2624
- test:parse_live_query:all
2725
- build:starters

.gitignore

-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@ docs/
3737

3838
## AppCode
3939
.idea/
40-
ParseFacebookUtils/Vendor
4140
ParseUI/Vendor
4241

4342
# VSC

CONTRIBUTING.md

+1-3
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,8 @@
1212
For analyzing bugs, creating bug fixes and features we recommend to clone this repository locally and add it as a local package to your Xcode project. This way you can edit and inspect the Parse SDK while running your app. You can find step-by-step instructions for how do that in the [Xcode docs](https://developer.apple.com/documentation/xcode/editing-a-package-dependency-as-a-local-package).
1313

1414
1. Fork the repository and create a new branch.
15-
2. Add unit tests for any new code you add.
15+
2. Add unit tests for any new code you add:
1616
- Core Module - [/Parse/Tests/Unit/](/Parse/Tests/Unit/)
17-
- Facebook Utils - [/ParseFacebookUtils/Tests/Unit/](/ParseFacebookUtils/Tests/Unit/)
18-
- Twitter Utils - [/ParseTwitterUtils/Tests/Unit/](/ParseTwitterUtils/Tests/Unit/)
1917
3. If you've changed APIs, update the documentation and the [iOS Guide](https://github.com/parse-community/docs/tree/gh-pages/_includes/ios).
2018
4. Ensure the test suite passes.
2119
You can run the tests in the command line with rake.

Package.resolved

-9
Original file line numberDiff line numberDiff line change
@@ -19,15 +19,6 @@
1919
"version": "1.5.0"
2020
}
2121
},
22-
{
23-
"package": "Facebook",
24-
"repositoryURL": "https://github.com/facebook/facebook-ios-sdk",
25-
"state": {
26-
"branch": null,
27-
"revision": "7fd8a930a5b2c940a22efafe0e214ed0df671312",
28-
"version": "15.1.0"
29-
}
30-
},
3122
{
3223
"package": "OCMock",
3324
"repositoryURL": "https://github.com/erikdoe/ocmock.git",

Package.swift

+1-53
Original file line numberDiff line numberDiff line change
@@ -13,18 +13,13 @@ let package = Package(
1313
],
1414
products: [
1515
.library(name: "ParseObjC", targets: ["ParseCore"]),
16-
.library(name: "ParseFacebookUtils", targets: ["ParseFacebookUtils"]),
17-
.library(name: "ParseFacebookUtilsiOS", targets: ["ParseFacebookUtilsiOS"]),
18-
.library(name: "ParseFacebookUtilsTvOS", targets: ["ParseFacebookUtilsTvOS"]),
19-
.library(name: "ParseTwitterUtils", targets: ["ParseTwitterUtils"]),
2016
.library(name: "ParseUI", targets: ["ParseUI"]),
2117
.library(name: "ParseLiveQuery", targets: ["ParseLiveQuery"])
2218
],
2319
dependencies: [
2420
.package(url: "https://github.com/parse-community/Bolts-ObjC.git", from: "1.10.0"),
2521
.package(url: "https://github.com/BoltsFramework/Bolts-Swift.git", from: "1.5.0"),
2622
.package(url: "https://github.com/daltoniam/Starscream.git", from: "4.0.6"),
27-
.package(url: "https://github.com/facebook/facebook-ios-sdk.git", from: "15.1.0"),
2823
.package(name: "OCMock", url: "https://github.com/erikdoe/ocmock.git", .revision("67bb9602f0a7541f24dc2d6d0d7389ca3e4c2c89"))
2924
],
3025
targets: [
@@ -37,57 +32,10 @@ let package = Package(
3732
publicHeadersPath: "Source",
3833
cSettings: [.headerSearchPath("Internal/**")]
3934
),
40-
.target(
41-
name: "ParseFacebookUtils",
42-
dependencies: [
43-
"ParseCore",
44-
.product(name: "Bolts", package: "Bolts-ObjC"),
45-
.product(name: "FacebookCore", package: "facebook-ios-sdk", condition: .when(platforms: [.iOS, .tvOS])),
46-
.product(name: "FacebookLogin", package: "facebook-ios-sdk", condition: .when(platforms: [.iOS, .tvOS]))],
47-
path: "ParseFacebookUtils/ParseFacebookUtils",
48-
exclude: ["Resources/Info-tvOS.plist", "Resources/Info-iOS.plist"],
49-
resources: [.process("Resources")],
50-
publicHeadersPath: "Source"
51-
),
52-
.target(
53-
name: "ParseFacebookUtilsiOS",
54-
dependencies: [
55-
"ParseFacebookUtils"
56-
],
57-
path: "ParseFacebookUtilsiOS/ParseFacebookUtilsiOS",
58-
exclude: ["Resources/Info-iOS.plist"],
59-
resources: [.process("Resources")],
60-
publicHeadersPath: "Source",
61-
cSettings: [.headerSearchPath("Internal/**")]
62-
),
63-
.target(
64-
name: "ParseFacebookUtilsTvOS",
65-
dependencies: [
66-
"ParseFacebookUtils",
67-
.product(name: "FacebookTV", package: "facebook-ios-sdk", condition: .when(platforms: [.tvOS]))
68-
],
69-
path: "ParseFacebookUtilsTvOS/ParseFacebookUtilsTvOS",
70-
exclude: ["Resources/Info-tvOS.plist"],
71-
resources: [.process("Resources")],
72-
publicHeadersPath: "Source",
73-
cSettings: [.headerSearchPath("Internal/**")]
74-
),
75-
.target(
76-
name: "ParseTwitterUtils",
77-
dependencies: [
78-
"ParseCore"
79-
],
80-
path: "ParseTwitterUtils/ParseTwitterUtils",
81-
exclude: ["Resources/Info-iOS.plist"],
82-
resources: [.process("Resources")],
83-
publicHeadersPath: "Source",
84-
cSettings: [.headerSearchPath("Internal/**")]
85-
),
8635
.target(
8736
name: "ParseUI",
8837
dependencies: [
89-
"ParseFacebookUtilsiOS",
90-
"ParseTwitterUtils"
38+
"ParseCore"
9139
],
9240
path: "ParseUI/ParseUI",
9341
exclude: ["Resources/Info-iOS.plist"],

Parse.xcworkspace/contents.xcworkspacedata

-12
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Parse.xcworkspace/xcshareddata/swiftpm/Package.resolved

-9
Original file line numberDiff line numberDiff line change
@@ -19,15 +19,6 @@
1919
"version": "1.5.0"
2020
}
2121
},
22-
{
23-
"package": "Facebook",
24-
"repositoryURL": "https://github.com/facebook/facebook-ios-sdk.git",
25-
"state": {
26-
"branch": null,
27-
"revision": "7fd8a930a5b2c940a22efafe0e214ed0df671312",
28-
"version": "15.1.0"
29-
}
30-
},
3122
{
3223
"package": "OCMock",
3324
"repositoryURL": "https://github.com/erikdoe/ocmock.git",

Parse/Parse/Source/PFAnonymousUtils.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,10 @@ NS_ASSUME_NONNULL_BEGIN
3232
Data associated with the anonymous user is retained.
3333
- logIn switches users without converting the anonymous user.
3434
Data associated with the anonymous user will be lost.
35-
- Service logIn (e.g. Facebook, Twitter) will attempt to convert
35+
- Authentication service logIn will attempt to convert
3636
the anonymous user into a standard user by linking it to the service.
3737
If a user already exists that is linked to the service, it will instead switch to the existing user.
38-
- Service linking (e.g. Facebook, Twitter) will convert the anonymous user
38+
- Authentication service linking will convert the anonymous user
3939
into a standard user by linking it to the service.
4040
*/
4141
@interface PFAnonymousUtils : NSObject

Parse/Parse/Source/PFConstants.h

-12
Original file line numberDiff line numberDiff line change
@@ -320,10 +320,6 @@ typedef NS_ENUM(NSInteger, PFErrorCode) {
320320
Users can only be created through sign up.
321321
*/
322322
kPFErrorUserCanOnlyBeCreatedThroughSignUp = 207,
323-
/**
324-
An existing Facebook account already linked to another user.
325-
*/
326-
kPFErrorFacebookAccountAlreadyLinked = 208,
327323
/**
328324
An existing account already linked to another user.
329325
*/
@@ -333,18 +329,10 @@ typedef NS_ENUM(NSInteger, PFErrorCode) {
333329
*/
334330
kPFErrorInvalidSessionToken = 209,
335331
kPFErrorUserIdMismatch = 209,
336-
/**
337-
Facebook id missing from request.
338-
*/
339-
kPFErrorFacebookIdMissing = 250,
340332
/**
341333
Linked id missing from request.
342334
*/
343335
kPFErrorLinkedIdMissing = 250,
344-
/**
345-
Invalid Facebook session.
346-
*/
347-
kPFErrorFacebookInvalidSession = 251,
348336
/**
349337
Invalid linked session.
350338
*/

Parse/Parse/Source/PFUser.h

-5
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,6 @@ typedef void(^PFUserLogoutResultBlock)(NSError *_Nullable error);
3131
The `PFUser` class is a local representation of a user persisted to the Parse Data.
3232
This class is a subclass of a `PFObject`, and retains the same functionality of a `PFObject`,
3333
but also extends it with various user specific methods, like authentication, signing up, and validation uniqueness.
34-
35-
Many APIs responsible for linking a `PFUser` with Facebook or Twitter have been deprecated in favor of dedicated
36-
utilities for each social network. See `PFFacebookUtils`, `PFTwitterUtils` and `PFAnonymousUtils` for more information.
3734
*/
3835

3936
@interface PFUser : PFObject <PFSubclassing>
@@ -65,8 +62,6 @@ typedef void(^PFUserLogoutResultBlock)(NSError *_Nullable error);
6562

6663
/**
6764
Whether the `PFUser` was just created from a request.
68-
69-
This is only set after a Facebook or Twitter login.
7065
*/
7166
@property (nonatomic, assign, readonly) BOOL isNew;
7267

Parse/Parse/Source/PFUser.m

+8-10
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,7 @@ - (nullable PFRESTCommand *)_currentSignUpCommandForChanges:(PFOperationSet *)ch
223223
#pragma mark - Service Login
224224
///--------------------------------------
225225

226-
// Constructs the command for user_signup_or_login. This is used for Facebook, Twitter, and other linking services.
226+
// Constructs the command for user_signup_or_login. This is used for authentication services.
227227
- (PFRESTCommand *)_currentServiceLoginCommandForChanges:(PFOperationSet *)changes error:(NSError **)error {
228228
@synchronized([self lock]) {
229229
NSDictionary *parameters = [self _convertToDictionaryForSaving:changes
@@ -342,15 +342,13 @@ - (PFObject *)mergeFromObject:(PFUser *)other {
342342
/*
343343
Merges custom fields from JSON associated with a PFUser:
344344
{
345-
"session_token": string,
346-
"is_new": boolean,
347-
"auth_data": {
348-
"facebook": {
349-
"id": string,
350-
"access_token": string,
351-
"expiration_date": string (represents date)
352-
}
353-
}
345+
"session_token": string,
346+
"is_new": boolean,
347+
"auth_data": {
348+
"<auth_service_name>": {
349+
...
350+
}
351+
}
354352
}
355353
*/
356354
- (void)_mergeFromServerWithResult:(NSDictionary *)result decoder:(PFDecoder *)decoder completeData:(BOOL)completeData {

Parse/Tests/Resources/ParseUnitTests-OSX-Info.plist

-2
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,6 @@
3333
</array>
3434
<key>CFBundleVersion</key>
3535
<string>1.0</string>
36-
<key>FacebookAppID</key>
37-
<string>fake_id</string>
3836
<key>LSApplicationCategoryType</key>
3937
<string></string>
4038
<key>LSRequiresIPhoneOS</key>

Parse/Tests/Resources/ParseUnitTests-iOS-Info.plist

-2
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,6 @@
3333
</array>
3434
<key>CFBundleVersion</key>
3535
<string>1.0</string>
36-
<key>FacebookAppID</key>
37-
<string>fake_id</string>
3836
<key>LSApplicationCategoryType</key>
3937
<string></string>
4038
<key>LSRequiresIPhoneOS</key>

ParseFacebookUtils/.gitignore

-1
This file was deleted.

ParseFacebookUtils/CHANGELOG.md

-51
This file was deleted.

ParseFacebookUtils/Configurations/ParseFacebookUtilsV4-iOS-Dynamic.xcconfig

-16
This file was deleted.

ParseFacebookUtils/Configurations/ParseFacebookUtilsV4-iOS.xcconfig

-16
This file was deleted.

ParseFacebookUtils/Configurations/ParseFacebookUtilsV4-tvOS-Dynamic.xcconfig

-16
This file was deleted.

ParseFacebookUtils/Configurations/ParseFacebookUtilsV4-tvOS.xcconfig

-16
This file was deleted.

ParseFacebookUtils/Configurations/Shared

-1
This file was deleted.

0 commit comments

Comments
 (0)