thebergamo / react-native-fbsdk-next

MIT License
692 stars 166 forks source link

Facebook SDK Integration Issue in React Native App for iOS 14+ #543

Closed qsales2022 closed 1 month ago

qsales2022 commented 3 months ago

🐛 Bug Report

To Reproduce

Expected Behavior

Code Example

Environment

Facebook SDK Integration Issue in React Native App for iOS 14+

I'm experiencing an issue with Facebook SDK integration in my React Native app. The SDK is working correctly on Android and iOS versions below 14, but it's not functioning properly on iOS 14 and above. Here's what I've implemented so far:

AppDelegate.mm

#import <React/RCTBundleURLProvider.h>
#import <AuthenticationServices/AuthenticationServices.h>
#import <SafariServices/SafariServices.h>
#import <FBSDKCoreKit/FBSDKCoreKit-Swift.h>
#import <FBAEMKit/FBAEMKit-Swift.h>
#import <React/RCTLinkingManager.h>
#import <AppTrackingTransparency/AppTrackingTransparency.h>
#import <AdSupport/AdSupport.h>

// In didFinishLaunchingWithOptions:
[[FBSDKApplicationDelegate sharedInstance] application:application
                       didFinishLaunchingWithOptions:launchOptions];

if (@available(iOS 14, *)) {
  [ATTrackingManager requestTrackingAuthorizationWithCompletionHandler:^(ATTrackingManagerAuthorizationStatus status) {
    // Handle tracking authorization status if needed
  }];
}

return [super application:application didFinishLaunchingWithOptions:launchOptions];

// OpenURL method
- (BOOL)application:(UIApplication *)application
   openURL:(NSURL *)url
   options:(NSDictionary<UIApplicationOpenURLOptionsKey,id> *)options
{
  [FBAEMReporter configureWithNetworker:nil appID:@"YOUR_APP_ID" reporter:nil];
  [FBAEMReporter enable];
  [FBAEMReporter handle:url];

  return [RCTLinkingManager application:application openURL:url options:options];
}

Podfile

pod 'FBSDKCoreKit', '~> 17.0.0'
pod 'FBSDKLoginKit', '~> 17.0.0'
pod 'FBSDKShareKit', '~> 17.0.0'

Info.plist

I've added the necessary Facebook-related keys and values to my Info.plist file, including:

React Native Package

I'm using react-native-fbsdk-next version 13.0.0 in my project.

Despite these implementations, the Facebook SDK is not working on iOS 14 and above. What could be the issue, and how can I resolve it?

ellowwwteam commented 3 months ago

Screenshot from 2024-08-20 10-22-58

Same issue here and how to resolve it? Any solution for this issue?

i-ked-ii commented 2 months ago

Facebook needs upgrade SDK version iOS more than v17.0.0, And I am waiting package update.

Screenshot 2567-09-10 at 09 30 52

ankitbacancy commented 2 months ago

@qsales2022 I'm having same issue. Have you resolved it ? If yes, could you please write steps ?

mikehardy commented 1 month ago

I believe these are different issues.

Original poster says it simply isn't working. I can't reproduce that. It works fine for me from the example app here on iOS 14+ and in my work app. So I'm going to close the issue as I cannot reproduce.

Other posters have hijacked the thread to say they want the ios SDK updated. That's been done in other pull requests