Giter Site home page Giter Site logo

Comments (6)

Yonom avatar Yonom commented on August 15, 2024 2

I see, so the SceneDelegate setup is only necessary if I already have a SceneDelegate for other purposes.

Thanks @iduuck

from react-native-fbsdk-next.

mikehardy avatar mikehardy commented on August 15, 2024 1

@thebergamo I made a "needs more info" label and applied it, I use a label like that in all the repos I collaborate on so when I have a time box available and I do an issue sweep I don't waste time clicking on something that's just waiting for someone else anyway - the seconds add up :-)

from react-native-fbsdk-next.

mikehardy avatar mikehardy commented on August 15, 2024

"follow the steps" - do those include pod install? The Xcode project is not wired up until pod install has been executed

https://developers.facebook.com/docs/ios/use-cocoapods - is the page for cocoapods (which react-native uses for iOS)

Then when you opened it in Xcode are you sure you opened the .xcworkspace, instead of the .xcproject?

from react-native-fbsdk-next.

thebergamo avatar thebergamo commented on August 15, 2024

that's great! Thanks @mikehardy I was thinking about it as well!

from react-native-fbsdk-next.

Yonom avatar Yonom commented on August 15, 2024

@mikehardy

"follow the steps" - do those include pod install?

Yep.

Then when you opened it in Xcode are you sure you opened the .xcworkspace, instead of the .xcproject?

Yep.


https://developers.facebook.com/docs/ios/use-cocoapods - is the page for cocoapods (which react-native uses for iOS)

The project's README links to the wrong page then!


I have created a repo with a minimum reproducible example (following the cocoapods instructions):

https://github.com/Yonom/react-native-fbsdk-next-bug-repo/commit/b3d51dc5da29869b796f3b77434b4b994b52616c#diff-7f1567ebab010f96652f686ce4d2d7dba0314511b6dd275914e1f767e2a470f3

I hope this helps 😊

from react-native-fbsdk-next.

iduuck avatar iduuck commented on August 15, 2024

You don't need to force a SceneDelegate to be there at all. It is enough, if you are relying on the AppDelegate which is generated by react-native on bootstrapping.


Steps to fix this issue:

  1. Use the FBSDKCoreKit import instead of FacebookCore

Steps to fix the demo project:

  1. Follow steps above.
  2. Import the RCTLinkingManager in your AppDelegate
  3. Add a Bridging Header to your project (https://stackoverflow.com/a/54586937/2462992)

Here is the diff (i obfuscated the team id):

diff --git a/ios/Podfile.lock b/ios/Podfile.lock
index e68fa5e..d301507 100644
--- a/ios/Podfile.lock
+++ b/ios/Podfile.lock
@@ -483,7 +483,7 @@ SPEC CHECKSUMS:
   CocoaAsyncSocket: 065fd1e645c7abab64f7a6a2007a48038fdc6a99
   DoubleConversion: cf9b38bf0b2d048436d9a82ad2abe1404f11e7de
   FBLazyVector: 49cbe4b43e445b06bf29199b6ad2057649e4c8f5
-  FBReactNativeSpec: 7cfe263944c611c9295c21a86bbba5d49e711c83
+  FBReactNativeSpec: dcc3fc24a6b6b38c698caf0e1f2b2f6dbf345a99
   FBSDKCoreKit: fada1a6a0076724678993ff05a633848765ff18c
   FBSDKLoginKit: d5ffe6d808897019ccf16feb6f0a7ab260bc5cd6
   FBSDKShareKit: 6a85acb92eaf43a0b6dfa2ba6106eb74c7f10d30
diff --git a/ios/fbsdkbugrepo.xcodeproj/project.pbxproj b/ios/fbsdkbugrepo.xcodeproj/project.pbxproj
index c13f844..e344471 100644
--- a/ios/fbsdkbugrepo.xcodeproj/project.pbxproj
+++ b/ios/fbsdkbugrepo.xcodeproj/project.pbxproj
@@ -8,11 +8,11 @@
 
 /* Begin PBXBuildFile section */
 		00E356F31AD99517003FC87E /* fbsdkbugrepoTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 00E356F21AD99517003FC87E /* fbsdkbugrepoTests.m */; };
+		01258C8126287B0400DF0FC8 /* File.swift in Sources */ = {isa = PBXBuildFile; fileRef = 01258C8026287B0400DF0FC8 /* File.swift */; };
 		13B07FBC1A68108700A75B9A /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 13B07FB01A68108700A75B9A /* AppDelegate.m */; };
 		13B07FBF1A68108700A75B9A /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 13B07FB51A68108700A75B9A /* Images.xcassets */; };
 		13B07FC11A68108700A75B9A /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 13B07FB71A68108700A75B9A /* main.m */; };
 		2A6F6E84B33D6CEBD786577E /* libPods-fbsdkbugrepo-fbsdkbugrepoTests.a in Frameworks */ = {isa = PBXBuildFile; fileRef = E52165A5C3C9732A72130C50 /* libPods-fbsdkbugrepo-fbsdkbugrepoTests.a */; };
