Comments (17)
@cocoa-rum feel free to open into Master branch, we can test it directly to your branch before merging, so it should be good.
If you could implement some test for this feature to be added it would be easier for us to test. Like using detox it would be great as well.
In near future I would like to have those features tested this way so it would save us some time :)
Anyway thanks for your effort and also @leolusoli :)
from react-native-fbsdk-next.
@cocoa-rum @leolusoli if you push a PR I can review it and maybe we can include it in the new release :)
Also I can try to help with testing it o/
from react-native-fbsdk-next.
@cocoa-rum Ready: cocoa-rum#1
from react-native-fbsdk-next.
Hi @Techdojo thanks for your suggestion! At this moment I don't have any specific plan towards it.
As you suggested, feel free to contribute with this new lib, I will be more than happy to review and merge it for future release :)
from react-native-fbsdk-next.
Thanks, I'll have a look at what's involved. 🤞 it shouldn't be a massive change.
from react-native-fbsdk-next.
No biggie :)
If you see any space that we can work together on that, let me know and we can split up the work
from react-native-fbsdk-next.
Hi guys.
I've made a fork adding a separate (and very simple) limitedLogin method in order to add the desired behaviour. Before opening the PR, I'd like to know if someone else are making the same part in order to organise the work. Thanks in advice :)
from react-native-fbsdk-next.
@leolusoli fantastic! No one else has done anything in the area that I know of, post that PR 😄 !
from react-native-fbsdk-next.
@mikehardy Hi. I am also forked and implemented Limited Log in, but only for LoginManager.
I can try to PR. Also you can check in my repo. Branch name limited-login
tl dr
created separated method limitedLogInWithPermissions
and for getting Authentication Token - class AuthenticationToken
from react-native-fbsdk-next.
Hi @cocoa-rum. I'm watching your modifications. Can you give an example of using this method in JS? I also have some questions about it:
- The authentication token with the class that you are build is relevant to the one taken by this example? https://developers.facebook.com/docs/facebook-login/limited-login/ios/
- What is the graphDomain property?
- If I want to grab userID, email and other information about the user logged I'll have to do in JS by decoding the token, right? Maybe, it would be great to get this information directly from the SDK in order to not require a jwt decoding library for do this stuff in JS.
- Why you are request an additional param loginTracking if the method name is limitedLogInWithPermissions? The user will expect that the configuration of the limitedLogInWithPermissions will contain FBSDKLoginTrackingLimited (otherwise he'll have to use the classic loginWithPermission method).
@mikehardy Please give me a feedback if what I'm saying is wrong. Thanks to all :)
from react-native-fbsdk-next.
- The authentication token with the class that you are build is relevant to the one taken by this example? https://developers.facebook.com/docs/facebook-login/limited-login/ios/
Yes. My class relevant by this example. This is the same FBSDKAuthenticationToken, but called in another place
Why did I create separate class? I relied on the implementation of getting a access token. We loged in and then call getCurrentAccessToken. So in my implementation the same way for authentication token , but we will call getAuthenticationToken
- What is the graphDomain property?
The graph domain where the user is authenticated. as we can read from FBSDKAuthenticationToken properties. For me it was graphDomain: 'facebook'
. Really do not know where it can be used, but may be someone what to know
- If I want to grab userID, email and other information about the user logged I'll have to do in JS by decoding the token, right? Maybe, it would be great to get this information directly from the SDK in order to not require a jwt decoding library for do this stuff in JS.
I passed this token to the server for validation, so I do nothing with it on frontend part. Server will parse and validate this token. As I said in (1) I want to save same flow as with access token.
May be if we need profile info, let's create class for getting info from FBSDKProfile? I think it will simple enough
- Why you are request an additional param loginTracking if the method name is limitedLogInWithPermissions? The user will expect that the configuration of the limitedLogInWithPermissions will contain FBSDKLoginTrackingLimited (otherwise he'll have to use the classic loginWithPermission method).
I create separate method just to be sure, I won't break anything. Let's say for "for backward compatibility". Yes, may be I should leave only logInWithPermissions, with loginTracking, nonce for IOS. This make sense. I will do this just after someone will comment this answer.
And why did I add loginTracking ? Developer will control himself, If dev needs to make log in limited or not, based on app tracking transparency. So id user restricted tracking - dev will pass limited
Can you give an example of using this method in JS?
Here is some rough example. Also without checking platfom (IOS or android)
async getToken() {
try {
const attStatus = await ATTManager.trackingAuthorizationStatus();
await LoginManager.limitedLogInWithPermissions(
['public_profile', 'email'],
attStatus === 'authorized' ? 'enabled' : 'limited'
);
if (attStatus === 'authorized') {
const token = await AccessToken.getCurrentAccessToken();
if (token !== null) {
return token;
}
}
const token = await AuthenticationToken.getAuthenticationToken();
if (token !== null) {
return token;
}
throw Error('Token not found');
} catch (error) {
console.log(error);
}
}
from react-native-fbsdk-next.
@cocoa-rum Thanks for the detailed informations. I think it's every correct.
In order to go on:
- We can build the separate class in order to retrieve the profile information directly from the SDK. If you want I can make by myself if you are busy ;)
- @mikehardy If you could give us the information about the method naming (create new method or extend the loginWithPermission one) in order to have a uniformed root.
For me is a good implementation of this functionality. I believe it can be merged :)
I'm waiting your feedback. Thanks guys :)
from react-native-fbsdk-next.
@leolusoli
I have already extended loginWithPermission and removed limitedLogInWithPermissions. I will push commit to my repo soon.
Also added check for AuthenticationToken , because I did not add this method to android. So I am going to add AuthenticationToken to android
If you want I can make by myself if you are busy
It's ok if you will do this 👍
While I'm finishing LoginManager and AuthenticationToken
Also I think to try make limited login for the FB button, after I finish current part
from react-native-fbsdk-next.
😅 please don't wait on my feedback, I just processed 700 github notifications this morning and about 40 PR reviews (not exaggerating) and I won't have time for more volunteer open source stuff for a little while, apologies :-), it does sounds like you all are making great progress though which is always fun to hear
from react-native-fbsdk-next.
@cocoa-rum I'm making the part for profile (only iOS for now). I will push this in hours.
from react-native-fbsdk-next.
@thebergamo I think I am ready to do PR. Should I to do PR at master branch or you will create limited-login, so you and other devs could test it? I tested it on real devices ios and android (dev env).
There were no problems, maybe there are specific scenarios that I did not encounter. Let me know if there are any
Also I noticed PR with d.ts, should I update forked master branch and add d.ts for new part?
I added Limit Log in to FB button.
Also I wanted to add AuthenticationToken class to android, but unfortunately I did not found such api in android sdk, maybe I didn't see it, but seems AuthenticationToken only for IOS
@leolusoli I added your PR. Thx for Profile part. Also I edited a little bit some lines in js part ( nothing serious, you can check my commits )
from react-native-fbsdk-next.
I believe this is done!
from react-native-fbsdk-next.
Related Issues (20)
- Why my custom params not received in Meta Dashboard HOT 1
- Undefined symbols for architecture x86_64: "_FBLinkable_NSProcessInfo_MacCatalystDetermining" HOT 7
- iOS Events Manager HOT 4
- [Android]: Could not resolve androidx.activity:activity:1.2.0. HOT 2
- Could not resolve com.facebook.android:facebook-android-sdk:16.+ HOT 2
- The old application is able to use deprecated fields HOT 1
- Duplicate declaration of method 'application:openURL:options:'
- swift version mismatch xCode 14.3.1 HOT 2
- mismatch in swift version for expo SDK 49 HOT 1
- react-native Android App crashes on start: The sdk has not been initialized. facebooksdk.sdkinitialize() HOT 3
- yarn example:devcopy fails HOT 2
- ITMS-90863: Apple silicon Macs support issue - The app links with libraries that are not present on Мас HOT 4
- FB login is not working HOT 2
- Attempt to invoke virtual method 'void com.facebook.AccessTokenTracker.stopTracking()' on a null object reference HOT 5
- Limited login doesn't return authentication token HOT 2
- FB SDK version Needs upgrade (upstream issue it seems, does not seem to affect functionality) HOT 13
- Is this the correct library for Facebook campaign to promote the app? HOT 4
- Undefined symbols for architecture x86_64 HOT 3
- How to change add appdelegate.mm HOT 1
- Wrong expiration time for access token recieved , HOT 2
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.