Ionic - Photo Viewer crashing: 'UIDocumentInteractionController: invalid scheme https.'

599 views Asked by At

I am using the following plugin in Ionic for visualizing an image: @ionic-native/photo-viewer.

When calling the visualization method:

PhotoViewer.show('http://my_site.com/my_image.jpg', 'Optional Title', {share: true});

Everything is working as expected on Android devices/emulators. However, when attempting to call the same method while using an iOS device/emulator the app completely crashes before even visualizing the image. These are the logs from when the application crashes:

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 or might have an idea of how it might be fixed? I have posted the problem on the 'Issues' section in the repository of the plugin, however, since the creator does not have time to support his plugin, I would like to ask for help here. Does anyone have an idea what causes the issue and how it could be fixed?

0

There are 0 answers