-		2AF02A90262029A900BA8794 /* SceneDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 2AF02A8F262029A900BA8794 /* SceneDelegate.m */; };
 		6E3011BC5E7E8E558D42F93A /* libPods-fbsdkbugrepo.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 715838605DA65C4012C7B7CE /* libPods-fbsdkbugrepo.a */; };
 		81AB9BB82411601600AC10FF /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 81AB9BB72411601600AC10FF /* LaunchScreen.storyboard */; };
 /* End PBXBuildFile section */
@@ -31,6 +31,8 @@
 		00E356EE1AD99517003FC87E /* fbsdkbugrepoTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = fbsdkbugrepoTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
 		00E356F11AD99517003FC87E /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
 		00E356F21AD99517003FC87E /* fbsdkbugrepoTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = fbsdkbugrepoTests.m; sourceTree = "<group>"; };
+		01258C7F26287B0300DF0FC8 /* fbsdkbugrepo-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "fbsdkbugrepo-Bridging-Header.h"; sourceTree = "<group>"; };
+		01258C8026287B0400DF0FC8 /* File.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = File.swift; sourceTree = "<group>"; };
 		13B07F961A680F5B00A75B9A /* fbsdkbugrepo.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = fbsdkbugrepo.app; sourceTree = BUILT_PRODUCTS_DIR; };
 		13B07FAF1A68108700A75B9A /* AppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = AppDelegate.h; path = fbsdkbugrepo/AppDelegate.h; sourceTree = "<group>"; };
 		13B07FB01A68108700A75B9A /* AppDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = AppDelegate.m; path = fbsdkbugrepo/AppDelegate.m; sourceTree = "<group>"; };
@@ -39,7 +41,6 @@
 		13B07FB71A68108700A75B9A /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = main.m; path = fbsdkbugrepo/main.m; sourceTree = "<group>"; };
 		1FC1EC9617DA384228A2FF02 /* Pods-fbsdkbugrepo.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-fbsdkbugrepo.debug.xcconfig"; path = "Target Support Files/Pods-fbsdkbugrepo/Pods-fbsdkbugrepo.debug.xcconfig"; sourceTree = "<group>"; };
 		2A2C344643072F85FFD86B3E /* Pods-fbsdkbugrepo-fbsdkbugrepoTests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-fbsdkbugrepo-fbsdkbugrepoTests.release.xcconfig"; path = "Target Support Files/Pods-fbsdkbugrepo-fbsdkbugrepoTests/Pods-fbsdkbugrepo-fbsdkbugrepoTests.release.xcconfig"; sourceTree = "<group>"; };
-		2AF02A8F262029A900BA8794 /* SceneDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; name = SceneDelegate.m; path = fbsdkbugrepo/SceneDelegate.m; sourceTree = "<group>"; };
 		53B6CCF7D79323727926DF83 /* Pods-fbsdkbugrepo.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-fbsdkbugrepo.release.xcconfig"; path = "Target Support Files/Pods-fbsdkbugrepo/Pods-fbsdkbugrepo.release.xcconfig"; sourceTree = "<group>"; };
 		715838605DA65C4012C7B7CE /* libPods-fbsdkbugrepo.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-fbsdkbugrepo.a"; sourceTree = BUILT_PRODUCTS_DIR; };
 		81AB9BB72411601600AC10FF /* LaunchScreen.storyboard */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.storyboard; name = LaunchScreen.storyboard; path = fbsdkbugrepo/LaunchScreen.storyboard; sourceTree = "<group>"; };
@@ -94,7 +95,8 @@
 				13B07FB61A68108700A75B9A /* Info.plist */,
 				81AB9BB72411601600AC10FF /* LaunchScreen.storyboard */,
 				13B07FB71A68108700A75B9A /* main.m */,
-				2AF02A8F262029A900BA8794 /* SceneDelegate.m */,
+				01258C8026287B0400DF0FC8 /* File.swift */,
+				01258C7F26287B0300DF0FC8 /* fbsdkbugrepo-Bridging-Header.h */,
 			);
 			name = fbsdkbugrepo;
 			sourceTree = "<group>";
