Skip to content

MT-1881 Update Facebook SDK#2

Open
rwpramono-mamiteam wants to merge 228 commits intomasterfrom
facebook-master
Open

MT-1881 Update Facebook SDK#2
rwpramono-mamiteam wants to merge 228 commits intomasterfrom
facebook-master

Conversation

@rwpramono-mamiteam
Copy link
Copy Markdown

joesusnick and others added 30 commits September 22, 2020 10:00
Summary: More hardening around unit tests. It's really critical that we only mock from one place and clean up mocks after every test case.

Reviewed By: KylinChang

Differential Revision: D23797082

fbshipit-source-id: 61e4f4f36587f4d4d55b41fdb9faa0fe54ac05c4
Summary: Bumps default version of graph api to v8

Reviewed By: KylinChang

Differential Revision: D23844972

fbshipit-source-id: b3ead3c0a878024e57a70108189744457a99f615
Summary:
Pull Request resolved: facebook#1497

$title

Reviewed By: robtimp

Differential Revision: D23857192

fbshipit-source-id: b15055daee5a981abc88a55af7abf838f22fbe50
Summary:
Pull Request resolved: facebook#1494

Colocate FBSDKVideoUploader with classes that use it.

Reviewed By: joesus

Differential Revision: D23715063

fbshipit-source-id: 8231459755f104306adf1cfd779596f697ab6ae3
…pEventsUtility advertisingTrackingStatus]

Summary:
Since LAT is always on iOS 14, [FBSDKAppEventsUtility advertisingTrackingStatus] will always return FBSDKAdvertisingTrackingDisallowed
```
+ (FBSDKAdvertisingTrackingStatus)advertisingTrackingStatus
{
  static dispatch_once_t fetchAdvertisingTrackingStatusOnce;
  static FBSDKAdvertisingTrackingStatus status;

  dispatch_once(&fetchAdvertisingTrackingStatusOnce, ^{
    status = FBSDKAdvertisingTrackingUnspecified;
    Class ASIdentifierManagerClass = fbsdkdfl_ASIdentifierManagerClass();
    if ([ASIdentifierManagerClass class]) {
      ASIdentifierManager *manager = [ASIdentifierManagerClass sharedManager];
      if (manager) {
        status = manager.advertisingTrackingEnabled ? FBSDKAdvertisingTrackingAllowed : FBSDKAdvertisingTrackingDisallowed;
      }
    }
  });

  return status;
}
```

We should use [FBSDKSettings getAdvertisingTrackingStatus] instead:
```
+ (FBSDKAdvertisingTrackingStatus)getAdvertisingTrackingStatus
{
  if (available(iOS 14.0, *)) {
    if (g_advertiserTrackingStatus == nil) {
      g_advertiserTrackingStatus = [[NSUserDefaults standardUserDefaults] objectForKey:FBSDKSettingsAdvertisingTrackingStatus] ?: @([FBSDKAppEventsConfigurationManager cachedAppEventsConfiguration].defaultATEStatus);
    }
    return g_advertiserTrackingStatus.unsignedIntegerValue;
  } else {
    return [FBSDKAppEventsUtility advertisingTrackingStatus];
  }
}
```

Reviewed By: dreamolight

Differential Revision: D23915342

fbshipit-source-id: b32bedcdb36c20740dd0375928aeb7c77de42f6d
Summary: We should only disable AAM when we could not collect app events.

Reviewed By: KylinChang

Differential Revision: D23917647

fbshipit-source-id: 8f550f9ca61ac40fdbc1d002d5002d03d625ec53
Summary: Same as the title

Reviewed By: YOUDAN

Differential Revision: D23922764

fbshipit-source-id: 24f532b74746a4a85ddfe048db8519db2726e6b6
Summary: as title

Reviewed By: dreamolight

Differential Revision: D23937943

fbshipit-source-id: be7f61395d7a594cf2d04264493ce90b8ab23cfd
Summary: As title

Reviewed By: Oliverccccct, dreamolight

Differential Revision: D23947476

fbshipit-source-id: 383c574b2966e0870bb1aba2a7b52d12cf9ad50b
Summary:
Pull Request resolved: facebook#1500

As title

Reviewed By: dreamolight

Differential Revision: D23955816

fbshipit-source-id: ff00a38c026cd1073a54859fad0dd260bcc2e502
Summary: as title

Reviewed By: dreamolight

Differential Revision: D23955758

fbshipit-source-id: acadb629097c731b4dacb8c4f1df755697414fd2
Summary: As title

Reviewed By: dreamolight

Differential Revision: D23956881

fbshipit-source-id: f2150cb5bb15ed96f07324f4a83f548369365081
Summary: Updates Release configuration so that static libraries build using Xcode12 include the x86_64 architecture.

Reviewed By: dreamolight

Differential Revision: D23869085

fbshipit-source-id: 8fb2e861a555c99eeb876dc6daf7e9c7dde43f4a
Summary:
Pull Request resolved: facebook#1502

Adds stub for avoiding a network call on `loadServerConfigurationWithCompletionBlock`.

Reviewed By: KylinChang

Differential Revision: D23908807

fbshipit-source-id: 166e5a986c5fdb3e87a8ddd9f7cc0fb950acbafe
Summary:
Pull Request resolved: facebook#1507

When fatal signals arise, we should uninstall our signal handlers of crash reporting and use the previous or default signal handlers instead, so app can crash as expected, or resume from bad state with its own handlers.

Reviewed By: tianqibt

Differential Revision: D24007602

fbshipit-source-id: 02df46b89d377043468f6eba9fdc90cdd621d0c5
Summary: Resolves T76251268

Reviewed By: yury-dymov

Differential Revision: D23995664

fbshipit-source-id: 3423767af736434538f1a8826aaf52de45e94d2f
Summary: Add a new method which enables adding a single key:value pair to the `_extras` dictionary which is sent as part of the logging flow for login events.

Differential Revision: D23879923

fbshipit-source-id: d8d2b4c37d85ba4c9c107284f80ed7e2ac189ac5
Summary:
Original commit changeset: 3423767af736

Will wait until next major version release and then add this to that changeset.

Reviewed By: robtimp

Differential Revision: D24120409

fbshipit-source-id: 6988a1cb151f4793a531192b0be4d2e8ff6e95da
Summary: $title

Reviewed By: jingping2015

Differential Revision: D24149903

fbshipit-source-id: 565ddf6844a650b560d0ea346e5ca6d21f5d98a7
Summary:
Stops linking UIKit binary for static FBSDKGamingServicesKit. Not 100% sure why this is failing the xcode-integration ci job but this might help. This is more consistent with how the other kits are linking (or not linking) UIKit and local testing showed no issue with removing it.

Additionally the carthage job is failing for tvos. This is likely due to the xcode 12 rollout. Including the fixes in here so we can fix the build as one diff.

allow-large-files
Also upgrading carthage binary 0.35.0 -> 0.36.0 to  to see if that's the reason for the command failure.

Differential Revision: D24196254

fbshipit-source-id: 51cb301b379fffa746deaea982d643d3c701f116
Summary:
We received iOS Stall Detected at FBGetAdvertisingIdentifier for IG. In order to avoid stall, we are going to move sending app events action to background thread.

This diff is for `FBSDK`, we will have another diff for `IGFBSDK`.

Reviewed By: tianqibt, KylinChang

Differential Revision: D24107807

fbshipit-source-id: b9c79acaad7a0a8bbe2e8d6154b8a6ffdba5cd35
Summary:
The main goal of this diff is to remove OHHTPStubs from the FBSDKAppLinkResolver test code.

The easiest way to do that has been to extract the request building part from FBSDKAppLinkResolver to it own class. These allows us to:

