Skip to content

Commit

Permalink
🔥 Remove facebook sdk (#370)
Browse files Browse the repository at this point in the history
  • Loading branch information
williamchong authored and nwingt committed Jun 9, 2023
1 parent 042af6f commit 6277960
Show file tree
Hide file tree
Showing 6 changed files with 2 additions and 100 deletions.
8 changes: 0 additions & 8 deletions app/utils/analytics.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import crypto from "crypto"
import { AppEventsLogger } from "react-native-fbsdk"
import { logError } from "./error"
import {
setSentryUser,
Expand Down Expand Up @@ -51,24 +50,18 @@ function filterPayloadByLimit(payload) {
}

export async function updateAnalyticsUser({
email,
authCoreUserId,
userPIISalt,
}: UserIdPayload) {
/* eslint-disable @typescript-eslint/camelcase */
AppEventsLogger.setUserID(hashUserId(authCoreUserId, userPIISalt))
AppEventsLogger.setUserData({ email })
await Promise.all([
setSentryUser({ id: hashUserId(authCoreUserId, userPIISalt) }),
setCrashlyticsUserId(hashUserId(authCoreUserId, userPIISalt)),
setAnalyticsUserId(hashUserId(authCoreUserId, userPIISalt)),
])
/* eslint-enable @typescript-eslint/camelcase */
}

export async function logoutAnalyticsUser() {
await Promise.all([
AppEventsLogger.setUserID(null),
resetAnalyticsUser(),
resetSentryUser(),
resetCrashlyticsUserId(),
Expand Down Expand Up @@ -120,7 +113,6 @@ export async function logAnalyticsEvent(event: string, payload?: any) {
break
}
}
AppEventsLogger.logEvent(filterKeyLimit(eventCamel))
/* eslint-enable @typescript-eslint/camelcase */
} catch (err) {
logError(err)
Expand Down
38 changes: 0 additions & 38 deletions ios/LikeCoinApp.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,6 @@
3D2512B725CD2D4100DE881D /* Copy Google plist */,
C76FA05B0208092CE895C07A /* [CP-User] [RNFB] Core Configuration */,
CA245B537CEDD94F185A0102 /* [CP-User] [RNFB] Crashlytics Configuration */,
512FB86A807CF2F0E223B7FC /* [CP] Copy Pods Resources */,
83FE4EA924064FE50073E6EA /* Embed App Extensions */,
);
buildRules = (
Expand All @@ -230,7 +229,6 @@
83FE4E9A24064FE50073E6EA /* Frameworks */,
83FE4E9B24064FE50073E6EA /* Resources */,
83FE4EB0240C0ABA0073E6EA /* Bundle React Native code and images */,
127AFA9F1F2CAC72968EAAED /* [CP] Copy Pods Resources */,
);
buildRules = (
);
Expand Down Expand Up @@ -347,24 +345,6 @@
shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n";
showEnvVarsInLog = 0;
};
127AFA9F1F2CAC72968EAAED /* [CP] Copy Pods Resources */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputPaths = (
"${PODS_ROOT}/Target Support Files/Pods-LikeCoinApp-LikerLandShare/Pods-LikeCoinApp-LikerLandShare-resources.sh",
"${PODS_ROOT}/FBSDKCoreKit/FacebookSDKStrings.bundle",
);
name = "[CP] Copy Pods Resources";
outputPaths = (
"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/FacebookSDKStrings.bundle",
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-LikeCoinApp-LikerLandShare/Pods-LikeCoinApp-LikerLandShare-resources.sh\"\n";
showEnvVarsInLog = 0;
};
3D2512B725CD2D4100DE881D /* Copy Google plist */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
Expand All @@ -383,24 +363,6 @@
shellPath = /bin/sh;
shellScript = "# Name of the resource we're selectively copying\nGOOGLESERVICE_INFO_PLIST=GoogleService-Info.plist\n\n# Get references to dev and prod versions of the GoogleService-Info.plist\n# NOTE: These should only live on the file system and should NOT be part of the target (since we'll be adding them to the target manually)\nGOOGLESERVICE_INFO_DEV=${PROJECT_DIR}/Debug/${GOOGLESERVICE_INFO_PLIST}\nGOOGLESERVICE_INFO_PROD=${PROJECT_DIR}/Release/${GOOGLESERVICE_INFO_PLIST}\n\n# Make sure the dev version of GoogleService-Info.plist exists\necho \"Looking for ${GOOGLESERVICE_INFO_PLIST} in ${GOOGLESERVICE_INFO_DEV}\"\nif [ ! -f $GOOGLESERVICE_INFO_DEV ]\nthen\n echo \"No Development GoogleService-Info.plist found. Please ensure it's in the proper directory.\"\n exit 1\nfi\n\n# Make sure the prod version of GoogleService-Info.plist exists\necho \"Looking for ${GOOGLESERVICE_INFO_PLIST} in ${GOOGLESERVICE_INFO_PROD}\"\nif [ ! -f $GOOGLESERVICE_INFO_PROD ]\nthen\n echo \"No Production GoogleService-Info.plist found. Please ensure it's in the proper directory.\"\n exit 1\nfi\n\n# Get a reference to the destination location for the GoogleService-Info.plist\nPLIST_DESTINATION=${BUILT_PRODUCTS_DIR}/${PRODUCT_NAME}.app\necho \"Will copy ${GOOGLESERVICE_INFO_PLIST} to final destination: ${PLIST_DESTINATION}\"\n\n# Copy over the prod GoogleService-Info.plist for Release builds\nif [ \"${CONFIGURATION}\" == \"Release\" ]\nthen\n echo \"Using ${GOOGLESERVICE_INFO_PROD}\"\n cp \"${GOOGLESERVICE_INFO_PROD}\" \"${PLIST_DESTINATION}\"\nelse\n echo \"Using ${GOOGLESERVICE_INFO_DEV}\"\n cp \"${GOOGLESERVICE_INFO_DEV}\" \"${PLIST_DESTINATION}\"\nfi\n";
};
512FB86A807CF2F0E223B7FC /* [CP] Copy Pods Resources */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputPaths = (
"${PODS_ROOT}/Target Support Files/Pods-LikeCoinApp/Pods-LikeCoinApp-resources.sh",
"${PODS_ROOT}/FBSDKCoreKit/FacebookSDKStrings.bundle",
);
name = "[CP] Copy Pods Resources";
outputPaths = (
"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/FacebookSDKStrings.bundle",
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-LikeCoinApp/Pods-LikeCoinApp-resources.sh\"\n";
showEnvVarsInLog = 0;
};
83FE4EB0240C0ABA0073E6EA /* Bundle React Native code and images */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
Expand Down
12 changes: 2 additions & 10 deletions ios/LikeCoinApp/AppDelegate.m
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
#import <React/RCTBundleURLProvider.h>
#import <React/RCTRootView.h>
#import <React/RCTLinkingManager.h>
#import <FBSDKCoreKit/FBSDKCoreKit.h>
#import <RNBranch/RNBranch.h>

@import Firebase;
Expand Down Expand Up @@ -47,8 +46,7 @@ - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(
FIROptions *options = [[FIROptions alloc] initWithContentsOfFile:filePath];
[FIRApp configureWithOptions:options];
}
[[FBSDKApplicationDelegate sharedInstance] application:application
didFinishLaunchingWithOptions:launchOptions];

#ifdef DEBUG
[RNBranch useTestInstance];
#endif
Expand All @@ -68,13 +66,7 @@ - (NSURL *)sourceURLForBridge:(RCTBridge *)bridge

- (BOOL)application:(UIApplication *)application openURL:(nonnull NSURL *)url options:(nonnull NSDictionary<NSString *,id> *)options {
return [RNBranch.branch application:application openURL:url options:options]
|| [[FBSDKApplicationDelegate sharedInstance] application:application
openURL:url
sourceApplication:options[UIApplicationOpenURLOptionsSourceApplicationKey]
annotation:options[UIApplicationOpenURLOptionsAnnotationKey]
] || [RCTLinkingManager application:application
openURL:url
options:options];
|| [RCTLinkingManager application:application openURL:url options:options];
}

- (BOOL)application:(UIApplication *)application continueUserActivity:(NSUserActivity *)userActivity restorationHandler:(void (^)(NSArray<id<UIUserActivityRestoring>> * _Nullable))restorationHandler {
Expand Down
38 changes: 0 additions & 38 deletions ios/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -6,20 +6,6 @@ PODS:
- BVLinearGradient (2.5.6):
- React
- DoubleConversion (1.1.6)
- FBSDKCoreKit (5.8.0):
- FBSDKCoreKit/Basics (= 5.8.0)
- FBSDKCoreKit/Core (= 5.8.0)
- FBSDKCoreKit/Basics (5.8.0)
- FBSDKCoreKit/Core (5.8.0):
- FBSDKCoreKit/Basics
- FBSDKLoginKit (5.8.0):
- FBSDKLoginKit/Login (= 5.8.0)
- FBSDKLoginKit/Login (5.8.0):
- FBSDKCoreKit (~> 5.0)
- FBSDKShareKit (5.8.0):
- FBSDKShareKit/Share (= 5.8.0)
- FBSDKShareKit/Share (5.8.0):
- FBSDKCoreKit (~> 5.0)
- Firebase/Analytics (7.1.0):
- Firebase/Core
- Firebase/Core (7.1.0):
Expand Down Expand Up @@ -208,20 +194,6 @@ PODS:
- React
- react-native-camera/RN (3.8.0):
- React
- react-native-fbsdk (1.1.2):
- React
- react-native-fbsdk/Core (= 1.1.2)
- react-native-fbsdk/Login (= 1.1.2)
- react-native-fbsdk/Share (= 1.1.2)
- react-native-fbsdk/Core (1.1.2):
- FBSDKCoreKit (= 5.8)
- React
- react-native-fbsdk/Login (1.1.2):
- FBSDKLoginKit (= 5.8)
- React
- react-native-fbsdk/Share (1.1.2):
- FBSDKShareKit (= 5.8)
- React
- react-native-image-picker (4.8.1):
- React-Core
- react-native-image-sequence (0.7.0):
Expand Down Expand Up @@ -342,7 +314,6 @@ DEPENDENCIES:
- react-native-authcore (from `../node_modules/react-native-authcore`)
- react-native-branch (from `../node_modules/react-native-branch`)
- react-native-camera (from `../node_modules/react-native-camera`)
- react-native-fbsdk (from `../node_modules/react-native-fbsdk`)
- react-native-image-picker (from `../node_modules/react-native-image-picker`)
- react-native-image-sequence (from `../node_modules/react-native-image-sequence`)
- react-native-randombytes (from `../node_modules/react-native-randombytes`)
Expand Down Expand Up @@ -387,9 +358,6 @@ SPEC REPOS:
trunk:
- boost-for-react-native
- Branch
- FBSDKCoreKit
- FBSDKLoginKit
- FBSDKShareKit
- Firebase
- FirebaseABTesting
- FirebaseAnalytics
Expand Down Expand Up @@ -442,8 +410,6 @@ EXTERNAL SOURCES:
:path: "../node_modules/react-native-branch"
react-native-camera:
:path: "../node_modules/react-native-camera"
react-native-fbsdk:
:path: "../node_modules/react-native-fbsdk"
react-native-image-picker:
:path: "../node_modules/react-native-image-picker"
react-native-image-sequence:
Expand Down Expand Up @@ -528,9 +494,6 @@ SPEC CHECKSUMS:
Branch: 9b299693ee54b308ff8c18146afe1f711c2069ec
BVLinearGradient: e3aad03778a456d77928f594a649e96995f1c872
DoubleConversion: 5805e889d232975c086db112ece9ed034df7a0b2
FBSDKCoreKit: e7dcac0aabcfb09d0166998edd95fe3b05a0ce5d
FBSDKLoginKit: 1b0cf04df0370b37404213157b060d6666ede814
FBSDKShareKit: abc29e1bb4f9f59f679adf1ae191006d68455f96
Firebase: 78e8dd2e39d653de6270432ad84fe8b59f7bf4e8
FirebaseABTesting: f6853447dc61fa785df777748747c845f40fa7cd
FirebaseAnalytics: 7f165a56dea86ddd5b8ce02af3bee982c683405c
Expand Down Expand Up @@ -562,7 +525,6 @@ SPEC CHECKSUMS:
react-native-authcore: cca08325158d4979caff295a8cd064733b78264f
react-native-branch: a15b8ecb55c08139e06e7ea15bcadabc81a51e64
react-native-camera: 21cf4ed26cf432ceb1fae959aa6924943fd6f714
react-native-fbsdk: c35d42169e64aaf66f01713c1e18d0674f7f6519
react-native-image-picker: 5640333245b448b0e64172576ea27760f4134099
react-native-image-sequence: b4cc7ce0ee9eeec7574b005e06059b3f7f818d96
react-native-randombytes: 3638d24759d67c68f6ccba60c52a7a8a8faa6a23
Expand Down
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,6 @@
"react-native-device-info": "^5.6.1",
"react-native-exit-app": "^1.1.0",
"react-native-fast-image": "^8.3.2",
"react-native-fbsdk": "^1.1.2",
"react-native-gesture-handler": "1.7.0",
"react-native-iap": "^7.5.6",
"react-native-image-picker": "https://github.com/likecoin/react-native-image-picker#5e2f78f5e3f893b13a67482471655e1ebb75ad3b",
Expand Down
5 changes: 0 additions & 5 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -13116,11 +13116,6 @@ react-native-fast-image@^8.3.2:
resolved "https://registry.yarnpkg.com/react-native-fast-image/-/react-native-fast-image-8.3.2.tgz#e9db271b70b9634b7be054760914d80954f9898c"
integrity sha512-AJ0b4BEswRwa0bh4SibYUtXszEiaO88Lf4CZ1ib+t5ZfkAgsMk9Liv3L0LYnDblMJmSeGTr1+2ViIM8F2vamjg==

react-native-fbsdk@^1.1.2:
version "1.1.2"
resolved "https://registry.yarnpkg.com/react-native-fbsdk/-/react-native-fbsdk-1.1.2.tgz#4264903add869d05b84ef55ade9ff720c2957781"
integrity sha512-Sp+oja868QVsB5vpEFbwZkEcCJOSBuZgh7UGJzUhaoTCs/zwSUHA6b4QichM7GiTxtQyKfT/F31DtvLj2N/qAQ==

react-native-flipper@^0.34.0:
version "0.34.0"
resolved "https://registry.yarnpkg.com/react-native-flipper/-/react-native-flipper-0.34.0.tgz#7df1f38ba5d97a9321125fe0fccbe47d99e6fa1d"
Expand Down

0 comments on commit 6277960

Please sign in to comment.