@@ -107,7 +109,6 @@
 				CECDF729C982A13C89D2631F /* Pods-fbsdkbugrepo-fbsdkbugrepoTests.debug.xcconfig */,
 				2A2C344643072F85FFD86B3E /* Pods-fbsdkbugrepo-fbsdkbugrepoTests.release.xcconfig */,
 			);
-			name = Pods;
 			path = Pods;
 			sourceTree = "<group>";
 		};
@@ -211,7 +212,7 @@
 						TestTargetID = 13B07F861A680F5B00A75B9A;
 					};
 					13B07F861A680F5B00A75B9A = {
-						LastSwiftMigration = 1120;
+						LastSwiftMigration = 1240;
 					};
 				};
 			};
@@ -415,7 +416,7 @@
 			buildActionMask = 2147483647;
 			files = (
 				13B07FBC1A68108700A75B9A /* AppDelegate.m in Sources */,
-				2AF02A90262029A900BA8794 /* SceneDelegate.m in Sources */,
+				01258C8126287B0400DF0FC8 /* File.swift in Sources */,
 				13B07FC11A68108700A75B9A /* main.m in Sources */,
 			);
 			runOnlyForDeploymentPostprocessing = 0;
@@ -435,6 +436,7 @@
 			isa = XCBuildConfiguration;
 			baseConfigurationReference = CECDF729C982A13C89D2631F /* Pods-fbsdkbugrepo-fbsdkbugrepoTests.debug.xcconfig */;
 			buildSettings = {
+				ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
 				BUNDLE_LOADER = "$(TEST_HOST)";
 				GCC_PREPROCESSOR_DEFINITIONS = (
 					"DEBUG=1",
@@ -462,6 +464,7 @@
 			isa = XCBuildConfiguration;
 			baseConfigurationReference = 2A2C344643072F85FFD86B3E /* Pods-fbsdkbugrepo-fbsdkbugrepoTests.release.xcconfig */;
 			buildSettings = {
+				ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
 				BUNDLE_LOADER = "$(TEST_HOST)";
 				COPY_PHASE_STRIP = NO;
 				INFOPLIST_FILE = fbsdkbugrepoTests/Info.plist;
@@ -489,6 +492,7 @@
 				ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
 				CLANG_ENABLE_MODULES = YES;
 				CURRENT_PROJECT_VERSION = 1;
+				DEVELOPMENT_TEAM = XXX;
 				ENABLE_BITCODE = NO;
 				INFOPLIST_FILE = fbsdkbugrepo/Info.plist;
 				LD_RUNPATH_SEARCH_PATHS = (
@@ -502,6 +506,7 @@
 				);
 				PRODUCT_BUNDLE_IDENTIFIER = "org.reactjs.native.example.$(PRODUCT_NAME:rfc1034identifier)";
 				PRODUCT_NAME = fbsdkbugrepo;
+				SWIFT_OBJC_BRIDGING_HEADER = "fbsdkbugrepo-Bridging-Header.h";
 				SWIFT_OPTIMIZATION_LEVEL = "-Onone";
 				SWIFT_VERSION = 5.0;
 				VERSIONING_SYSTEM = "apple-generic";
@@ -515,6 +520,7 @@
 				ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
 				CLANG_ENABLE_MODULES = YES;
 				CURRENT_PROJECT_VERSION = 1;
+				DEVELOPMENT_TEAM = XXX;
 				INFOPLIST_FILE = fbsdkbugrepo/Info.plist;
 				LD_RUNPATH_SEARCH_PATHS = (
 					"$(inherited)",
@@ -527,6 +533,7 @@
 				);
 				PRODUCT_BUNDLE_IDENTIFIER = "org.reactjs.native.example.$(PRODUCT_NAME:rfc1034identifier)";
 				PRODUCT_NAME = fbsdkbugrepo;
+				SWIFT_OBJC_BRIDGING_HEADER = "fbsdkbugrepo-Bridging-Header.h";
 				SWIFT_VERSION = 5.0;
 				VERSIONING_SYSTEM = "apple-generic";
 			};
diff --git a/ios/fbsdkbugrepo/AppDelegate.m b/ios/fbsdkbugrepo/AppDelegate.m
index 6f43324..ddf73ec 100644
--- a/ios/fbsdkbugrepo/AppDelegate.m
+++ b/ios/fbsdkbugrepo/AppDelegate.m
@@ -3,6 +3,7 @@
 #import <React/RCTBridge.h>
 #import <React/RCTBundleURLProvider.h>
 #import <React/RCTRootView.h>
+#import <React/RCTLinkingManager.h>
 #import <FBSDKCoreKit/FBSDKCoreKit.h>
 
 #ifdef FB_SONARKIT_ENABLED

from react-native-fbsdk-next.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.