wonday / react-native-pdf

A <Pdf /> component for react-native
MIT License
1.58k stars 544 forks source link

Open PDF-URL with Port #170

Open ManAnRuck opened 6 years ago

ManAnRuck commented 6 years ago

Hi, I get some PDF-Urls with Ports in the url. But in xCode I get the following error. When I remove :80 it works.

2018-05-28 15:05:15.177 [info][tid:main][RCTRootView.m:295] Running application democracy.Pdf ({
    initialProps =     {
        commandType = Push;
        isPreview = 0;
        navigatorEventID = "screenInstanceID4_events";
        navigatorID = "controllerID1_nav";
        screenInstanceID = screenInstanceID4;
        timestamp = 1527512715173;
        url = "http://dipbt.bundestag.de:80/dip21/btd/19/009/1900931.pdf";
    };
    rootTag = 31;
})
=================================================================
Main Thread Checker: UI API called on a background thread: -[UIApplication setNetworkActivityIndicatorVisible:]
PID: 22240, TID: 133278, Thread name: (none), Queue name: NSOperationQueue 0x600000636960 (QOS: UNSPECIFIED), QoS: 0
Backtrace:
4   democracyclient                     0x00000001081caa03 -[RNFetchBlobNetwork URLSession:task:didCompleteWithError:] + 291
5   CFNetwork                           0x000000010a0f5437 __51-[NSURLSession delegate_task:didCompleteWithError:]_block_invoke.207 + 80
6   Foundation                          0x0000000108a40363 __NSBLOCKOPERATION_IS_CALLING_OUT_TO_A_BLOCK__ + 7
7   Foundation                          0x0000000108a401ca -[NSBlockOperation main] + 68
8   Foundation                          0x0000000108a3e6b2 -[__NSOperationInternal _start:] + 766
9   libdispatch.dylib                   0x000000010f3d6848 _dispatch_client_callout + 8
10  libdispatch.dylib                   0x000000010f3dbe14 _dispatch_block_invoke_direct + 592
11  libdispatch.dylib                   0x000000010f3d6848 _dispatch_client_callout + 8
12  libdispatch.dylib                   0x000000010f3dbe14 _dispatch_block_invoke_direct + 592
13  libdispatch.dylib                   0x000000010f3dbba4 dispatch_block_perform + 109
14  Foundation                          0x0000000108a3a75b __NSOQSchedule_f + 337
15  libdispatch.dylib                   0x000000010f3d6848 _dispatch_client_callout + 8
16  libdispatch.dylib                   0x000000010f3dcb35 _dispatch_continuation_pop + 967
17  libdispatch.dylib                   0x000000010f3dafb0 _dispatch_async_redirect_invoke + 780
18  libdispatch.dylib                   0x000000010f3e23c8 _dispatch_root_queue_drain + 664
19  libdispatch.dylib                   0x000000010f3e20d2 _dispatch_worker_thread3 + 132
20  libsystem_pthread.dylib             0x000000010f901169 _pthread_wqthread + 1387
21  libsystem_pthread.dylib             0x000000010f900be9 start_wqthread + 13

I know that port 80 is not necessary, but when I have another port it does not work.

marksturm commented 6 years ago

Quick Fix: Replace the :80 in the url from the Bundestag. Its not necessary.

ManAnRuck commented 6 years ago

@marksturm thanks ;) this is my current dirty quick fix. But it will be better if this repo support port-urls.

marksturm commented 6 years ago

im not sure, if react-native-fetchblob supports a port. But you will run into a lot more issues by try to show pdf files in rn :) Dont get me wrong, Wonday did a great work, but there are limits.

wonday commented 6 years ago

@ReggaePanda you are right, with port can not download. I tested with my example and it is OK, but it used cache.... my mistake.