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

Many of iOS users facing login problem in my app - need urgent solution for that #439

Closed
UmangKaklotar opened this issue Dec 9, 2024 · 4 comments

Comments

@UmangKaklotar
Copy link

UmangKaklotar commented Dec 9, 2024

What version are you using?

7.1.1

What OS and version are you using to local deploy your application?

iOS 15.0 to 18.0

What platforms are you seeing the problem on?

iOS

pubspec.yaml

flutter_facebook_auth: 7.1.1

Describe the Bug

not getting graph profile information

Expected Behavior

It should work after clicking login button and logging in into facebook

class FacebookAuthHelper {
static Map<String, dynamic> profile = {};

static Future<Map<String, dynamic>> signInFB() async {
try {
await FacebookAuth.instance.login(permissions: ['public_profile', 'email'], loginBehavior: LoginBehavior.dialogOnly).then((loginResult) async {
if (loginResult.status == LoginStatus.success) {
AccessToken? accessToken = loginResult.accessToken;
var graphResponse =
await Dio().get('https://graph.facebook.com/v2.12/me?fields=name,picture.width(800).height(800),first_name,last_name,email&access_token=${accessToken!.tokenString}');
profile = json.decode(graphResponse.data);
accessToken = null;
} else {}
});
} catch(e) {
debugPrint("ERROR --> $e");
}
return profile;
}
}

To Reproduce

access token: Instaance of limited token

Relevant log output

No response

flutter doctor -v

[✓] Flutter (Channel stable, 3.24.3, on macOS 14.5 23F79 darwin-x64, locale en-IN)
[✓] Android toolchain - develop for Android devices (Android SDK version 35.0.0)
[✓] Xcode - develop for iOS and macOS (Xcode 15.4)
[✓] Chrome - develop for the web
[✓] Android Studio (version 2024.1)
[✓] VS Code (version 1.95.3)
[✓] Connected device (4 available)
[✓] Network resources

• No issues found!


### Info.plist (iOS)

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
	<dict>
		<key>CADisableMinimumFrameDurationOnPhone</key>
		<true/>
		<key>CFBundleDevelopmentRegion</key>
		<string>$(DEVELOPMENT_LANGUAGE)</string>
		<key>CFBundleDisplayName</key>
		<string>xxx</string>
		<key>CFBundleExecutable</key>
		<string>$(EXECUTABLE_NAME)</string>
		<key>CFBundleIdentifier</key>
		<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
		<key>CFBundleInfoDictionaryVersion</key>
		<string>6.0</string>
		<key>CFBundleName</key>
		<string>xxx</string>
		<key>CFBundlePackageType</key>
		<string>APPL</string>
		<key>CFBundleShortVersionString</key>
		<string>$(MARKETING_VERSION)</string>
		<key>CFBundleSignature</key>
		<string>????</string>
		<key>CFBundleURLTypes</key>
		<array>
			<dict>
				<key>CFBundleTypeRole</key>
				<string>Editor</string>
				<key>CFBundleURLName</key>
				<string>xxx</string>
				<key>CFBundleURLSchemes</key>
				<array>
					<string>fbxxxx</string>
				</array>
			</dict>
			<dict>
				<key>CFBundleIdentifier</key>
				<string></string>
				<key>CFBundleTypeRole</key>
				<string>Editor</string>
				<key>CFBundleURLName</key>
				<string>xxx</string>
				<key>CFBundleURLSchemes</key>
				<array>
					<string>xxx</string>
				</array>
			</dict>
			<dict>
				<key>CFBundleTypeRole</key>
				<string>Editor</string>
				<key>CFBundleURLSchemes</key>
				<array>
					<string>xxx</string>
				</array>
			</dict>
			<dict>
				<key>CFBundleTypeRole</key>
				<string>Editor</string>
				<key>CFBundleURLSchemes</key>
				<array>
					<string>com.googleusercontent.apps.403694724124-5ac3ttreo0rpho2220g400qp6gnip745</string>
				</array>
			</dict>
			<dict>
				<key>CFBundleTypeRole</key>
				<string>Editor</string>
				<key>CFBundleURLName</key>
				<string></string>
				<key>CFBundleURLSchemes</key>
				<array>
					<string>appfpclientFastpayFlutterSdk</string>
				</array>
			</dict>
		</array>
		<key>CFBundleVersion</key>
		<string>$(CURRENT_PROJECT_VERSION)</string>
		<key>FacebookAppID</key>
		<string>xxx</string>
		<key>FacebookClientToken</key>
		<string>xxxx</string>
		<key>FacebookDisplayName</key>
		<string>xxx</string>
		<key>FlutterDeepLinkingEnabled</key>
		<true/>
		<key>LSApplicationQueriesSchemes</key>
		<array>
			<string>xxx</string>
			<string>fbshareextension</string>
			<string>fbapi</string>
			<string>xxx</string>
			<string>xxx</string>
			<string>xxx</string>
			<string>xxx</string>
			<string>xxx</string>
			<string>xxx</string>
			<string>xxx</string>
			<string>xxx</string>
			<string>xxx</string>
			<string>xxx</string>
			<string>fbauth</string>
			<string>fb-messenger-share-api</string>
			<string>fbauth2</string>
			<string>fb-messenger</string>
			<string>comgooglemaps</string>
			<string>googlechromes</string>
			<string>comgooglemaps-x-callback</string>
			<string>fb</string>
			<string>whatsapp</string>
			<string>ymail</string>
			<string>readdle-spark</string>
			<string>ms-outlook</string>
			<string>googlegmail</string>
		</array>
		<key>LSHasLocalizedDisplayName</key>
		<true/>
		<key>LSRequiresIPhoneOS</key>
		<true/>
		<key>NSAppTransportSecurity</key>
		<dict>
			<key>NSAllowsArbitraryLoads</key>
			<true/>
		</dict>
		<key>NSAppleMusicUsageDescription</key>
		<string>This allows us to use media library.</string>
		<key>NSBluetoothAlwaysUsageDescription</key>
		<string>This allows us to use bluetooth.</string>
		<key>NSBluetoothPeripheralUsageDescription</key>
		<string>This identifier will be used for bluetooth peripheral devices.</string>
		<key>NSCalendarsUsageDescription</key>
		<string>This allows us to access resources accoding to calendar.</string>
		<key>NSCameraUsageDescription</key>
		<string>This allows us to capture image and use as user profile image.</string>
		<key>NSFaceIDUsageDescription</key>
		<string>Why is my app authenticating using face id?</string>
		<key>NSInAppReviewUsageDescription</key>
		<string>App would like to show you the app store review page to rate this app.</string>
		<key>NSLocationAlwaysAndWhenInUseUsageDescription</key>
		<string>This allows us to give you a location based results.</string>
		<key>NSLocationAlwaysUsageDescription</key>
		<string>This allows us to give you a location based results.</string>
		<key>NSLocationUsageDescription</key>
		<string>This allows us to give you a location based results.</string>
		<key>NSLocationWhenInUseUsageDescription</key>
		<string>This allows us to give you a location based results.</string>
		<key>NSMicrophoneUsageDescription</key>
		<string>This allows us to record speech for search.</string>
		<key>NSPhotoLibraryUsageDescription</key>
		<string>This allows us to pick image and use as user profile image.</string>
		<key>NSSpeechRecognitionUsageDescription</key>
		<string>This allows us to recognize speech.</string>
		<key>NSUserTrackingUsageDescription</key>
		<string>This identifier will be used to deliver personalized ads to you</string>
		<key>OneSignal_suppress_launch_urls</key>
		<false/>
		<key>UIApplicationSupportsIndirectInputEvents</key>
		<true/>
		<key>UIBackgroundModes</key>
		<array>
			<string>fetch</string>
			<string>remote-notification</string>
		</array>
		<key>UILaunchStoryboardName</key>
		<string>LaunchScreen</string>
		<key>UIMainStoryboardFile</key>
		<string>Main</string>
		<key>UIStatusBarStyle</key>
		<string></string>
		<key>UISupportedInterfaceOrientations</key>
		<array>
			<string>UIInterfaceOrientationLandscapeLeft</string>
			<string>UIInterfaceOrientationLandscapeRight</string>
			<string>UIInterfaceOrientationPortrait</string>
			<string>UIInterfaceOrientationPortraitUpsideDown</string>
		</array>
		<key>UISupportedInterfaceOrientations~ipad</key>
		<array>
			<string>UIInterfaceOrientationLandscapeLeft</string>
			<string>UIInterfaceOrientationLandscapeRight</string>
			<string>UIInterfaceOrientationPortraitUpsideDown</string>
		</array>
		<key>UIUserInterfaceStyle</key>
		<string>Light</string>
		<key>UIViewControllerBasedStatusBarAppearance</key>
		<false/>
		<key>UIStatusBarHidden</key>
		<false/>
	</dict>
