2385 Commits

Author SHA1 Message Date
Ryan Tobin
e347ccea13 Bump SDK Version to 17.0.0
Summary: Bump SDK Version to 17.0.0

Reviewed By: jjiang10

Differential Revision: D53864621

fbshipit-source-id: 218006151196c7d2a4432e0ddd28a4e982b6aca3
2024-02-16 12:21:28 -08:00
Ryan Tobin
3183c7eca8 Added Privacy Manifests
Summary: Added Privacy Manifests

Reviewed By: jjiang10

Differential Revision: D53290629

fbshipit-source-id: c018ebad092402de1015f93ec2051bc70dfce4ee
2024-02-13 18:31:44 -08:00
Ryan Tobin
469554dbae Fix Build Warning
Summary: There was an XCode build warning because the feature list in the ```_FeatureManager``` was not exhaustive. This diff fixes it.

Reviewed By: xta0

Differential Revision: D53289237

fbshipit-source-id: ccf6da5646b8580a95640dc180072bee2fec6abd
2024-01-31 15:53:48 -08:00
Xinzhu Cai
6af38aaf30 Bump SDK version to 16.4.0
Summary: As title

Reviewed By: KylinChang

Differential Revision: D53284965

fbshipit-source-id: 1bc3e3eae60f2f9d052a59548c795f897e8c9f15
2024-01-31 14:29:14 -08:00
Zilin Zhang
272bff5cd6 Fix duplicate install issue
Summary:
There exists a potential issue that duplicate install can be sent because `applicationDidBecomeActive` may be triggered multiple times within a very short time (e.g. App Launch and ATT prompt can trigger this function) and thus cause  `publichInstall` is triggered multiple times.

In order to fix this issue, this diff reuses the existing key `lastAttributionPingString` and `lastInstallResponseKey`. The flow will be
1. PublishInstall is triggered
2. Check if `lastAttributionPingString` exists and will send install event and set the key if the key doesn't exist. We do nothing if the key exists.
3. If the install event is sent successfully, we will set the key `lastInstallResponseKey`. If not, we'll remove the key `lastAttributionPingString`.
4. When app terminates, we'll check if `lastInstallResponseKey` exists to check if the install event is sent successfully. If the key exists, we'll do nothing. If the key doesn't exist, it means the install event is not sent successfully in the app launch and we'll remove the key `lastAttributionPingString`.

Reviewed By: jjiang10

Differential Revision: D53170017

fbshipit-source-id: 340e21188d884088215a65d06fffc402065a5102
2024-01-29 11:56:16 -08:00
Ryan Tobin
2dc3ba59a4 Implement Prohibited App Blocking
Summary:
There are certain 3P apps that are in prohibited categories. For these apps, the server-side currently blocks any incoming signals, but we want to also enforce this blocking on the client-side. In order to do this, we need to use a flag sent from the server-side on the client-side to enable the client to block events from apps that are in prohibited categories (i.e. when this flag is true). This is accomplished by extending the [MobileSdkAppEventsKillSwitchGk](https://www.internalfb.com/code/www/flib/platform/graph/resources/application/mobile_sdk/MobileSdkAppEventsKillSwitchGk.php), which is passed as the ```app_events_killswitch``` flag to the client. More information can be seen [here](https://docs.google.com/document/d/1EYy0vZ-v6q1QDGEDj_N2is6QbX4eDPodI1lYz6W8GEU/), [here](https://docs.google.com/document/d/1MCPIESOxtgTuUJC78DdLeOA8Jv4qiDaWV1NxHzGO34k/), and [here](https://docs.google.com/document/d/1svBR6jklbb6M-lhgh3qj7XyaEchJDn1YXint2ZYU_Fk/).

We already use the ```app_events_killswitch``` flag to block the sending of post-install events. This diff extends the result of the ```app_events_killswitch``` flag to also block install events so that all events are blocked for apps that are in prohibited categories.

Reviewed By: Nathaaaalie

Differential Revision: D51290686

fbshipit-source-id: 573df6453fa705a5290eb9cbef988715ace26034
2023-12-14 15:48:14 -08:00
Ryan Tobin
066eb6323b Implement and Enable Redacted Events Manager
Summary: There are certain events that are "sensitive" that violate our terms that are transmitted from 3P clients to Meta. We want to redact these event names from ever being sent from the client-side. In order to do this, we need to retrieve a list of these "redacted" events from the server-side and build the ```RedactedEventsManager``` to process and redact these events. More information can be seen [here](https://docs.google.com/document/d/1EYy0vZ-v6q1QDGEDj_N2is6QbX4eDPodI1lYz6W8GEU/), [here](https://docs.google.com/document/d/1OcrMzjYloBgFmNRgiJ3C_beMtuKxbEr8KII0YWya8Pw/), and [here](https://docs.google.com/document/d/1OhJ-LSX0fl8WJJlbs17ka3wleUQmUDchmdbmfLUXD0w/). This diff implements and enables the ```RedactedEventsManager```.

Reviewed By: Nathaaaalie

Differential Revision: D51214260

fbshipit-source-id: 7c4111be7aa26acf046b1227d0204f49ccc0fb9f
2023-12-14 15:48:12 -08:00
Ryan Tobin
75e965ef15 Setup Redacted Events Feature
Summary:
There are certain events that are "sensitive" that violate our terms that are transmitted from 3P clients to Meta. We want to redact these event names from ever being sent from the client-side. In order to do this, we need to retrieve a list of these "redacted" events from the server-side and build the ```RedactedEventsManager``` to process and redact these events. More information can be seen [here](https://docs.google.com/document/d/1EYy0vZ-v6q1QDGEDj_N2is6QbX4eDPodI1lYz6W8GEU/), [here](https://docs.google.com/document/d/1OcrMzjYloBgFmNRgiJ3C_beMtuKxbEr8KII0YWya8Pw/), and [here](https://docs.google.com/document/d/1OhJ-LSX0fl8WJJlbs17ka3wleUQmUDchmdbmfLUXD0w/). This diff lays the foundation for this feature by creating the ```RedactedEventsManager``` class and adding the ```FBSDKFeatureFilterRedactedEvents``` feature.

The next diff will actually implement and enable the ```RedactedEventsManager```.

Reviewed By: sway-git

Differential Revision: D51177934

fbshipit-source-id: 161ee1fa7a2c5e3e28e695ba60314a05e9abafdd
2023-12-14 15:48:10 -08:00
Ryan Tobin
51d99d56c7 Implement and Enable Blocklist Events
Summary: There are certain events that are "unused" and "unwanted" that are transmitted from 3P clients to Meta. We want to block these events from ever being sent from the client-side. In order to do this, we need to retrieve a list of these "blocklisted" events from the server-side and build the ```BlocklistEventsManager``` to process and block these events. More information can be seen [here](https://docs.google.com/document/d/1EYy0vZ-v6q1QDGEDj_N2is6QbX4eDPodI1lYz6W8GEU/), [here](https://docs.google.com/document/d/1OcrMzjYloBgFmNRgiJ3C_beMtuKxbEr8KII0YWya8Pw/), and [here](https://docs.google.com/document/d/1kYBDdyPcCr99-B_mtubcwhVlStBW8N_E-9HDBfknka4/). This diff implements and enables the ```BlocklistEventsManager```.

Reviewed By: sway-git

Differential Revision: D51137667

fbshipit-source-id: 725d71ec2af1c8ad481a0ce3a7f7f95c0896e125
2023-12-14 15:48:07 -08:00
Ryan Tobin
49dae24b5b Setup Blocklist Events Feature
Summary:
There are certain events that are "unused" and "unwanted" that are transmitted from 3P clients to Meta. We want to block these events from ever being sent from the client-side. In order to do this, we need to retrieve a list of these "blocklisted" events from the server-side and build the ```BlocklistEventsManager``` to process and block these events. More information can be seen [here](https://docs.google.com/document/d/1EYy0vZ-v6q1QDGEDj_N2is6QbX4eDPodI1lYz6W8GEU/), [here](https://docs.google.com/document/d/1OcrMzjYloBgFmNRgiJ3C_beMtuKxbEr8KII0YWya8Pw/), and [here](https://docs.google.com/document/d/1kYBDdyPcCr99-B_mtubcwhVlStBW8N_E-9HDBfknka4/). This diff lays the foundation for this feature by creating the ```BlocklistEventsManager``` class and adding the ```FBSDKFeatureBlocklistEvents``` feature.

The next diff will actually implement and enable the ```BlocklistEventsManager```.

Reviewed By: sway-git, Nathaaaalie

Differential Revision: D51099373

fbshipit-source-id: 16c57d80ba34ea2d5fcb90b4547c04685c0016fb
2023-12-14 15:48:05 -08:00
Zilin Zhang
e781cc8ca4 Bump SDK version to v16.3.1
Summary: $title

Differential Revision: D51951590

fbshipit-source-id: 5d7f0c2fbc52e83baf8862417e2ee4f42efc3357
2023-12-07 11:40:00 -08:00
Tao Xu
a42e8700d7 Fix the broken tests for SKAN v2
Summary:
- Fix the broken tests on master.
- The DateComponents takes daylight saving time into account, so when you ask to subtract 35 days, it doesn't subtract exactly 35×24×60×60 seconds. Instead, it goes back 35 calendar days, which due to daylight saving time changes, can result in a slightly different number of total seconds.

Differential Revision: D51377252

fbshipit-source-id: ec579ee3890988ac3dc564c095f5ae4f71134519
2023-11-15 16:08:01 -08:00
Tao Xu
4de7da5ea6 Add unit tests to test reading from server-side flags
Summary: Since we already have a bunch of test cases covering this case, this diff simply added a few cases for checking server-side values.

Differential Revision: D51152076

fbshipit-source-id: be70fcab3f2bb5c11deb0146d743dcfa262533af
2023-11-15 14:25:11 -08:00
Tao Xu
324571d268 Add the client-side decision tree
Summary:
- The SDK decision tree can be found at https://docs.google.com/document/d/10Gftcn5wqtegaEPh0LgOkarb4T0jvE_iZKEiUpVu4nU/edit
- Unit tests will be added in the next diff

Reviewed By: dreamolight

Differential Revision: D51140801

fbshipit-source-id: 0883ac19b5a35efb1a97f34cdc7cc7fb38487749
2023-11-15 14:25:08 -08:00
Tao Xu
d18a1db850 Rename the current isAutoLogAppEventsEnabled to isAutoLogAppEventsEnabledOnClientSide
Summary: Introduce a new internal client side only flag during the transition. The original `isAutoLogAppEventsEnabled` will be delegated to `isAutoLogAppEventsEnabledOnClientSide`. In the next diff, we will be adding new getter and setter for the `isAutoLogAppEventsEnabled` flag.

Reviewed By: dreamolight

Differential Revision: D51330511

fbshipit-source-id: cd63649372861fcdf9d06e0ecd60acae3753490f
2023-11-15 14:25:06 -08:00
Tao Xu
5c38779876 Fix setPersistedBooleanProperty
Summary: WE should update the var in memory in setters. This line was somehow overlooked.

Reviewed By: dreamolight

Differential Revision: D51333425

fbshipit-source-id: cdf8bd5f0d97fe5a2b900c2d1ce0e198c65636c9
2023-11-15 14:25:03 -08:00
Tao Xu
fbb60846ad Introduce two boolean flags to control the auto logging behavior
Summary:
Introduce two new server-side flags:
- sdk_auto_logging_default_value
- sdk_auto_logging_override_value

SDK parses and stores these flags in the configuration object.

Reviewed By: dreamolight

Differential Revision: D51100780

fbshipit-source-id: 7e2448070b3ab66f86f708ba159c5c7c77aca607
2023-11-15 14:25:01 -08:00
Jacky Jiang
4ab50ea9e9 Bump v16.2.1
Summary: $title

Reviewed By: wx0165927473

Differential Revision: D50246456

fbshipit-source-id: 73fdffc085bf9807bafefecd0cd1725b7c992344
2023-10-13 09:39:10 -07:00
Zilin Zhang
de74c60d26 Fix Build issue in XCode 14
Summary: Fix backward compatibility for building the URL API for Xcode 14. In OC, we use __IPHONE_OS_VERSION_MAX_ALLOWED to check the iOS 17 SDK. In Swift, we use `#if swift(>=5.9)` to check the iOS 17 SDK (swift compiler is 5.9 in XCode 15)

Reviewed By: sway-git, xta0

Differential Revision: D49626160

fbshipit-source-id: c702fb4208634720e78ed549ae6cd647f0f6e464
2023-09-25 22:10:42 -07:00
Zilin Zhang
51ae3301ba Bump v16.2.0
Summary: Bump version v16.2.0

Reviewed By: wx0165927473

Differential Revision: D49530478

fbshipit-source-id: ea7edc5fe65e130a691ed9647caf60383b5f8c1d
2023-09-22 11:45:50 -07:00
Ryan Tobin
0f418b344e Fixing unit tests for Xcode 15 / iOS 17 - main branch
Summary: See D49337946

Reviewed By: wx0165927473, KylinChang

Differential Revision: D49466622

fbshipit-source-id: efa11a73a368a0bc373d618f09c0e533e74163c2
2023-09-20 12:50:30 -07:00
Xin Wu
31facd640b update SKAN API
Summary: To avoid using deprecated API, updated to latest one

Reviewed By: KylinChang

Differential Revision: D49296481

fbshipit-source-id: 8051fe1f5cf6f3972b3127db6ec3d2132a28d052
2023-09-14 22:36:37 -07:00
Xin Wu
765823bd4b fix skan reporting logic
Summary:
In theory, we should remove checkAndRevokeTimer since we don’t need to extend skan report window

However, to play it safe, we did:
1. For SKAdNetworkReporter only include v3, we bought back the original logic
2. For SKAdNetworkReporterV2 include v4, we removed extending report window

Reviewed By: KylinChang

Differential Revision: D49296300

fbshipit-source-id: 5df17751a585d4cf3c1f4d5ec694b4a3e86dad90
2023-09-14 22:36:34 -07:00
Xin Wu
361f27efe0 connect v2 reporter
Summary:
In this diff:
1. Add `FBSDKSKAdNetworkReporterV2` crash sheild
2. Add `FBSDKFeatureSKAdNetworkV4` feature flag,  corresponding GK is `mobile_sdk_skadnetwork_v4`
3. Hook up logic for `SKAdNetworkReporter` and `SKAdNetworkReporterV2`
4. Intentionally didn't change AEM since it's deprecated

Reviewed By: dreamolight

Differential Revision: D48942596

fbshipit-source-id: bf12e35e5361e8a414ed96d6dfbb756c601a64e6
2023-09-08 16:39:22 -07:00
Xin Wu
1c776c7992 seprate v4 logic
Summary:
in order to release v4 on time and make sure there is no issue, we seprate SKAN report logic into two different classes and wrap up with a GK

FBSDKSKAdNetworkReporter
- previous SKAN report logic, no v4, only update the API to prevent CV0 reset issue

FBSDKSKAdNetworkReporterv2
- v4 logic including coarse value, 2nd/3rd postback

Will add feature GK in next diff

Reviewed By: KylinChang

Differential Revision: D48933610

fbshipit-source-id: 9420a0b8dabd1747258f3b87733e5b3f5f9fe985
2023-09-06 15:33:44 -07:00
Xin Wu
ccc21eeb27 fix skan config request
Summary: as title

Differential Revision: D48928277

fbshipit-source-id: 4de92e26af36debff4a1f104915070f9cbd7c71f
2023-09-05 10:09:22 -07:00
Jacky Jiang
e1de3f69a4 @new-branch: devTest
Summary: as title, the param is optional

Reviewed By: wx0165927473

Differential Revision: D48711246

fbshipit-source-id: 2218c69156c18144811b5682bf8d6636e5c6174a
2023-08-31 16:17:20 -07:00
Xin Wu
41044df838 add os version paramwhen fetching config
Summary: as title, the param is optional

Reviewed By: KylinChang

Differential Revision: D48152979

fbshipit-source-id: eba091b769a9249c8c4b95f88c08f1af0b31ceb8
2023-08-14 14:19:13 -07:00
Xin Wu
96dd7098d8 update report install logic
Summary: Since v4 supports decrementing CV, we need to make sure we only report install for the first time app launch

Reviewed By: KylinChang

Differential Revision: D48086213

fbshipit-source-id: 3db468baa1590227ba5ed5fc1a51a0dfb5628ba5
2023-08-07 15:07:17 -07:00
Xin Wu
2f564854af add more unit tests
Summary: as title, more unit tests -> better

Reviewed By: KylinChang

Differential Revision: D47825598

fbshipit-source-id: 616d12efffce53b7017cb3bb7c8e7cabc39c933d
2023-07-28 11:05:33 -07:00
Xin Wu
36444beb7f update cutoff logic
Summary: we should only check cutoff and do it for the 1st postback once we move to v4.

Reviewed By: KylinChang

Differential Revision: D47818971

fbshipit-source-id: 44a53ff000035125a2d0de2edcd121d9caf2ea6f
2023-07-28 11:05:30 -07:00
Xin Wu
65d5879f0d add updating coarse CV logic
Summary: as title

Reviewed By: KylinChang

Differential Revision: D47391147

fbshipit-source-id: 89ff52c3109f837533577efe5a649ec744516088
2023-07-28 11:05:28 -07:00
Xin Wu
f1a48d9d2b split event/currency set into fine and coarse CV
Summary: as title, actual updating CV logic in next diffs

Differential Revision: D47318509

fbshipit-source-id: 9a487c92e07104378b9c29f58a0b77b47b3ec36b
2023-07-17 11:32:29 -07:00
Xin Wu
a4664f7119 removed unused fields
Summary:
Since v4 has lock window mechnism, we don’t need previous self defined timer bucket.

This will make code cleaner, more straightforward and easy to matintain,

Differential Revision: D47317756

fbshipit-source-id: 767eb553acf77c1eee593825636226ff6defe16b
2023-07-17 11:32:26 -07:00
Xin Wu
32494b7226 update APIs
Summary: $title

Differential Revision: D47317614

fbshipit-source-id: 63a3866675227ba5a95c1aec79a010c9ac325b1f
2023-07-17 11:32:24 -07:00
Zilin Zhang
75eb55c3c2 Bump v16.1.3
Summary: $title

Reviewed By: amleshjk

Differential Revision: D47358021

fbshipit-source-id: 5d2915db150e9d2e607621ba9402e989ffcf864f
2023-07-11 14:06:16 -07:00
Zilin Zhang
2486c9c60c Add additional operator support
Reviewed By: amleshjk

Differential Revision: D47355305

fbshipit-source-id: 4e13182a3fbbb6e06353b3d0b2eb6373c4e37487
2023-07-11 14:06:13 -07:00
Zilin Zhang
5ae8380dab Add inferred info
Reviewed By: Nathaaaalie

Differential Revision: D47037669

fbshipit-source-id: bde0f0267ac1fb52523b80326aad5c0cf6eb99ce
2023-06-26 17:02:37 -07:00
Zilin Zhang
b5330a66b2 Add MACA processing
Reviewed By: Nathaaaalie

Differential Revision: D46963040

fbshipit-source-id: 0101a52e5bf6c34198f72a64ad786b8eaff290b2
2023-06-25 14:23:23 -07:00
Zilin Zhang
fad6b059fb Bump v16.1.2
Summary: $title

Reviewed By: Nathaaaalie

Differential Revision: D46989050

fbshipit-source-id: 923d36c79dcfdfb62879c307b60726584b0ebd3b
2023-06-23 17:46:43 -07:00
Shawn Zeng
4ac7b68bab Loading protected mode rules from server
Summary:
**In this diff:**
- Added a new query field `FBSDK_SERVER_CONFIGURATION_PROTECTED_MODE_RULES_FIELD` to load the protected mode rules
- Parse and update the `maca_rules` in `MACARulesMatchingManager`

Reviewed By: KylinChang

Differential Revision: D46807450

fbshipit-source-id: 3c4486aab5693bd7ed3872a0e93d0593443149c9
2023-06-23 16:50:27 -07:00
Shawn Zeng
dbacc829d3 Dynamic loading parameters
Summary: Dynamically loading standard parameters list from server. If fail, ball back to the default list

Reviewed By: KylinChang

Differential Revision: D46922765

fbshipit-source-id: c66d1466beb9e6eb1fb4122d664c4c68d82f01f1
2023-06-23 16:51:08 -07:00
Shawn Zeng
8845830fe7 Update Standard Parameters List
Summary: TSIA

Reviewed By: KylinChang

Differential Revision: D46920664

fbshipit-source-id: 6477ba83da59ca67cbc9fa874234f5cfca2f5b7f
2023-06-23 10:03:34 -07:00
Xin Wu
b06c49aead Add coarse config to event/currency set
Summary: $ title

Differential Revision: D46845185

fbshipit-source-id: 3b7e0dbc80cd64d58021ca3270fc8bb69073ea93
2023-06-21 15:47:14 -07:00
Zilin Zhang
622102a128 Add isMatchCCRule
Reviewed By: amleshjk

Differential Revision: D46845532

fbshipit-source-id: f2fcae4da48920b7a874a0d960c86843ed84f89f
2023-06-21 15:30:57 -07:00
Zilin Zhang
6eafa3467a Add CCRuleEngine StringComparison & getKey
Reviewed By: amleshjk

Differential Revision: D46789789

fbshipit-source-id: ab31d733a05b7cfb0b55dd3ddbdcf4632745fa10
2023-06-21 15:30:54 -07:00
Shawn Zeng
324e900bed Set up MACARuleMatchingManager
Summary:
**Context**
As previous diffs D46705940, we enable `ProtectedMode` to filter non-standard parameter of App Events in client side. But without those params, the MACA matching cannot be done in server, so we need to move the MACA rule matching to client side as well.

**In this diff**
- Add new feature `FBSDKFeatureMACARuleMatching`
- Add new class `MACARuleMatchingManager` and add to the AppEvents' configuration

Reviewed By: KylinChang

Differential Revision: D46779149

fbshipit-source-id: d12ac3b6be2cd173fdd5023d096c1ad1478cd2f8
2023-06-21 14:27:59 -07:00
Shawn Zeng
e94f74575b Implement processParameters method
Summary:
**In this diff**
- Implement the filter method of ProtectedModeManager.

Now the standardParameter list is hardcoded in FBSDK, will change to dynamically load in the future.

Reviewed By: KylinChang

Differential Revision: D46708165

fbshipit-source-id: 6984dec83ae578e87e8df2871c28ab93a2a989ba
2023-06-15 09:34:09 -07:00
Shawn Zeng
9cea64cd78 Add new ProtectedMode feature
Summary:
New diff copy from D46668428

ProtectedMode is a new feature added in FBSDK, in order to filter the non-standard parameters in AppEvents that will be sent to the FB server.

**In this diff**
- Create ProtectedModeManager class stub
- Add protectedMode to the AppEvent configuration

Reviewed By: Nathaaaalie

Differential Revision: D46705940

fbshipit-source-id: e3f164c7d3c9996232b3e8d12c51128494f8cef5
2023-06-15 09:34:07 -07:00
Zilin Zhang
814863c8d8 Bump v16.1.1
Summary: $title

Reviewed By: wx0165927473

Differential Revision: D46714164

fbshipit-source-id: bc42540e1569cf1d482fa111a6c4bf26a5b979bf
2023-06-14 10:12:00 -07:00