photoviewer icon indicating copy to clipboard operation
photoviewer copied to clipboard

Crashes iOS app: 'UIDocumentInteractionController: invalid scheme https.'

Open eddyjusufi opened this issue 6 years ago • 6 comments

Running this plugin in an Ionic 3 application. Photo viewer works perfectly fine on Android, however triggering Photo view on any iOS device/emulator crashes the whole app. Here is the console log:

2018-07-30 21:20:05.706360+0100 MyApp[23373:2960263] THREAD WARNING: ['PhotoViewer'] took '25.631104' ms. Plugin should use a background thread.
2018-07-30 21:20:06.442060+0100 MyApp[23373:2961920] * Assertion failure in -[UIDocumentInteractionController setURL:], /BuildRoot/Library/Caches/com.apple.xbs/Sources/UIKit_Sim/UIKit-3698.54.4/Source/DocumentInteraction/UIDocumentInteractionController.m:183
2018-07-30 21:20:06.453089+0100 MyApp[23373:2961920] * Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'UIDocumentInteractionController: invalid scheme https.  Only the file scheme is supported.'
* First throw call stack:
(
	0   CoreFoundation                      0x00000001115b71e6 __exceptionPreprocess + 294
	1   libobjc.A.dylib                     0x00000001104b8031 objc_exception_throw + 48
	2   CoreFoundation                      0x00000001115bc472 +[NSException raise:format:arguments:] + 98
	3   Foundation                          0x000000010ea75652 -[NSAssertionHandler handleFailureInMethod:object:file:lineNumber:description:] + 193
	4   UIKit                               0x000000010d01db3e -[UIDocumentInteractionController setURL:] + 702
	5   UIKit                               0x000000010d01d140 -[UIDocumentInteractionController initWithURL:] + 130
	6   UIKit                               0x000000010d01d0a2 +[UIDocumentInteractionController interactionControllerWithURL:] + 65
	7   MyApp                                0x000000010b539420 -[PhotoViewer setupDocumentControllerWithURL:andTitle:] + 160
	8   MyApp                                0x000000010b53a25b __20-[PhotoViewer show:]_block_invoke + 347
	9   libdispatch.dylib                   0x0000000112b0b7ab _dispatch_call_block_and_release + 12
	10  libdispatch.dylib                   0x0000000112b0c7ec _dispatch_client_callout + 8
	11  libdispatch.dylib                   0x0000000112b11619 _dispatch_queue_override_invoke + 1451
	12  libdispatch.dylib                   0x0000000112b1836c _dispatch_root_queue_drain + 664
	13  libdispatch.dylib                   0x0000000112b18076 _dispatch_worker_thread3 + 132
	14  libsystem_pthread.dylib             0x0000000113037169 _pthread_wqthread + 1387
	15  libsystem_pthread.dylib             0x0000000113036be9 start_wqthread + 13
)
libc++abi.dylib: terminating with uncaught exception of type NSException
(lldb)

Has anyone encountered this issue before and possible know how it can be fixed?

eddyjusufi avatar Jul 30 '18 22:07 eddyjusufi

did you find solution to this?

mubasshir avatar Aug 01 '18 12:08 mubasshir

@mubasshir I am still looking for solution or feedback from @sarriaroman. Would appreciate help from anyone who managed to fix the issue as well.

eddyjusufi avatar Aug 01 '18 15:08 eddyjusufi

should close this source? I can not use for my app so long.?

MichaelHuy avatar Sep 14 '18 08:09 MichaelHuy

ionic cordova plugin rm com-sarriaroman-photoviewer ionic cordova plugin add [email protected] npm install --save @ionic-native/photo-viewer

jnettome avatar Jan 30 '20 19:01 jnettome

Thanks

mubasshir avatar Feb 01 '20 11:02 mubasshir

ionic cordova plugin rm com-sarriaroman-photoviewer ionic cordova plugin add [email protected] npm install --save @ionic-native/photo-viewer

I did this, still facing problem with photo url as http://, not file://

alaswer avatar Apr 18 '20 08:04 alaswer