</plist>

### Podfile (iOS)

_No response_

### AndroidManifest.xml

_No response_

### MainActivity.java

_No response_

### MainActivity.kt

_No response_

### index.html

_No response_

### Info.plist (macOS)

_No response_
@darwin-morocho
Copy link
Owner

@UmangKaklotar add a valid reproducible code

@UmangKaklotar
Copy link
Author

class FacebookAuthHelper {
static Map<String, dynamic> profile = {};

static Future<Map<String, dynamic>> signInFB() async {
try {
await FacebookAuth.instance.login(permissions: ['public_profile', 'email'], loginBehavior: LoginBehavior.dialogOnly).then((loginResult) async {
if (loginResult.status == LoginStatus.success) {
AccessToken? accessToken = loginResult.accessToken;
var graphResponse =
await Dio().get('https://graph.facebook.com/v2.12/me?fields=name,picture.width(800).height(800),first_name,last_name,email&access_token=${accessToken!.tokenString}');
profile = json.decode(graphResponse.data);
accessToken = null;
} else {}
});
} catch(e) {
debugPrint("ERROR --> $e");
}
return profile;
}
}

@UmangKaklotar UmangKaklotar reopened this Dec 10, 2024
@darwin-morocho
Copy link
Owner

class FacebookAuthHelper { static Map<String, dynamic> profile = {};

static Future<Map<String, dynamic>> signInFB() async { try { await FacebookAuth.instance.login(permissions: ['public_profile', 'email'], loginBehavior: LoginBehavior.dialogOnly).then((loginResult) async { if (loginResult.status == LoginStatus.success) { AccessToken? accessToken = loginResult.accessToken; var graphResponse = await Dio().get('https://graph.facebook.com/v2.12/me?fields=name,picture.width(800).height(800),first_name,last_name,email&access_token=${accessToken!.tokenString}'); profile = json.decode(graphResponse.data); accessToken = null; } else {} }); } catch(e) { debugPrint("ERROR --> $e"); } return profile; } }

@UmangKaklotar have you tried with https://facebook.meedu.app/docs/7.x.x/user-information ?

@darwin-morocho
Copy link
Owner

Keep in mind that since the limited login was introduced on iOS you cannot use the graph api with access tokens that was got since a limited login

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

No branches or pull requests

2 participants