- Assert correctness over some parts of the request independently
- Inject a builder mock in FBSDKAppLinkResolver so we can control the FBSDKGraphRequest and inject the response we want, without having to mock the http layer at all.

Reviewed By: joesus

Differential Revision: D23964906

fbshipit-source-id: 8ca26b40b2defd7fd8e3ea07db25da69ae8426ca
Summary:
The main goal of this diff is to remove OHHTPStubs from the FBSDKAppLinkResolver test code.

The easiest way to do that has been to extract the request building part from FBSDKAppLinkResolver to it own class.

These allows us to:

- Assert correctness over some parts of the request independently
- Inject a builder mock in FBSDKAppLinkResolver so we can control the FBSDKGraphRequest and inject the response we want, without having to mock the http layer at all.

Reviewed By: joesus

Differential Revision: D24077192

fbshipit-source-id: 54141fe1a0533bc97503e7a241387c0d0c4da5e3
Summary:
as title, revert D24107807 (facebook@95835b8)

Reason: we want to fix IG stall issues we received first. Will update iOS SDK correspondingly after IG fix has no issues.

Reviewed By: dreamolight

Differential Revision: D24262028

fbshipit-source-id: bdbe28180103c1d3eb0e3ed6adb8f473a5c05cac
…ok#1520)

Summary:
Pull Request resolved: facebook#1520

CircleCI is failing with the error:
```
error: 'UI_USER_INTERFACE_IDIOM' is deprecated: first deprecated in macCatalyst 13.0 - Use -[UIDevice userInterfaceIdiom] directly. [-Werror,-Wdeprecated-declarations]
```

Differential Revision: D24265594

fbshipit-source-id: 35c3cc9a23e959552e0103e88e04dffa3693041a
Summary:
Pull Request resolved: facebook#1517

Fixes Carthage build for Xcode 12 by following script proposed in
https://github.com/Carthage/Carthage/blob/master/Documentation/Xcode12Workaround.md

Reviewed By: d16r

Differential Revision: D24227997

fbshipit-source-id: 475b6dcff7347e895b0ae40a90169580310dad40
Summary:
Pull Request resolved: facebook#1525

I made some faulty assumptions about why I was getting an rsync warning so I gated it behind a file check. This led to a false positive where it appeared that the files were being synced when they were not.

This updated code ignores the output of the step when it fails since it will fail for GamingServicesKit (because it contains no Swift files at the moment).

Reviewed By: tianqibt, dreamolight

Differential Revision: D24339344

fbshipit-source-id: fe5eccaf4e6bf379eb8b2f2ceffbf3d11fd0e65f
Summary:
## Context:

In terms of BUCK, CocoaPods and Swift Package Manager, CoreKitBasics is its own module.

Even in terms of xcodeproj it's its own target. This formalizes that dependency relationship.

## Why do this?

This allows us to avoid a lot of the messiness where we have something like:

```
#if defined FBSDKCOCOAPODS
 #import <FBSDKCoreKit/FBSDKCoreKit_Basics.h>
#elif defined BUCK
 #import <FBSDKCoreKit_Basics/FBSDKCoreKit_Basics.h>
#else
 #import "FBSDKCoreKit_Basics.h"
#endif
```
Now we can just do:
```
#import <FBSDKCoreKit_Basics/FBSDKCoreKit_Basics.h>
```
and it will "just work"

## This diff

Adds two new config files so that Basics is able to be imported as it's own library. This means we can import with `<FBSDKCoreKit_Basics/something.h>`

Reviewed By: dreamolight

Differential Revision: D24179750

fbshipit-source-id: 75c04b3f01552421b6f16560909f501f3c56d777
Summary:
Pull Request resolved: facebook#1526

## Context:

In terms of BUCK, CocoaPods and Swift Package Manager, CoreKitBasics is its own module.

Even in terms of xcodeproj it's its own target. This formalizes that dependency relationship.

## Why do this?

This allows us to avoid a lot of the messiness where we have something like:

