Summary:
Warnings in tests were fixed in a previous commit. This fixes warnings that appear when right when the app is launched.
Fixes GitHub issues #1941 and #1930
Reviewed By: samodom
Differential Revision: D32607508
fbshipit-source-id: 903e2967caadc312b41a3b4a6caee060eee305fc
Summary:
Running the tests no longer shows these warnings.
Fixed the following warnings when running FBSDKAppEventsStateManagerTests.testPersistingValidState and FBSDKAppEventsTests.testFetchingConfigurationIncludingCertainFeatures
```
Attempted to decode a collection type 'NSString' (subclass of 'NSObject') for key 'NS.keys'. 'NSString' requires its subclasses to be explicitly added to the allowed classes list but it is not present.
allowed unarchiving safe plist type ''NSNumber' (0x7fff863021c8) [/Applications/Xcode_13.0.0_fb.app/Contents/Developer/Platforms/iPhoneOS.platform/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot/System/Library/Frameworks/Foundation.framework]' for key 'NS.objects', even though it was not explicitly included in the client allowed classes set
```
Reviewed By: joesus
Differential Revision: D32606181
fbshipit-source-id: e095005a1904c9b1996df0c3c0ea96482def88de
Summary: For some MMPs, we let developers set the FB app ID in the info.plist
Reviewed By: samodom
Differential Revision: D32249433
fbshipit-source-id: 5abfb5b5957c8ae6a4a23e2a762a258fa126fe6f
Summary: Two of the umbrella headers were missing modular imports of their files
Reviewed By: jawwad
Differential Revision: D32232931
fbshipit-source-id: d61e1a12d7e6f59560e151243684ae7c084f443b
Summary: As AEMKit grows larger, we add FBAEMUitlity class and will add util functions to this class.
Reviewed By: wx0165927473
Differential Revision: D32116160
fbshipit-source-id: 077d66a3383f6dd81818fd798f90453aacbe7624
Summary: In order to unblock MMP <-> AEM, we need to read the app id from plist file.
Reviewed By: jamestouri
Differential Revision: D31970825
fbshipit-source-id: f2af0e77daa138fccc9464f05034adf4e54884a9
Summary: In taking a look at the `attemptRecoveryFromError:optionIndex:completionHandler:` method I noticed that optionIndex was unused. The documentation in FBSDKErrorRecoveryAttempting.h shows that this method was modeled on NSErrorRecoveryAttempting. However anytime it was called 0 was passed in for the optionIndex so it was essentially unused.
Reviewed By: samodom
Differential Revision: D31881915
fbshipit-source-id: 79d2bcc014bba0d42288ac289fbdde78b5a7f8cf
Summary:
Disabled by surrounding methods that are annotated with NS_SWIFT_NAME with UNCRUSTIFY_FORMAT_OFF / UNCRUSTIFY_FORMAT_ON
This is because uncrustify doesn't know how to align the colons correctly.
Ran the following command to do so:
```
hg files -I '**/*.h' -0 | xargs -0 perl -0777 -pi -e 's/(?<!UNCRUSTIFY_FORMAT_OFF\n)(^[+-][^;]+?\n\s*NS_SWIFT_NAME\(.*?:.*?\).*?;)/\/\/ UNCRUSTIFY_FORMAT_OFF\n\1\n\/\/ UNCRUSTIFY_FORMAT_ON\n/smg'
```
Reviewed By: samodom
Differential Revision: D31933741
fbshipit-source-id: 3071ed7fa65b4b67e86bf9f337d7f525ef9253ce
Summary:
It's weird but `@_exported import` does not seem to work when archiving with SPM on Xcode 12.5. This means that symbols are not re-exported under the library names that SPM defines but instead are only available in the underlying `FBSDK`-prefixed modules.
## Some context:
The SPM targets with the `Facebook` prefix (ex: `FacebookCore` are by and large just hacks to help people avoid importing dependent frameworks and libraries such as `Accelerate` and `z`. Essentially they are just wrappers. We were using `@_exported import` so that you could use the symbols from the 'wrapped' framework as though they were coming from the original framework.
This works in Xcode13 but does not work for archiving on 12.5.
If you change the import to be `FBSDK` prefixed, you can still reference all of the symbols you need when using 12.5.
Additionally this changeset fixes the need to explicitly include `FacebookAEM` and `FacebookBasics` in your project.
Reviewed By: jawwad
Differential Revision: D31840198
fbshipit-source-id: 145a904c1408cb8fda3123db185d161485c4607c
Summary: In ObjC it's easy to provide convenience initializers that do not call a designated initializer. This is a step towards making it more difficult to bypass required initializers by making `new` and `init` unavailable when there are convenience init or factory methods / singletons available.
Reviewed By: samodom
Differential Revision: D31731483
fbshipit-source-id: efb9c7470f5a66aab0f9703865a307fb2a937734
Summary:
Version bump for 12.0.1 to release a fix for Share Dialog not presenting for SDK 12.0.0
https://github.com/facebook/facebook-ios-sdk/issues/1909
Updated changelog
Reviewed By: samodom
Differential Revision: D31688308
fbshipit-source-id: 7038a111714def6d636ddf7babb194107771ea7e
Summary: The file in use is FBSDKGamingServicesKit/FacebookGamingServices/Internal/CustomUpdateContentMedia.swift
Reviewed By: samodom
Differential Revision: D31549002
fbshipit-source-id: d53367b81d68f3694dd7117bad592306252db15f
Summary: The one in use is FBSDKGamingServicesKit/FacebookGamingServices/Internal/CustomUpdateContentImage.swift
Reviewed By: samodom
Differential Revision: D31548913
fbshipit-source-id: 07aff7fd8d4b9369205430753a207988eeb8bc68
Summary:
I searched for any methods that "return nil" and added the nullable annotation to them.
Most of these ended up being private methods just used in the .m file but its nice to have these annotated as well.
Only the following 3 headers had 3 initializers (one in each file) that should have been annotated as nullable. From this it looks like Xcode and the analyzer are fairly reliable in catching what methods should return nullable in header files. Not sure why it didn't know about these.
```
FBSDKCoreKit/FBSDKCoreKit/AppEvents/Internal/Integrity/FBSDKRestrictiveData.h
FBSDKLoginKit/FBSDKLoginKit/Internal/FBSDKLoginManagerLogger.h
FBSDKShareKit/FBSDKShareKit/Internal/FBSDKLikeActionController.h
```
Edit: There 2 more tvOS related headers
```
FBSDKCoreKit/FBSDKCoreKit/Internal/Device/FBSDKDeviceButton+Internal.h
FBSDKCoreKit/FBSDKCoreKit/include/FBSDKDeviceButton.h
```
Reviewed By: samodom
Differential Revision: D31496694
fbshipit-source-id: a1fe15c53c17469ac9c2458259cf5a21efcd150d
Summary:
While working on some other stuff I noticed that we had some whitespace only lines. Ran 2 commands to do a one time cleanup.
Removed whitespace only lines with:
git ls-files -z '*.h' '*.m' '*.swift' | xargs -0 perl -0777 -pi -e 's/\s*$/\n/'
Removed extra trailing newlines in the file with:
git ls-files -z '*.h' '*.m' '*.swift' | xargs -0 perl -0777 -pi -e 's/\s*$/\n/'
Reviewed By: jamestouri
Differential Revision: D31514435
fbshipit-source-id: fc67cbd6a4104815993cf8a524dc904d47760e21
Summary: D31492140 (f9ada40dec) got unlanded due to missing objects that were supposed to be unwrapped. This is reimplementing the annotations and adding the unwrapping
Reviewed By: samodom
Differential Revision: D31515004
fbshipit-source-id: 78b33cea081bdd7bfc73ac2fedd9cbda2161ff24
Summary:
Deleted:
Sources/FacebookGamingServices/InternalUtility+WindowFinding.swift
The version in use is:
FBSDKGamingServicesKit/FacebookGamingServices/InternalUtility+WindowFinding.swift
Note: A diff showed no differences in the files
Reviewed By: samodom
Differential Revision: D31460365
fbshipit-source-id: 48ae45ba1174bde2af2ac3c0a69aeb6db917c4bf
Summary: The one being used is FBSDKGamingServicesKit/FacebookGamingServices/Internal/SwitchContextDialogMaking.swift
Reviewed By: samodom
Differential Revision: D31460801
fbshipit-source-id: 4d260a682c8a805cf193a0e0483b85c9587a59ef
Summary:
Since we generally only add `NS_ASSUME_NONNULL_BEGIN` and `NS_ASSUME_NONNULL_END` to our header files, our implementations files don't get the nullable annotations that were added.
This script will overwrite method signatures in the .m files from the method signature in the .h files
Reviewed By: jamestouri
Differential Revision: D31365815
fbshipit-source-id: 4c0a1d27c247834107fd26def3e8cadce374dc5f
Summary: This was previously reverted due to having the commit for copying Basics to AudienceNetwork reverted. That copy commit is now re-committed so these changes should be safe to apply again.
Reviewed By: jawwad
Differential Revision: D31339463
fbshipit-source-id: 9a651ff3648a87db57e373e5d14125536fab705a
Summary:
It feels cleaner this way.
Ran this command:
```
git ls-files '*.h' '*.m' | xargs perl -0777 -pi -e 's/#if DEBUG\n #if FBTEST(.*) #endif\n#endif/#if DEBUG && FBTEST\1#endif/s'
```
(The -0777 means treat the file as one big line of text instead of processing line by line and the "/s" modifier means that .* should match over newlines)
Differential Revision: D31251198
fbshipit-source-id: 0cce6948024efc65ffee29826b48cf8107b106fc
Summary:
The `respondsToSelector` *dance* doesn't need to be done because of the `if (available(iOS 13.0, *)) {` check.
In fact, if its removed, it correctly shows an error: `'isMacCatalystApp' is only available on iOS 13.0 or newer`
Reviewed By: wx0165927473
Differential Revision: D31260380
fbshipit-source-id: 447ccabeafa420e7dfc04a439ec91bfd93b50ff3