Giter Site home page Giter Site logo

Comments (17)

thebergamo avatar thebergamo commented on July 16, 2024 2

@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.

thebergamo avatar thebergamo commented on July 16, 2024 1

@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.

leolusoli avatar leolusoli commented on July 16, 2024 1

@cocoa-rum Ready: cocoa-rum#1

from react-native-fbsdk-next.

thebergamo avatar thebergamo commented on July 16, 2024

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.

Techdojo avatar Techdojo commented on July 16, 2024

Thanks, I'll have a look at what's involved. 🤞 it shouldn't be a massive change.

from react-native-fbsdk-next.

thebergamo avatar thebergamo commented on July 16, 2024

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.

leolusoli avatar leolusoli commented on July 16, 2024

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.

mikehardy avatar mikehardy commented on July 16, 2024

@leolusoli fantastic! No one else has done anything in the area that I know of, post that PR 😄 !

from react-native-fbsdk-next.

cocoa-rum avatar cocoa-rum commented on July 16, 2024

@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.

leolusoli avatar leolusoli commented on July 16, 2024

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:

  1. 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/
  2. What is the graphDomain property?
  3. 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.
  4. 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.

cocoa-rum avatar cocoa-rum commented on July 16, 2024

@leolusoli

  1. 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

  1. 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

  1. 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

  1. 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.

leolusoli avatar leolusoli commented on July 16, 2024

@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.

cocoa-rum avatar cocoa-rum commented on July 16, 2024

@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.

mikehardy avatar mikehardy commented on July 16, 2024

😅 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.

leolusoli avatar leolusoli commented on July 16, 2024

@cocoa-rum I'm making the part for profile (only iOS for now). I will push this in hours.

from react-native-fbsdk-next.

cocoa-rum avatar cocoa-rum commented on July 16, 2024

@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.

mikehardy avatar mikehardy commented on July 16, 2024

I believe this is done!

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.