From 4fda0312c63606784f827968ef6b15301de10f42 Mon Sep 17 00:00:00 2001 From: Arun Lodhi Date: Mon, 30 Dec 2024 19:52:06 +0530 Subject: [PATCH] Add setFBAppID method for Android --- .../src/main/java/io/branch/rnbranch/RNBranchModule.java | 7 +++++++ ios/RNBranch.m | 6 ++++++ src/index.d.ts | 1 + src/index.js | 4 +++- 4 files changed, 17 insertions(+), 1 deletion(-) diff --git a/android/src/main/java/io/branch/rnbranch/RNBranchModule.java b/android/src/main/java/io/branch/rnbranch/RNBranchModule.java index 212bc4179..3ef91c99a 100644 --- a/android/src/main/java/io/branch/rnbranch/RNBranchModule.java +++ b/android/src/main/java/io/branch/rnbranch/RNBranchModule.java @@ -1257,4 +1257,11 @@ public void setDMAParamsForEEA(boolean eeaRegion, boolean adPersonalizationConse public void validateSDKIntegration() { IntegrationValidator.validate(mActivity); } + + @ReactMethod + public void setFBAppID(String fbAppID) { + Branch branch = Branch.getInstance(); + branch.setFBAppID(fbAppID); + } + } diff --git a/ios/RNBranch.m b/ios/RNBranch.m index 5f16385df..b7fc70deb 100644 --- a/ios/RNBranch.m +++ b/ios/RNBranch.m @@ -750,4 +750,10 @@ - (CGFloat) colorComponentFrom: (NSString *) string start: (NSUInteger) start le [[Branch getInstance] validateSDKIntegration]; } +#pragma mark setIdentity +RCT_EXPORT_METHOD( + setFBAppID:(NSString *)fbAppID + ) { +} + @end diff --git a/src/index.d.ts b/src/index.d.ts index 047904280..7a5f4bfec 100644 --- a/src/index.d.ts +++ b/src/index.d.ts @@ -349,6 +349,7 @@ interface Branch { setPreInstallPartner: (partner: string) => void; setDMAParamsForEEA: (eeaRegion: boolean, adPersonalizationConsent: boolean, adUserDataUsageConsent: boolean) => void; validateSDKIntegration: () => void; + setFBAppID: (fbAppID: string) => void; } declare const branch: Branch; export default branch; diff --git a/src/index.js b/src/index.js index 9ac949991..1cf63a219 100644 --- a/src/index.js +++ b/src/index.js @@ -167,7 +167,9 @@ class Branch { validateSDKIntegration = () => { RNBranch.validateSDKIntegration(); - }; + }; + + setFBAppID = (fbAppID) => RNBranch.setFBAppID(fbAppID); } const validateParam = (param, paramName) => {