Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

reauthorizeDataAccess seemingly should have nullable ViewController param #2476

Open
5 tasks done
mikehardy opened this issue Sep 26, 2024 · 0 comments · May be fixed by #2477
Open
5 tasks done

reauthorizeDataAccess seemingly should have nullable ViewController param #2476

mikehardy opened this issue Sep 26, 2024 · 0 comments · May be fixed by #2477

Comments

@mikehardy
Copy link

mikehardy commented Sep 26, 2024

Checklist before submitting a bug report

Xcode version

16.0

Facebook iOS SDK version

17.1.0

Dependency Manager

CocoaPods

SDK Framework

Login

Goals

I would like to pass a nil ViewController argument to the reauthorizeDataAccess method, as documented

Expected results

no Xcode warnings when passing nil argument

Actual results

warning that the argument is non-nil, despite all underlying methods being written to handle nil ViewController

Steps to reproduce

Open FBSDKLoginKit in Xcode and check the docs for reauthorizeDataAccess vs the parameter nullability annotation

Code samples & details

/**
Requests user's permission to reathorize application's data access, after it has expired due to inactivity.
@param viewController the view controller from which to present the login UI. If nil, the topmost view
controller will be automatically determined and used.
@param handler the callback.
Use this method when you need to reathorize your app's access to user data via the Graph API.
You should only call this after access has expired.
You should provide as much context to the user as possible as to why you need to reauthorize the access, the
scope of access being reathorized, and what added value your app provides when the access is reathorized.
You can inspect the `result.declinedPermissions` to determine if you should provide more information to the
user based on any declined permissions.
@warning This method will reauthorize using a `LoginConfiguration` with `FBSDKLoginTracking` set to `.enabled`.
@warning This method will present UI the user. You typically should call this if `AccessToken.isDataAccessExpired`
is true.
*/
@objc(reauthorizeDataAccess:handler:)
public func reauthorizeDataAccess(
from viewController: UIViewController,
handler: @escaping LoginManagerLoginResultBlock
) {

Note specifically "@param viewController the view controller from which to present the login UI. If nil, the topmost view controller will be automatically determined and used.")

Also note that commonLogin and login methods both handle the nil arg just fine

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant