Comments (26)
I think I solved this with Android Studio help because I'm not so familiar with Java...
In node_modules/react-native-fbsdk-next/android/src/main/java/com/facebook/reactnative/androidsdk/FBProfileModule.java
there's no constructor. And as Android Studio suggestion, I click one of it's options (just like eslint fix) and this code is automatically generated:
public FBProfileModule(@NonNull ReactApplicationContext reactContext) {
super(reactContext);
}
Then in node_modules/react-native-fbsdk-next/android/src/main/java/com/facebook/reactnative/androidsdk/FBSDKPackage.java
in createNativeModules
function:
new FBProfileModule()
is not passing anything.
So, I pass reactContext
to it:
new FBProfileModule(reactContext)
is this really how to solved it? Or I am doing it wrong but it still works?
from react-native-fbsdk-next.
You should update to at least react native 0.63 I think? 62 has no official support for the base react native framework since xcode 12.5 came out
from react-native-fbsdk-next.
@ts-amir-shaikh alternative method is to fix yourself locally until you can update to a modern react-native version - patch-package is the thing everyone uses for this - apply the patch locally and move on: https://github.com/ds300/patch-package
from react-native-fbsdk-next.
I think I solved this with Android Studio help because I'm not so familiar with Java...
Innode_modules/react-native-fbsdk-next/android/src/main/java/com/facebook/reactnative/androidsdk/FBProfileModule.java
there's no constructor. And as Android Studio suggestion, I click one of it's options (just like eslint fix) and this code is automatically generated:public FBProfileModule(@NonNull ReactApplicationContext reactContext) { super(reactContext); }
Then in
node_modules/react-native-fbsdk-next/android/src/main/java/com/facebook/reactnative/androidsdk/FBSDKPackage.java
increateNativeModules
function:
new FBProfileModule()
is not passing anything.
So, I passreactContext
to it:
new FBProfileModule(reactContext)
is this really how to solved it? Or I am doing it wrong but it still works?Only one thing is missing in this which I already recommended in commit review
import com.facebook.react.bridge.ReactApplicationContext;
Yes, I forgot to mention it, import com.facebook.react.bridge.ReactApplicationContext;
from react-native-fbsdk-next.
I also have RN 0.61.5 and would like to use the 4.3.0 library if it fixes issues like mentioned above, but when I tried to install it, npm gave an err saying "unable to resolve dependency tree" since the dependency is >=0.63.3
It says
Fix the upstream dependency conflict, or retry
this command with --force, or --legacy-peer-deps to accept an incorrect (and potentially broken) dependency resolution.Not sure if it's ok to force something like this... is this how you did it? @ugrdursun
I usually don't run into situations like this so it's the first time for me where there's a dependency conflict that's hard to get aroundI guess a better question is - is it safer/better for long term stability to use 4.2.0 and just try to fix the android issue, or use 4.3.0 despite the dependency conflict?
I am using 4.3.0 with 0.61.5 for more than a month and working fine on me. I think dependency conflict is not that deeper to cause any huge problem here.
from react-native-fbsdk-next.
I believe 4.3.0 was specifically released to restore compatibility with older RN versions. The document may be out of date. How did it go when you tried it?
from react-native-fbsdk-next.
Didn't say you were talking gibberish:
I did not try it
I said "The document may be out of date. " not "you're talking gibberish." You should try it, report results.
from react-native-fbsdk-next.
Didn't say you were talking gibberish:
I did not try it
I said "The document may be out of date. " not "you're talking gibberish." You should try it, report results.
My apologies, you were right! Document needs a correction. It works on both android and iOS perfectly. Sorry I got you wrong. Thanks!
from react-native-fbsdk-next.
Fantastic! I was about to be really confused if it did not work actually since it was the point of the change before. But documentation frequently goes out of date, yes. I'll hit the edit button at the top of the page and propose a change to the ranges now that we are compatible again
from react-native-fbsdk-next.
use older npm or --legacy-peer-deps
but really update react-native for long term stability
from react-native-fbsdk-next.
I think I solved this with Android Studio help because I'm not so familiar with Java...
In
node_modules/react-native-fbsdk-next/android/src/main/java/com/facebook/reactnative/androidsdk/FBProfileModule.java
there's no constructor. And as Android Studio suggestion, I click one of it's options (just like eslint fix) and this code is automatically generated:public FBProfileModule(@NonNull ReactApplicationContext reactContext) { super(reactContext); }
Then in
node_modules/react-native-fbsdk-next/android/src/main/java/com/facebook/reactnative/androidsdk/FBSDKPackage.java
increateNativeModules
function:
new FBProfileModule()
is not passing anything.So, I pass
reactContext
to it:
new FBProfileModule(reactContext)
is this really how to solved it? Or I am doing it wrong but it still works?
Only one thing is missing in this which I already recommended in commit review
import com.facebook.react.bridge.ReactApplicationContext;
from react-native-fbsdk-next.
When can we expect this fix with new release?
It works fine as expected please release this ASAP
from react-native-fbsdk-next.
Can this please me mentioned in troubleshooting part of Readme?
from react-native-fbsdk-next.
I made the title prescriptive and pinned it on the repo. At this point effectively no one should be using 0.62 or lower as it literally does not compile with current Xcode, it's broken completely.
from react-native-fbsdk-next.
@ts-amir-shaikh alternative method is to fix yourself locally until you can update to a modern react-native version - patch-package is the thing everyone uses for this - apply the patch locally and move on: https://github.com/ds300/patch-package
@mikehardy Yes working with the patch for now
from react-native-fbsdk-next.
closing as #31 got merged
from react-native-fbsdk-next.
@ts-amir-shaikh alternative method is to fix yourself locally until you can update to a modern react-native version - patch-package is the thing everyone uses for this - apply the patch locally and move on: https://github.com/ds300/patch-package
@mikehardy Yes working with the patch for now
How should we apply this patch ? I am not familiar with applying patches
from react-native-fbsdk-next.
I think I solved this with Android Studio help because I'm not so familiar with Java...
In
node_modules/react-native-fbsdk-next/android/src/main/java/com/facebook/reactnative/androidsdk/FBProfileModule.java
there's no constructor. And as Android Studio suggestion, I click one of it's options (just like eslint fix) and this code is automatically generated:public FBProfileModule(@NonNull ReactApplicationContext reactContext) { super(reactContext); }
Then in
node_modules/react-native-fbsdk-next/android/src/main/java/com/facebook/reactnative/androidsdk/FBSDKPackage.java
increateNativeModules
function:
new FBProfileModule()
is not passing anything.So, I pass
reactContext
to it:
new FBProfileModule(reactContext)
is this really how to solved it? Or I am doing it wrong but it still works?
Hello,
I couldn't apply this because my FBProfileModule.java is not familiar with yours example.
I have this:
`package com.facebook.reactnative.androidsdk;
import com.facebook.Profile;
import com.facebook.react.bridge.Callback;
import com.facebook.react.bridge.NativeModule;
import com.facebook.react.bridge.ReactContextBaseJavaModule;
import com.facebook.react.bridge.ReactMethod;
import com.facebook.react.module.annotations.ReactModule;
import androidx.annotation.NonNull;
/**
* This is a {@link NativeModule} that allows JS to use FBSDKProfile info of the current logged user.
*/
@ReactModule(name = FBProfileModule.NAME)
public class FBProfileModule extends ReactContextBaseJavaModule {
public static final String NAME = "FBProfile";
@NonNull
@Override
public String getName() {
return NAME;
}
/**
* Get the current logged profile.
* @param callback Use callback to pass the current logged profile back to JS.
*/
@ReactMethod
public void getCurrentProfile(Callback callback) {
//Return the profile object as a ReactMap.
callback.invoke(Profile.getCurrentProfile() == null
? null
: Utility.profileToReactMap(Profile.getCurrentProfile()));
}
}
`
How should i edit this ?
from react-native-fbsdk-next.
How should i edit this ?
You don't? The fix was merged so it's not necessary. Make sure you are using the current release here before attempting any troubleshooting, otherwise you may end up just chasing ghosts
from react-native-fbsdk-next.
you're faster than me @mikehardy :p
from react-native-fbsdk-next.
Haha just getting that first cup of coffee and rolling through notifications @thebergamo πβ cheers
from react-native-fbsdk-next.
How should i edit this ?
You don't? The fix was merged so it's not necessary. Make sure you are using the current release here before attempting any troubleshooting, otherwise you may end up just chasing ghosts
:) Well, i am receiving exact same error.
Hence my RN version is 0.61.5 , I use 4.2.0 and cant use 4.3.0 as the document says. So I am looking for a fix on 4.2.0
from react-native-fbsdk-next.
I believe 4.3.0 was specifically released to restore compatibility with older RN versions. The document may be out of date. How did it go when you tried it?
I did not try it hence document clearly says To use this library you need to ensure you match up with the correct version of React Native you are using..
`
FB SDK | lib version | Required React Native Version |
---|
= 9.3.0+ | react-native-fbsdk-nextΒ > 4.3.0 | >=0.63.3
`
So I am not talking gibberish mate
from react-native-fbsdk-next.
@ugrdursun what do you think of #71 ? I tried to expose the actual technical tradeoff if old versions are used - they do work now and we are not trying to break anyway, but it could happen by accident again since old versions are out of support really, meaning no one tests on them actively
from react-native-fbsdk-next.
@ugrdursun what do you think of #71 ? I tried to expose the actual technical tradeoff if old versions are used - they do work now and we are not trying to break anyway, but it could happen by accident again since old versions are out of support really, meaning no one tests on them actively
With RN 0.61.5 and library 4.3.0 I did not receive any crash reports on a live app with around 15k+ users
from react-native-fbsdk-next.
I also have RN 0.61.5 and would like to use the 4.3.0 library if it fixes issues like mentioned above, but when I tried to install it, npm gave an err saying "unable to resolve dependency tree" since the dependency is >=0.63.3
It says
Fix the upstream dependency conflict, or retry
this command with --force, or --legacy-peer-deps to accept an incorrect (and potentially broken) dependency resolution.
Not sure if it's ok to force something like this... is this how you did it? @ugrdursun
I usually don't run into situations like this so it's the first time for me where there's a dependency conflict that's hard to get around
I guess a better question is - is it safer/better for long term stability to use 4.2.0 and just try to fix the android issue, or use 4.3.0 despite the dependency conflict?
from react-native-fbsdk-next.
Related Issues (20)
- [Expo] How to initialize SDK only on specific build? HOT 1
- share link url can't show preview link HOT 1
- `Could not resolve com.facebook.android:facebook-android-sdk:16.+.` due to Bad Gateway for https://oss.sonatype.org HOT 2
- IOS build failed with FBSDKCoreKit/FBSDKCoreKit.modulemap not found HOT 1
- Build error: Showing Recent Messages Error [ERR_REQUIRE_ESM]: require() of ES Module... HOT 2
- support version 17 of facebook sdk with privacy manifests HOT 14
- Will this lib be updated to meet Apple's new third party sdk privacy manifest requirement? HOT 2
- Can't change to another account on login HOT 3
- iOS limited login HOT 14
- Email not retrieving from facebook login HOT 3
- Need help for the facebook sharing HOT 1
- Facebook SDK not initialized error when using react-native-fbsdk-next with Expo HOT 7
- FbLoginManager.loginwithPermissions was called with 1 arguments butt expects 3 arguments HOT 2
- LoginManager.logOut() doesn't remove app from Facebook "Business Integrations" HOT 1
- App switches automatically to limited login when updated to v13 HOT 4
- Access Token is invalid HOT 6
- React native app - Upgrade fbsdk to version 9.0.0 HOT 1
- Mobile product ads aka Advantage+ Catalog Ads not receiving params HOT 2
- Upgrading to v13.0.0 , build failed for android HOT 6
- iOS limited login does not return all possible fields HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from react-native-fbsdk-next.