KasemJaffer / receive_sharing_intent

A Flutter plugin that enables flutter apps to receive sharing photos, text and url from other apps.
Apache License 2.0
334 stars 395 forks source link

[iOS] Fatal error: null value for a non-nullable variable #303

Open jagomf opened 5 months ago

jagomf commented 5 months ago

I am using version 1.8.0 of this plugin and Flutter 3.22.1 (can't confirm if this was happening in prior versions since this feature was not being thoroughly tested)

Sharing a picture to my app in iOS works only for the 1st time. All subsequent times, app just breaks upon receiving shared image and all I get in the console is:

receive_sharing_intent/SwiftReceiveSharingIntentPlugin.swift:192: Fatal error: Unexpectedly found nil while unwrapping an Optional value

xingxingc commented 5 months ago

How fix this?

xingxingc commented 5 months ago

WeChat608b8181d3819560f50261ffd33066db

tomislavmiksik commented 5 months ago

Have you found the solution yet ? I am having the same issue, except it doesn't work at all not even the first time...

xingxingc commented 5 months ago

Have you found the solution yet ? I am having the same issue, except it doesn't work at all not even the first time...

I haven't solved it yet. Currently, I manually made another conversion when encodData is empty, which can avoid application crashes. However, sometimes it may not run properly when receiving files. image

tomislavmiksik commented 2 months ago

Tested on my example, works fine, are there any other things I should be careful of or check ? Thanks for help