Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fodboldbane #2530

Draft
wants to merge 19 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 26 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,43 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm

## Unreleased

[Full Changelog](https://github.com/facebook/facebook-ios-sdk/compare/v12.2.1...HEAD)

## 12.2.1

### Fixed

- Duplicate symbol error when using Swift Package Manager with the `ObjC` linker flag (issue #1972)
- Issue using SPM for tvOS projects (issue #1936)

[2021-12-08](https://github.com/facebook/facebook-ios-sdk/releases/tag/v12.2.1) |
[Full Changelog](https://github.com/facebook/facebook-ios-sdk/compare/v12.2.0...v12.2.1)

## 12.2.0

Note: There is a known issue with using the `ObjC` linker flag with this version. We are working on a patch fix. If you rely on the `ObjC` linker flag, you will want to wait for the patch fix before upgrading.

### Updated

- Starting with v12.2.0 apps no longer need to embed numerous custom URL schemes in `LSApplicationQueriesSchemes` for their `Info.plist`. Only the `fbapi` and `fb-messenger-share-api` custom URL schemes are needed. With the change to iOS 15 that limits `LSApplicationQueriesSchemes` to 50 schemes, this should relieve some pressure that apps may face when running up against this limit. As part of this change the following symbols are deprecated:
- `URLScheme.facebookApp`
- `URLScheme.facebookShareExtension`
- `URLScheme.masqueradePlayer`

### Fixed

- Fixed NSKeyedUnarchiver validateAllowedClass Warnings in Xcode Console. Fixes #1941 and #1930
- An implementation bug in `ApplicationDelegate` where added application observers were notified twice for `application:didFinishLaunchingWithOptions:`.
The return type of `ApplicationDelegate.application:didFinishLaunchingWithOptions:` was also incorrectly stated as, "YES if the url was intended for the Facebook SDK, NO if not". In actuality, the method returns whether there are any application observers that themselves return true from calling their implementation of `application:didFinishLaunchingWithOptions:`.
This fix means that application observers will now only be notified once per app launch, however, if `ApplicationDelegate.application:didFinishLaunchingWithOptions:` is called after calling `ApplicationDelegate.initializeSDK` then the return type will always be false regardless of any application observers.
- Using share dialogs via share sheet mode fails to show the dialog (Issue #1938)
- Fixed: aem_conversion_configs should contain an explicit "fields" parameter (Issue #1933)

### Deprecated
- The class-based interface of `AppEvents` has been deprecated. Please use the instance properties and methods on `AppEvents.shared` instead.

[Full Changelog](https://github.com/facebook/facebook-ios-sdk/compare/v12.1.0...HEAD)
[2021-12-01](https://github.com/facebook/facebook-ios-sdk/releases/tag/v12.2.0) |
[Full Changelog](https://github.com/facebook/facebook-ios-sdk/compare/v12.1.0...v12.2.0)

## 12.1.0

Expand Down
2 changes: 1 addition & 1 deletion Configurations/Version.xcconfig
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@
// LICENSE file in the root directory of this source tree.

// The versions for FBSDK and Messenger SDK.
FBSDK_PROJECT_VERSION=12.1.0
FBSDK_PROJECT_VERSION=12.2.1
MNSDK_PROJECT_VERSION=TODO_SUPPORT_MNSDK

4 changes: 2 additions & 2 deletions FBAEMKit.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
Pod::Spec.new do |s|

s.name = 'FBAEMKit'
s.version = '12.1.0'
s.version = '12.2.1'
s.summary = 'The kernal module for Facebook AEM solution'

s.description = <<-DESC
Expand Down Expand Up @@ -47,7 +47,7 @@ Pod::Spec.new do |s|

s.source = {
http: "https://github.com/facebook/facebook-ios-sdk/releases/download/v#{s.version}/FacebookSDK_Dynamic.xcframework.zip",
sha1: '900beb35f7cbab2f2a83c1ac51fc2584182a99b9'
sha1: '598ba9eb4ab2a6103d4603dfbff41a25429cc285'
}
s.vendored_frameworks = 'XCFrameworks/FBAEMKit.xcframework'
s.dependency 'FBSDKCoreKit_Basics', "#{s.version}"
Expand Down
17 changes: 17 additions & 0 deletions FBAEMKit/Configurations/FBAEMKit-tvOS-Dynamic.xcconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
// Copyright (c) Facebook, Inc. and its affiliates.
// All rights reserved.
//
// This source code is licensed under the license found in the
// LICENSE file in the root directory of this source tree.

#include "Shared/Platform/tvOS.xcconfig"
#include "Shared/Target/DynamicFramework.xcconfig"
#include "Shared/Version.xcconfig"

PRODUCT_NAME = FBAEMKit
PRODUCT_BUNDLE_IDENTIFIER = com.facebook.sdk.FBAEMKit

CURRENT_PROJECT_VERSION = $(FBSDK_PROJECT_VERSION)

INFOPLIST_FILE = $(SRCROOT)/FBAEMKit/Info.plist
MODULEMAP_FILE = $(SRCROOT)/FBAEMKit/FBAEMKit.modulemap
17 changes: 17 additions & 0 deletions FBAEMKit/Configurations/FBAEMKit-tvOS-Static.xcconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
// Copyright (c) Facebook, Inc. and its affiliates.
// All rights reserved.
//
// This source code is licensed under the license found in the
// LICENSE file in the root directory of this source tree.

#include "Shared/Platform/tvOS.xcconfig"
#include "Shared/Target/StaticFramework.xcconfig"
#include "Shared/Version.xcconfig"

PRODUCT_NAME = FBAEMKit
PRODUCT_BUNDLE_IDENTIFIER = com.facebook.sdk.FBAEMKit

CURRENT_PROJECT_VERSION = $(FBSDK_PROJECT_VERSION)

INFOPLIST_FILE = $(SRCROOT)/FBAEMKit/Info.plist
MODULEMAP_FILE = $(SRCROOT)/FBAEMKit/FBAEMKit.modulemap
23 changes: 23 additions & 0 deletions FBAEMKit/FBAEMKitTests/FBAEMInvocationTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -289,6 +289,27 @@ class FBAEMInvocationTests: XCTestCase { // swiftlint:disable:this type_body_len
)
}

func testProcessedParametersWithValidContentAndContentID() {
let invocation: AEMInvocation? = self.validInvocation
let content: [String: AnyHashable] = ["id": "123", "quantity": 5]
let contentIDs: [String] = ["id123", "id456"]

let parameters = invocation?.processedParameters([
Keys.content: "[{\"id\":\"123\",\"quantity\":5}]",
Keys.contentID: "[\"id123\", \"id456\"]",
Keys.contentType: "product"
]) as? [String: AnyHashable]
XCTAssertEqual(
parameters,
[
Keys.content: [content],
Keys.contentID: contentIDs,
Keys.contentType: "product"
],
"Processed parameters are not expected"
)
}

func testProcessedParametersWithValidContent() {
let invocation: AEMInvocation? = self.validInvocation
let content: [String: AnyHashable] = ["id": "123", "quantity": 5]
Expand Down Expand Up @@ -485,6 +506,8 @@ class FBAEMInvocationTests: XCTestCase { // swiftlint:disable:this type_body_len

configList = invocation._getConfigList(Values.brandMode, configs: configs)
XCTAssertEqual(configList.count, 2, "Should only find the brand or cpas config")
XCTAssertEqual(configList.first?.configMode, Values.cpasMode, "Should have the caps config first")
XCTAssertEqual(configList.last?.configMode, Values.brandMode, "Should have the brand config last")
}

func testAttributeEventWithValue() {
Expand Down
3 changes: 2 additions & 1 deletion FBAEMKit/FBAEMKitTests/FBAEMReporter+Testing.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ typedef void (^FBAEMReporterBlock)(NSError *_Nullable);
@property (class, nonatomic) NSMutableArray<FBAEMReporterBlock> *completionBlocks;
@property (class, nonatomic) NSString *reportFilePath;
@property (class, nullable, nonatomic) id<FBAEMNetworking> networker;
@property (class, nullable, nonatomic) id<FBAEMNetworking> catalogNetworker;
@property (class, nullable, nonatomic) id<FBSKAdNetworkReporting> reporter;

+ (void)enable;
Expand Down Expand Up @@ -79,6 +78,8 @@ typedef void (^FBAEMReporterBlock)(NSError *_Nullable);

+ (void)_clearCache;

+ (void)_clearConfigs;

+ (void)reset;

@end
Expand Down
40 changes: 31 additions & 9 deletions FBAEMKit/FBAEMKitTests/FBAEMReporterTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ class FBAEMReporterTests: XCTestCase {
static let businessID = "advertiser_id"
static let campaignID = "campaign_id"
static let catalogID = "catalog_id"
static let contentID = "fb_content_id"
static let contentID = "fb_content_ids"
static let token = "token"
}

Expand All @@ -36,6 +36,7 @@ class FBAEMReporterTests: XCTestCase {
static let donate = "Donate"
static let defaultMode = "DEFAULT"
static let brandMode = "BRAND"
static let cpasMode = "CPAS"
static let USD = "USD"
}

Expand Down Expand Up @@ -86,7 +87,6 @@ class FBAEMReporterTests: XCTestCase {
AEMReporter.enable()

XCTAssertTrue(AEMReporter.isEnabled, "AEM Report should be enabled")
XCTAssertNotNil(AEMReporter.catalogNetworker, "AEM catalog networker should be created when AEM is enabled")
}

func testCatalogReportDefaultConfigure() {
Expand All @@ -101,10 +101,6 @@ class FBAEMReporterTests: XCTestCase {
}

func testConfigure() {
XCTAssertNil(
AEMReporter.catalogNetworker,
"Should not configure catalog networker before enable"
)
XCTAssertEqual(
networker,
AEMReporter.networker as? TestAEMNetworker,
Expand Down Expand Up @@ -243,6 +239,34 @@ class FBAEMReporterTests: XCTestCase {
XCTAssertEqual(configList?[1].validFrom, 20000, "Should keep the expected config")
}

func testClearConfigs() {
AEMReporter.configs = [
Values.defaultMode: NSMutableArray(array: [SampleAEMConfigurations.createConfigWithoutBusinessID()]),
Values.brandMode: NSMutableArray(array: [SampleAEMConfigurations.createConfigWithBusinessIDAndContentRule()]),
Values.cpasMode: NSMutableArray(array: [SampleAEMConfigurations.createCpasConfig()])
]

AEMReporter._clearConfigs()
let defaultConfigs = AEMReporter.configs[Values.defaultMode] as? [AEMConfiguration]
let brandConfigs = AEMReporter.configs[Values.brandMode] as? [AEMConfiguration]
let cpasConfigs = AEMReporter.configs[Values.cpasMode] as? [AEMConfiguration]
XCTAssertEqual(
defaultConfigs?.count,
1,
"Should have default mode config"
)
XCTAssertEqual(
brandConfigs?.count,
0,
"Should not have brand mode config"
)
XCTAssertEqual(
cpasConfigs?.count,
0,
"Should not have cpas mode config"
)
}

func testHandleURL() throws {
let url = try XCTUnwrap(
URL(string: "fb123://test.com?al_applink_data=%7B%22acs_token%22%3A+%22test_token_1234567%22%2C+%22campaign_ids%22%3A+%22test_campaign_1234%22%7D"),
Expand Down Expand Up @@ -853,14 +877,13 @@ class FBAEMReporterTests: XCTestCase {

func testLoadCatalogOptimizationWithOptimizedContent() {
let invocation = SampleAEMInvocations.createCatalogOptimizedInvocation()
AEMReporter.catalogNetworker = self.networker
var blockCall = 0

AEMReporter._loadCatalogOptimization(with: invocation, contentID: "test_content_id") {
blockCall += 1
}
XCTAssertTrue(
(self.networker.capturedGraphPath?.contains("da_content_id_belongs_to_catalog_id")) == true,
(self.networker.capturedGraphPath?.contains("aem_conversion_filter")) == true,
"Should start the catalog request"
)
self.networker.capturedCompletionHandler?(nil, SampleAEMError())
Expand All @@ -873,7 +896,6 @@ class FBAEMReporterTests: XCTestCase {

func testLoadCatalogOptimizationWithFuzzyInput() {
let invocation = SampleAEMInvocations.createCatalogOptimizedInvocation()
AEMReporter.catalogNetworker = self.networker

AEMReporter._loadCatalogOptimization(with: invocation, contentID: "test_content_id") {}
for _ in 0..<100 {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ enum SampleAEMConfigurations {
static let addToCart = "fb_mobile_add_to_cart"
static let donate = "Donate"
static let defaultMode = "DEFAULT"
static let brandMode = "BRAND"
static let cpasMode = "CPAS"
static let USD = "USD"
}
Expand Down Expand Up @@ -139,7 +140,7 @@ enum SampleAEMConfigurations {
Keys.defaultCurrency: Values.USD,
Keys.cutoffTime: 1,
Keys.validFrom: 10000,
Keys.configMode: Values.defaultMode,
Keys.configMode: Values.brandMode,
Keys.businessID: "test_advertiserid_content_test",
Keys.paramRule: "{\"or\":[{\"fb_content[*].id\":{\"eq\":\"abc\"}}]}",
Keys.conversionValueRules: [
Expand Down
53 changes: 53 additions & 0 deletions FBAEMKit/project.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,51 @@ targets:
preBuildScripts:
- name: Run Swiftlint
script: ../scripts/build_phase_swiftlint.sh
FBAEMKit_TV-Static:
type: framework
platform: tvOS
productName: FBAEMKit
sources:
- path: ../Sources/FBAEMKit
headerVisibility: project
excludes:
- include
- path: ../Sources/FBAEMKit/include
headerVisibility: public
dependencies:
- target: FBSDKCoreKit_Basics/FBSDKCoreKit_Basics_TV-Static
link: false
configFiles:
Debug: Configurations/FBAEMKit-tvOS-Static.xcconfig
Release: Configurations/FBAEMKit-tvOS-Static.xcconfig
preBuildScripts:
- name: Run Swiftlint
script: ../scripts/build_phase_swiftlint.sh
settings:
GCC_PREFIX_HEADER: ../Sources/FBAEMKit/FBAEMKit-Prefix-Header.h
FBAEMKit_TV-Dynamic:
type: framework
platform: tvOS
productName: FBAEMKit
sources:
- path: ../Sources/FBAEMKit
headerVisibility: project
excludes:
- include
- path: ../Sources/FBAEMKit/include
headerVisibility: public
dependencies:
- target: FBSDKCoreKit_Basics/FBSDKCoreKit_Basics_TV-Dynamic
- sdk: UIKit.framework
- sdk: libz.tbd
configFiles:
Debug: Configurations/FBAEMKit-tvOS-Dynamic.xcconfig
Release: Configurations/FBAEMKit-tvOS-Dynamic.xcconfig
settings:
GCC_PREFIX_HEADER: ../Sources/FBAEMKit/FBAEMKit-Prefix-Header.h
preBuildScripts:
- name: Run Swiftlint
script: ../scripts/build_phase_swiftlint.sh
FBAEMKitTests:
type: bundle.unit-test
platform: iOS
Expand All @@ -91,3 +136,11 @@ schemes:
targets: [FBAEMKitTests]
coverageTargets:
- FBAEMKit-Dynamic
FBAEMKit_TV-Static:
build:
targets:
FBAEMKit_TV-Static: all
FBAEMKit_TV-Dynamic:
build:
targets:
FBAEMKit_TV-Dynamic: all
4 changes: 2 additions & 2 deletions FBSDKCoreKit.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
Pod::Spec.new do |s|

s.name = 'FBSDKCoreKit'
s.version = '12.1.0'
s.version = '12.2.1'
s.summary = 'Official Facebook SDK for iOS to access Facebook Platform core features'

s.description = <<-DESC
Expand Down Expand Up @@ -50,7 +50,7 @@ Pod::Spec.new do |s|

s.source = {
http: "https://github.com/facebook/facebook-ios-sdk/releases/download/v#{s.version}/FacebookSDK_Dynamic.xcframework.zip",
sha1: '900beb35f7cbab2f2a83c1ac51fc2584182a99b9'
sha1: '598ba9eb4ab2a6103d4603dfbff41a25429cc285'
}
s.vendored_frameworks = 'XCFrameworks/FBSDKCoreKit.xcframework'
s.dependency 'FBSDKCoreKit_Basics', "#{s.version}"
Expand Down
Loading