```
#if defined FBSDKCOCOAPODS
 #import <FBSDKCoreKit/FBSDKCoreKit_Basics.h>
#elif defined BUCK
 #import <FBSDKCoreKit_Basics/FBSDKCoreKit_Basics.h>
#else
 #import "FBSDKCoreKit_Basics.h"
#endif
```
Now we can just do:
```
#import <FBSDKCoreKit_Basics/FBSDKCoreKit_Basics.h>
```
and it will "just work"

**Correction**: CocoaPods considers anything in a podspec to be part of the same module. Either future work will be needed to publish basics as its own module or we'll have to live with fragmented header imports.

So really the why do this comes down to having the correct code boundaries. In CocoaPods this is a subspec but in other areas it's on the module/product/target level.

## This diff

Adds FBSDKCoreKit basics as a linked dependency to the other kits. This relationship is not new but it was previously hidden by having Basics source files added to the other CoreKit targets. This also fixes the CoreKit+Internal dependency to depend on the library instead of just importing the header.

Reviewed By: dreamolight

Differential Revision: D24179749

fbshipit-source-id: 32a9332a2d0319c1d7579a28895d9d102dec0505
ppansy and others added 27 commits December 18, 2020 15:53
Summary: We will call the logout endpoint with id token (authentication token) string instead of JTI

Reviewed By: joesus

Differential Revision: D25646193

fbshipit-source-id: 31b11e05122af03a3d2901c7e4e8d65443dd877a
Summary: Minor cleanup around checking enum cases.

Reviewed By: robtimp

Differential Revision: D25647669

fbshipit-source-id: 7ec49b544204c4270024a516fe1a527ca440b19a
Summary: as title

Reviewed By: Oliverccccct

Differential Revision: D25662812

fbshipit-source-id: 15f86cddcee5642b3812c1c3b750882e282973f1
Summary: Add prefix to private methods in FBSDKCrashHandler. No logic change.

Reviewed By: joesus

Differential Revision: D25662746

fbshipit-source-id: 9494e9174feb26482218369d33771d93d27feb40
Summary: as title

Reviewed By: joesus

Differential Revision: D25667409

fbshipit-source-id: d1b95908c692f6418678b130e9eb2735280abfc0
Summary:
Fixing bug that ProfilePictureView is not getting cleared when a limited login session is invalidated by logout endpoint.

The bug is caused by two notifications trying to update profile picture at the same time:
1) On app launched, a saved Profile instance is read from cache, which triggers a notification
2) ProfilePictureView makes an async network call to fetch the image from Profile
3) "Not Authorized" status returned from logout endpoint, Profile is set to nil, which triggers another notification.
4) ProfilePictureView clears the image after seeing Profile is nil
5) image fetch from step 2) completed. ProfilePictureView sets the image using the fecthed data

The fix is to make sure `lastState` is set when the view will use an image, and is `nil` when the view will be cleared (use a placeholder). `_updateImageWithData:state` should return directly if the given state doesn't match `_lastState`. In the above example, `_lastState` will be set to nil in step 4), which will prevent the view from overwriting image in step 5)

Reviewed By: joesus, regresscheck

Differential Revision: D25650327

fbshipit-source-id: 59098376c93ea0f7e3cfc1355a2f8154e11d213a
Summary: Removed `LoginManager.raiseLoginException` and `LoginManager.assertPermissions`, both of them are unused.

Reviewed By: joesus

Differential Revision: D25597945

fbshipit-source-id: 8b2e1f34533aac1386893c6568ecbadc55c7cf3f
Summary:
Started out interested in shoring up anywhere in this file that we may accidentally access a dictionary without type-checking.

Scope creep happened:
* Updates to use helper methods for unpacking expiration dates.
* Refactors to pass in a `GraphRequestConnectionProviding` begin decoupling FBSDKCoreKit and making it easier to unit test various responses.

Reviewed By: ppansy

Differential Revision: D25650323

