Open Thiago97SLA opened 2 years ago
Were you able to fix this i am getting the same issue , only on IOS. Android works fine. I get the app when sharing , on select , it remains at the same screen.
same issues facing me.
arun-gautham have you find some solution to bring back url?
Same issue with iOS 15.2.1
If anyone solve this issue then please share it here, Thank you.
I have not solved it yet , but i know the issue. Its not a plugin issue i guess.
its a problem with Userdefaults (NSUserDefaults) . The plugin actually depends on userDefaults in the SLcontrollerVIew under the suitename:"Appgroupid" which is used to save the file/text/image paths temporarily and then retrieve it once control is returned back to plugin. but unfortunately due to some reason the it is not able to get that , i guess it instantiates another instance instead of retrieving what is stored even though the save is successful and the group id's absolutely match.
The problem could also be limited to simulator ( if you have an actual device , someone please test and let me know) or the Xcode.
As of now this is where i stand. I will also look @ possibility of storing in a file and then retrieving it or any other ways.
Any ways this is not the first time i feel dev on IOS is a Neanderthal approach as versus android.
@arun-gautham Thank you for your detailed response.
About actual device. I have tested on iOS 15.2.1 on iPhone 11 but still the issue remains. When I share something to my flutter app it opens if it’s close but I do not receive any callback from the stream listeners.
I do code in native android but as of now iOS is an alien world to me. Don’t know what could be the issue I have wasted 2 days.
I have found an alternate way for my use case ( only media and other files ). Using Sqlite is working fine instead of UseDefaults. Once I cleanup the code i will put on github , people are welcome to use and improve it further.
@arun-gautham Hey thanks for the update!
My use case falls into other files
I will eagerly wait for your implementation!🙌🏻
Thanks Arun, For putting the effort and sharing your hard work with us. I will try your code soon.
@arun-gautham I have used your code
and also went through the readme modifications from your fork but unfortunately, my app crashed when I share the file.
[unspecified] container_create_or_lookup_app_group_path_by_app_group_identifier: client is not entitled
receive_sharing_intent/SwiftReceiveSharingIntentPlugin.swift:138: Fatal error: Unexpectedly found nil while unwrapping an Optional value
receive_sharing_intent/SwiftReceiveSharingIntentPlugin.swift:138: Fatal error: Unexpectedly found nil while unwrapping an Optional value
* thread #1, queue = 'com.apple.main-thread', stop reason = Fatal error: Unexpectedly found nil while unwrapping an Optional value
frame #0: 0x00000001855c6d7c libswiftCore.dylib`_swift_runtime_on_report
libswiftCore.dylib`_swift_runtime_on_report:
-> 0x1855c6d7c <+0>: ret
libswiftCore.dylib`_swift_reportToDebugger:
0x1855c6d80 <+0>: b 0x1855c6d7c ; _swift_runtime_on_report
libswiftCore.dylib`_swift_shouldReportFatalErrorsToDebugger:
0x1855c6d84 <+0>: adrp x8, 335267
0x1855c6d88 <+4>: ldrb w0, [x8, #0x1e4]
Target 0: (Runner) stopped.
Lost connection to device.
Am I doing something wrong? Let me know if you need more data from my end. Thank you.
The first error seems to tell something wrong with entitlements. can you recheck the other config first
--- share extn
<?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>com.apple.security.application-groups</key>
<array>
<string>"your group id"</string>
</array>
</dict>
</plist>
--- runner entitlement
<?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>com.apple.security.application-groups</key>
<array>
<string>your group id</string>
</array>
<key>com.apple.developer.associated-domains</key>
<array>
<string>applinks:example.com</string>
</array>
</dict>
</plist>
<?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>CFBundleDevelopmentRegion</key>
<string>$(DEVELOPMENT_LANGUAGE)</string>
<key>CFBundleDisplayName</key>
<string>Off Cloud</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>"==>PUT YOUR BUNDLE NAME HERE<=="</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>$(FLUTTER_BUILD_NAME)</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>$(FLUTTER_BUILD_NUMBER)</string>
<key>LSRequiresIPhoneOS</key>
<true/>
<key>UILaunchStoryboardName</key>
<string>LaunchScreen</string>
<key>UIMainStoryboardFile</key>
<string>Main</string>
<key>UISupportedInterfaceOrientations</key>
<array>
<string>UIInterfaceOrientationPortrait</string>
<string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string>
</array>
<key>UISupportedInterfaceOrientations~ipad</key>
<array>
<string>UIInterfaceOrientationPortrait</string>
<string>UIInterfaceOrientationPortraitUpsideDown</string>
<string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string>
</array>
<key>UIViewControllerBasedStatusBarAppearance</key>
<true/>
<key>AppGroupId</key>
<string>$(CUSTOM_GROUP_ID)</string>
<key>CFBundleURLTypes</key>
<array>
<dict>
<key>CFBundleTypeRole</key>
<string>Editor</string>
<key>CFBundleURLSchemes</key>
<array>
<string>ShareMedia-$(PRODUCT_BUNDLE_IDENTIFIER)</string>
</array>
</dict>
</array>
<key>NSPhotoLibraryUsageDescription</key>
<string>xxxxx app requires the Photos Permission to select and upload the photo</string>
</dict>
</plist>
--- share extn info.plist
<?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>AppGroupId</key>
<string>$(CUSTOM_GROUP_ID)</string>
<key>CFBundleDevelopmentRegion</key>
<string>$(DEVELOPMENT_LANGUAGE)</string>
<key>CFBundleDisplayName</key>
<string>alternateStore</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>$(PRODUCT_NAME)</string>
<key>CFBundlePackageType</key>
<string>XPC!</string>
<key>CFBundleShortVersionString</key>
<string>$(FLUTTER_BUILD_NAME)</string>
<key>CFBundleVersion</key>
<string>$(CURRENT_PROJECT_VERSION)</string>
<key>NSExtension</key>
<dict>
<key>NSExtensionAttributes</key>
<dict>
<key>NSExtensionActivationRule</key>
<dict>
<key>NSExtensionActivationSupportsFileWithMaxCount</key>
<integer>1</integer>
<key>NSExtensionActivationSupportsImageWithMaxCount</key>
<integer>100</integer>
<key>NSExtensionActivationSupportsMovieWithMaxCount</key>
<integer>100</integer>
<key>NSExtensionActivationSupportsText</key>
<true/>
<key>NSExtensionActivationSupportsWebURLWithMaxCount</key>
<integer>1</integer>
</dict>
<key>PHSupportedMediaTypes</key>
<array>
<string>Video</string>
<string>Image</string>
</array>
</dict>
<key>NSExtensionMainStoryboard</key>
<string>MainInterface</string>
<key>NSExtensionPointIdentifier</key>
<string>com.apple.share-services</string>
</dict>
</dict>
</plist>
Thanks, @arun-gautham I will try the code again tognight!
Hello, again @arun-gautham I verified the above steps. And when I share something from the simulator then it works. but when I try receiving with the reading device (iPhone 11) app exits with the below error (Similar error as earlier).
Have you tested your app with the real device?
[VERBOSE-2:FlutterObservatoryPublisher.mm(143)] Could not register as server for FlutterObservatoryPublisher. Check your network settings and relaunch the application.
[connection] nw_read_request_report [C3] Receive failed with error "Software caused connection abort"
[unspecified] container_create_or_lookup_app_group_path_by_app_group_identifier: client is not entitled
receive_sharing_intent/SwiftReceiveSharingIntentPlugin.swift:138: Fatal error: Unexpectedly found nil while unwrapping an Optional value
receive_sharing_intent/SwiftReceiveSharingIntentPlugin.swift:138: Fatal error: Unexpectedly found nil while unwrapping an Optional value
* thread #1, queue = 'com.apple.main-thread', stop reason = Fatal error: Unexpectedly found nil while unwrapping an Optional value
frame #0: 0x00000001855c6d7c libswiftCore.dylib`_swift_runtime_on_report
libswiftCore.dylib`_swift_runtime_on_report:
-> 0x1855c6d7c <+0>: ret
libswiftCore.dylib`_swift_reportToDebugger:
0x1855c6d80 <+0>: b 0x1855c6d7c ; _swift_runtime_on_report
libswiftCore.dylib`_swift_shouldReportFatalErrorsToDebugger:
0x1855c6d84 <+0>: adrp x8, 335267
0x1855c6d88 <+4>: ldrb w0, [x8, #0x1e4]
Target 0: (Runner) stopped.
@arun-gautham I tried your library. Everything goes well with the images from gallery, but when I make screenshot it gives me this error:
Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Modifications to the layout engine must not be performed from a background thread after it has been accessed from the main thread.'
Let me check it once and get back
I am implementing version 1.4.5 and I have followed different recommendations of using previous versions and it doesn't work either when bringing the url of the files. my IOS version is 14.8. when using receive_sharing_intent and when sharing a file it does not load.