Skip to content

Commit

Permalink
feat: Remove ParseFacebookUtils and ParseTwitterUtils (#1779)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
mtrezza authored Apr 8, 2024
1 parent dd05d41 commit f1311ee
Show file tree
Hide file tree
Showing 150 changed files with 97 additions and 11,542 deletions.
2 changes: 0 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,6 @@ jobs:
script:
- test:ios
- test:macos
- test:facebook_utils:ios
- test:twitter_utils:ios
- test:parseui:all
- test:parse_live_query:all
- build:starters
Expand Down
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ docs/

## AppCode
.idea/
ParseFacebookUtils/Vendor
ParseUI/Vendor

# VSC
Expand Down
4 changes: 1 addition & 3 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,8 @@
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).

1. Fork the repository and create a new branch.
2. Add unit tests for any new code you add.
2. Add unit tests for any new code you add:
- Core Module - [/Parse/Tests/Unit/](/Parse/Tests/Unit/)
- Facebook Utils - [/ParseFacebookUtils/Tests/Unit/](/ParseFacebookUtils/Tests/Unit/)
- Twitter Utils - [/ParseTwitterUtils/Tests/Unit/](/ParseTwitterUtils/Tests/Unit/)
3. If you've changed APIs, update the documentation and the [iOS Guide](https://github.com/parse-community/docs/tree/gh-pages/_includes/ios).
4. Ensure the test suite passes.
You can run the tests in the command line with rake.
Expand Down
9 changes: 0 additions & 9 deletions Package.resolved
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,6 @@
"version": "1.5.0"
}
},
{
"package": "Facebook",
"repositoryURL": "https://github.com/facebook/facebook-ios-sdk",
"state": {
"branch": null,
"revision": "7fd8a930a5b2c940a22efafe0e214ed0df671312",
"version": "15.1.0"
}
},
{
"package": "OCMock",
"repositoryURL": "https://github.com/erikdoe/ocmock.git",
Expand Down
54 changes: 1 addition & 53 deletions Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -13,18 +13,13 @@ let package = Package(
],
products: [
.library(name: "ParseObjC", targets: ["ParseCore"]),
.library(name: "ParseFacebookUtils", targets: ["ParseFacebookUtils"]),
.library(name: "ParseFacebookUtilsiOS", targets: ["ParseFacebookUtilsiOS"]),
.library(name: "ParseFacebookUtilsTvOS", targets: ["ParseFacebookUtilsTvOS"]),
.library(name: "ParseTwitterUtils", targets: ["ParseTwitterUtils"]),
.library(name: "ParseUI", targets: ["ParseUI"]),
.library(name: "ParseLiveQuery", targets: ["ParseLiveQuery"])
],
dependencies: [
.package(url: "https://github.com/parse-community/Bolts-ObjC.git", from: "1.10.0"),
.package(url: "https://github.com/BoltsFramework/Bolts-Swift.git", from: "1.5.0"),
.package(url: "https://github.com/daltoniam/Starscream.git", from: "4.0.6"),
.package(url: "https://github.com/facebook/facebook-ios-sdk.git", from: "15.1.0"),
.package(name: "OCMock", url: "https://github.com/erikdoe/ocmock.git", .revision("67bb9602f0a7541f24dc2d6d0d7389ca3e4c2c89"))
],
targets: [
Expand All @@ -37,57 +32,10 @@ let package = Package(
publicHeadersPath: "Source",
cSettings: [.headerSearchPath("Internal/**")]
),
.target(
name: "ParseFacebookUtils",
dependencies: [
"ParseCore",
.product(name: "Bolts", package: "Bolts-ObjC"),
.product(name: "FacebookCore", package: "facebook-ios-sdk", condition: .when(platforms: [.iOS, .tvOS])),
.product(name: "FacebookLogin", package: "facebook-ios-sdk", condition: .when(platforms: [.iOS, .tvOS]))],
path: "ParseFacebookUtils/ParseFacebookUtils",
exclude: ["Resources/Info-tvOS.plist", "Resources/Info-iOS.plist"],
resources: [.process("Resources")],
publicHeadersPath: "Source"
),
.target(
name: "ParseFacebookUtilsiOS",
dependencies: [
"ParseFacebookUtils"
],
path: "ParseFacebookUtilsiOS/ParseFacebookUtilsiOS",
exclude: ["Resources/Info-iOS.plist"],
resources: [.process("Resources")],
publicHeadersPath: "Source",
cSettings: [.headerSearchPath("Internal/**")]
),
.target(
name: "ParseFacebookUtilsTvOS",
dependencies: [
"ParseFacebookUtils",
.product(name: "FacebookTV", package: "facebook-ios-sdk", condition: .when(platforms: [.tvOS]))
],
path: "ParseFacebookUtilsTvOS/ParseFacebookUtilsTvOS",
exclude: ["Resources/Info-tvOS.plist"],
resources: [.process("Resources")],
publicHeadersPath: "Source",
cSettings: [.headerSearchPath("Internal/**")]
),
.target(
name: "ParseTwitterUtils",
dependencies: [
"ParseCore"
],
path: "ParseTwitterUtils/ParseTwitterUtils",
exclude: ["Resources/Info-iOS.plist"],
resources: [.process("Resources")],
publicHeadersPath: "Source",
cSettings: [.headerSearchPath("Internal/**")]
),
.target(
name: "ParseUI",
dependencies: [
"ParseFacebookUtilsiOS",
"ParseTwitterUtils"
"ParseCore"
],
path: "ParseUI/ParseUI",
exclude: ["Resources/Info-iOS.plist"],
Expand Down
12 changes: 0 additions & 12 deletions Parse.xcworkspace/contents.xcworkspacedata

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 0 additions & 9 deletions Parse.xcworkspace/xcshareddata/swiftpm/Package.resolved
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,6 @@
"version": "1.5.0"
}
},
{
"package": "Facebook",
"repositoryURL": "https://github.com/facebook/facebook-ios-sdk.git",
"state": {
"branch": null,
"revision": "7fd8a930a5b2c940a22efafe0e214ed0df671312",
"version": "15.1.0"
}
},
{
"package": "OCMock",
"repositoryURL": "https://github.com/erikdoe/ocmock.git",
Expand Down
4 changes: 2 additions & 2 deletions Parse/Parse/Source/PFAnonymousUtils.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,10 @@ NS_ASSUME_NONNULL_BEGIN
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
- Authentication service logIn 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
- Authentication service linking will convert the anonymous user
into a standard user by linking it to the service.
*/
@interface PFAnonymousUtils : NSObject
Expand Down
12 changes: 0 additions & 12 deletions Parse/Parse/Source/PFConstants.h
Original file line number Diff line number Diff line change
Expand Up @@ -320,10 +320,6 @@ typedef NS_ENUM(NSInteger, PFErrorCode) {
Users can only be created through sign up.
*/
kPFErrorUserCanOnlyBeCreatedThroughSignUp = 207,
/**
An existing Facebook account already linked to another user.
*/
kPFErrorFacebookAccountAlreadyLinked = 208,
/**
An existing account already linked to another user.
*/
Expand All @@ -333,18 +329,10 @@ typedef NS_ENUM(NSInteger, PFErrorCode) {
*/
kPFErrorInvalidSessionToken = 209,
kPFErrorUserIdMismatch = 209,
/**
Facebook id missing from request.
*/
kPFErrorFacebookIdMissing = 250,
/**
Linked id missing from request.
*/
kPFErrorLinkedIdMissing = 250,
/**
Invalid Facebook session.
*/
kPFErrorFacebookInvalidSession = 251,
/**
Invalid linked session.
*/
Expand Down
5 changes: 0 additions & 5 deletions Parse/Parse/Source/PFUser.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,6 @@ typedef void(^PFUserLogoutResultBlock)(NSError *_Nullable error);
The `PFUser` class is a local representation of a user persisted to the Parse Data.
This class is a subclass of a `PFObject`, and retains the same functionality of a `PFObject`,
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 `PFFacebookUtils`, `PFTwitterUtils` and `PFAnonymousUtils` for more information.
*/

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

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

Expand Down
18 changes: 8 additions & 10 deletions Parse/Parse/Source/PFUser.m
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@ - (nullable PFRESTCommand *)_currentSignUpCommandForChanges:(PFOperationSet *)ch
#pragma mark - Service Login
///--------------------------------------

// Constructs the command for user_signup_or_login. This is used for Facebook, Twitter, and other linking services.
// Constructs the command for user_signup_or_login. This is used for authentication services.
- (PFRESTCommand *)_currentServiceLoginCommandForChanges:(PFOperationSet *)changes error:(NSError **)error {
@synchronized([self lock]) {
NSDictionary *parameters = [self _convertToDictionaryForSaving:changes
Expand Down Expand Up @@ -342,15 +342,13 @@ - (PFObject *)mergeFromObject:(PFUser *)other {
/*
Merges custom fields from JSON associated with a PFUser:
{
"session_token": string,
"is_new": boolean,
"auth_data": {
"facebook": {
"id": string,
"access_token": string,
"expiration_date": string (represents date)
}
}
"session_token": string,
"is_new": boolean,
"auth_data": {
"<auth_service_name>": {
...
}
}
}
*/
- (void)_mergeFromServerWithResult:(NSDictionary *)result decoder:(PFDecoder *)decoder completeData:(BOOL)completeData {
Expand Down
2 changes: 0 additions & 2 deletions Parse/Tests/Resources/ParseUnitTests-OSX-Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,6 @@
</array>
<key>CFBundleVersion</key>
<string>1.0</string>
<key>FacebookAppID</key>
<string>fake_id</string>
<key>LSApplicationCategoryType</key>
<string></string>
<key>LSRequiresIPhoneOS</key>
Expand Down
2 changes: 0 additions & 2 deletions Parse/Tests/Resources/ParseUnitTests-iOS-Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,6 @@
</array>
<key>CFBundleVersion</key>
<string>1.0</string>
<key>FacebookAppID</key>
<string>fake_id</string>
<key>LSApplicationCategoryType</key>
<string></string>
<key>LSRequiresIPhoneOS</key>
Expand Down
1 change: 0 additions & 1 deletion ParseFacebookUtils/.gitignore

This file was deleted.

51 changes: 0 additions & 51 deletions ParseFacebookUtils/CHANGELOG.md

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

1 change: 0 additions & 1 deletion ParseFacebookUtils/Configurations/Shared

This file was deleted.

Loading

0 comments on commit f1311ee

Please sign in to comment.