fbshipit-source-id: 03865603fb3ab83b4378e0875f051ef14f8a5a33
Summary: If expiration is nil, the token should be invalid. Fixing the verification logic to make it so

Reviewed By: joesus

Differential Revision: D25671980

fbshipit-source-id: 845022e03d437f84bdccc422219d118119c696eb
Summary: Add check to make sure "typ" in token header is "JWT"

Reviewed By: joesus

Differential Revision: D25672931

fbshipit-source-id: 0153fa34037bc67aefad54cc255586c78e77018c
Summary: Add private methods pragma mark. No logic change.

Reviewed By: joesus

Differential Revision: D25670541

fbshipit-source-id: 9ccacf398b9ab61b2189abbb9cfa223f9bbe0769
Summary: as title

Reviewed By: joesus

Differential Revision: D25670700

fbshipit-source-id: 2f454b8e6bad550f5246dbb24fec32744ef246f9
Summary: as title

Reviewed By: joesus

Differential Revision: D25671023

fbshipit-source-id: cf7e3cddb25ced093722cbefe1910f038d627666
Summary: as title

Reviewed By: joesus

Differential Revision: D25672109

fbshipit-source-id: cc28a7b20b34de0164535615f5ffb28f672025a1
Summary:
Remove broken symlink
Update header to work for building packages

Reviewed By: tianqibt

Differential Revision: D25676440

fbshipit-source-id: 0d374eeb24078f20b54bf10b8483f2b407156010
Summary: title. Make sure we always use facebook domain for public key & logout endpoint

Reviewed By: joesus

Differential Revision: D25673572

fbshipit-source-id: 17109ca0385a53c96b7549a12c3c4042f05a116b
Summary: title

Reviewed By: joesus

Differential Revision: D25597761

fbshipit-source-id: 4cc11a74b1208d3b39846a9e30eba1b79ba7c771
Summary:
* Adds a couple checks in places where we may assume the presence of an access token.
* Cleans up some documentation in LoginManager

Reviewed By: ppansy

Differential Revision: D25684128

fbshipit-source-id: 5ec2a3c6ff72bee5d9def41a3dbf27bc2b937b81
Summary: Adds a couple missing test cases for invalid and mangled certificates.

Reviewed By: ppansy

Differential Revision: D25685406

fbshipit-source-id: 82529a1ac029ca9fc953b131150ef75cefec381b
Summary: Before we return cancelled if nonce and id_token are returned together. An error with decription would probably be better in this case

Reviewed By: joesus

Differential Revision: D25685126

fbshipit-source-id: d4a65555331777fe105b90be11338ff8c38969e5
Summary: title

Reviewed By: joesus

Differential Revision: D25687263

fbshipit-source-id: 25d01e93e608a5f257107c27a429983de2261e3d
Summary: Allow gaming basic permissions(gaming_profile, gaming_user_picture) for Limited Login

Reviewed By: joesus

Differential Revision: D25697203

fbshipit-source-id: 33729009e2ca935834b9540414d83fec0807424d
Summary: Makes token associated type optional on Swift `LoginResult`

Reviewed By: ppansy

Differential Revision: D25698171

fbshipit-source-id: d55e3f10edb9fdee116cfd88f98f507e33037d45
Summary: as title

Reviewed By: joesus

Differential Revision: D25687409

fbshipit-source-id: 94d662b7132856af7760b5f4c0797b7c1bff0964
Summary: as title

Reviewed By: joesus

Differential Revision: D25687639

fbshipit-source-id: 218fd5027bd7ae2ba97a8572b74854092ac7a090
Summary: enforce permission to be consist of only lowercase letter and "_"

Reviewed By: joesus

Differential Revision: D25682243

fbshipit-source-id: eb74e2532163dbcfc3f27e4ce0ef8b11e2c60a2c
@rwpramono-mamiteam rwpramono-mamiteam self-assigned this Jan 4, 2021
@rwpramono-mamiteam rwpramono-mamiteam added the enhancement New feature or request label Jan 4, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.