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

iOS crash also with the #66 workaround #84

Closed
Sabatin opened this issue Sep 2, 2021 · 4 comments
Closed

iOS crash also with the #66 workaround #84

Sabatin opened this issue Sep 2, 2021 · 4 comments

Comments

@Sabatin
Copy link

Sabatin commented Sep 2, 2021

Hi everyone!
I've seen how to get around the sudden crash on iOS devices when trying to share a story on Instagram, in the #66 issue (ty @jkronlachner). But, on my physical iPhone 11, the application still crashes. And i don't know how to fix it.
Thanks in advance for the support.

I added this in my pubspec.yaml

social_share: 
    git: 
      url: https://github.com/ShekarMudaliyar/social_share.git #^2.1.1

And I added this in my Info.plist file (following the installation guide)

<key>LSApplicationQueriesSchemes</key>
		<array>
			<string>instagram-stories</string>
			<string>facebook-stories</string>
			<string>facebook</string>
			<string>instagram</string>
			<string>twitter</string>
			<string>whatsapp</string>
			<string>tg</string>
		</array>

Last but not least, i am sharing on instagram in this way (using the screenshot plugin):

  final directory = await getApplicationDocumentsDirectory();
  final imagePath = await File('${directory.path}/image.png').create();
  await imagePath.writeAsBytes(image);

   /// Share Plugin
   SocialShare.shareInstagramStory(imagePath.path).then((data) => print(data));

Also tried something like this (because i see something related to use a BG image to fix the error):

SocialShare.shareInstagramStory(imagePath.path,
                  backgroundImagePath: path.storyBG)
              .then((data) => print(data));    

This is the error i get in the console on click on the share button

*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '*** -[__NSPlaceholderDictionary initWithObjects:forKeys:count:]: attempt to insert nil object from objects[0]'
*** First throw call stack:
(0x18ed0e708 0x1a38187a8 0x18ed809c8 0x18ed8ca20 0x18ebfb4c0 0x18ebedde0 0x10703c1a4 0x107950694 0x1070f0038 0x1073ef41c 0x10738e81c 0x107390ed4 0x18ec891d4 0x18ec88dd0 0x18ec88220 0x18ec81fd4 0x18ec81308 0x1a6304734 0x1916ff75c 0x191704fcc 0x102ba8f70 0x18e93dcf8)
libc++abi: terminating with uncaught exception of type NSException
* thread #1, queue = 'com.apple.main-thread', stop reason = signal SIGABRT
    frame #0: 0x00000001bcef9334 libsystem_kernel.dylib`__pthread_kill + 8
libsystem_kernel.dylib`__pthread_kill:
->  0x1bcef9334 <+8>:  b.lo   0x1bcef9354               ; <+40>
    0x1bcef9338 <+12>: pacibsp
    0x1bcef933c <+16>: stp    x29, x30, [sp, #-0x10]!
    0x1bcef9340 <+20>: mov    x29, sp
@Sabatin
Copy link
Author

Sabatin commented Sep 3, 2021

Solved using the 2.1.0 version and not the 2.1.1

@Sabatin Sabatin closed this as completed Sep 3, 2021
@btbishop93
Copy link

Solved using the 2.1.0 version and not the 2.1.1

This is still happening on 2.1.0...

@DennisAshford
Copy link

DennisAshford commented Feb 25, 2022

I am also having this same issue and not sure how to fix it. This is clearly an issue many people are having, but it isn't clear if there has been a solution?

@cs-hyunseo
Copy link

Still no solution?

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

No branches or pull requests

4 participants