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

[ BUG ] : Not actually posted on facebook #282

Open
keanallen opened this issue May 14, 2024 · 2 comments
Open

[ BUG ] : Not actually posted on facebook #282

keanallen opened this issue May 14, 2024 · 2 comments
Assignees
Labels
Appinio social share This label is used to indicate that this issue belongs to Appinio social share plugin

Comments

@keanallen
Copy link

keanallen commented May 14, 2024

Plugin name
Appinio social share

Describe the bug
I implemented facebook sharing, I tried to share a screenshot from my device. The preview of the image to be shared is successfully rendered on the facebook pre-post preview, but when I started to click on "Post" it shows a successful message saying "Shared to facebook", but it is not actually shared.

Expected behavior
It should be posted on my timeline.

Screenshots
none

NOTE
This works on android. But not in iOS

Smartphone:

  • Device: iPhone 13 Pro
  • OS: iOS latest

Additional context

ListTile(
                  leading: const FaIcon(FontAwesomeIcons.facebook),
                  title: const Text('Share on Facebook'),
                  onTap: () async {
                    requestStoragePermission();

                    await screenshotController
                        .capture(delay: const Duration(milliseconds: 10))
                        .then((image) async {
                      if (image != null) {
                        String fileName =
                            DateFormat('yyyyMMddHHmmss').format(DateTime.now());
                        final directory = Platform.isIOS
                            ? await getApplicationDocumentsDirectory()
                            : await getExternalStorageDirectory(); // Use getExternalStorageDirectory instead
                        final imagePath = '${directory!.path}/$fileName.png';
                        File imageFile = File(imagePath);
                        try {
                          // Save the captured image to the device
                          await File(imagePath).writeAsBytes(image);
                          print('Image saved at: $imagePath');
                          // Check if the file exists after saving
                          if (await imageFile.exists()) {
                            print('Image file exists after saving');
                          } else {
                            print('Image file does not exist after saving');
                          }
                          // Share the saved image to Facebook
                          await AppinioSocialShare()
                              .shareToFacebook('', [imagePath]);
                        } catch (e) {
                          print('Error saving image: $e');
                        }
                      }
                    });
                    Navigator.pop(context);
                  },
                ),

Info.plist

<key>CFBundleURLTypes</key>
		<array>
			<dict>
				<key>CFBundleURLSchemes</key>
				<array>
					<string>fbf2625472f954a01ec1c88eceaab08e2b</string>
				</array>
			</dict>
		</array>

		<key>LSApplicationQueriesSchemes</key>
		<array>
			<string>instagram</string>
			<string>fb</string>
			<string>fbauth2</string>
			<string>fbshareextension</string>
			<string>fbapi</string>
			<string>facebook-reels</string>
			<string>facebook-stories</string>
			<string>fb-messenger-share-api</string>
			<string>fb-messenger</string>
			<string>tg</string>
			<string>whatsapp</string>
			<string>twitter</string>
		</array>

		<key>NSPhotoLibraryUsageDescription</key>
		<string>$(PRODUCT_NAME) needs permission to access photos and videos on your device</string>
		<key>NSCameraUsageDescription</key>
		<string>$(PRODUCT_NAME) requires access to the camera.</string>
		<key>NSAppleMusicUsageDescription</key>
		<string>$(PRODUCT_NAME) requires access to play music</string>

		<key>FacebookAppID</key>
		<string>395107006792804</string>
		<key>FacebookClientToken</key>
		<string>f2625472f954a01ec1c88eceaab08e2b</string>
		<key>FacebookDisplayName</key>
		<string>Puro - Hearing Test</string>

		<key>NSBonjourServices</key>
		<array>
			<string>_dartobservatory._tcp</string>
		</array>
@keanallen
Copy link
Author

Need insight on this. As we are scheduled to go live this friday.

@keanallen
Copy link
Author

@khanmujeeb687 any feedback?

@khanmujeeb687 khanmujeeb687 added the Appinio social share This label is used to indicate that this issue belongs to Appinio social share plugin label Jul 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Appinio social share This label is used to indicate that this issue belongs to Appinio social share plugin
Projects
None yet
Development

No branches or pull requests

2 participants