Pushwoosh / pushwoosh-react-native-plugin

Other
58 stars 44 forks source link

iOS: "unsupported URL" error while "Pushwoosh.init" in release build #32

Closed ASerga closed 6 years ago

ASerga commented 6 years ago

Code example

Pushwoosh.init({
    pw_appid: "XXXXX"
  });
  Pushwoosh.setUserId("XXXXX");
  Pushwoosh.register(
    token => {
      console.log("Registered for push notifications with token: " + token);
    },
    error => {
      alert(error);   // "unsupported URL"
    }
  );

Reproduce:

  1. Run application on device via XCode using Build Configuration=Release
  2. iOS Allow notification confirmation appears successfully
  3. After taping "Allow" this error appears (unsupported URL)

Enviroment:

XCode console logs (private data replaced with XXXXXXX)

2018-07-25 18:34:51.552951+0300 Myapp[3135:1280230] Pushwoosh: Initializing application runtime
2018-07-25 18:34:51.964254+0300 Myapp[3135:1280346] [branch.io] Branch.m(192) Log: Branch version 0.24.1 started at 2018-07-25 15:34:51 +0000.
2018-07-25 18:34:52.021294+0300 Myapp[3135:1280354] [MC] System group container for systemgroup.com.apple.configurationprofiles path is /private/var/containers/Shared/SystemGroup/systemgroup.com.apple.configurationprofiles
2018-07-25 18:34:52.025633+0300 Myapp[3135:1280354] [MC] Reading from public effective user settings.
2018-07-25 18:34:52.122654+0300 Myapp[3135:1280230] [Crashlytics] Version 3.9.3 (128)
2018-07-25 18:34:52.319756+0300 Myapp[3135:1280230] Could not successfully update network info during initialization.
2018-07-25 18:34:52.670100+0300 Myapp[3135:1280230] Setting up RNFirebase instance
2018-07-25 18:34:52.768439+0300 Myapp[3135:1280346] TIC Read Status [3:0x0]: 1:57
2018-07-25 18:34:52.768511+0300 Myapp[3135:1280346] TIC Read Status [3:0x0]: 1:57
2018-07-25 18:34:52.844918+0300 Myapp[3135:1280230] Could not successfully update network info during initialization.
2018-07-25 18:34:52.901867+0300 Myapp[3135:1280369] TIC Read Status [1:0x0]: 1:57
2018-07-25 18:34:52.902371+0300 Myapp[3135:1280369] TIC Read Status [1:0x0]: 1:57
2018-07-25 18:34:53.203600+0300 Myapp[3135:1280358] TIC Read Status [8:0x0]: 1:57
2018-07-25 18:34:53.204929+0300 Myapp[3135:1280358] TIC Read Status [8:0x0]: 1:57
2018-07-25 18:34:53.268107+0300 Myapp[3135:1280358] TIC Read Status [6:0x0]: 1:57
2018-07-25 18:34:53.269401+0300 Myapp[3135:1280358] TIC Read Status [6:0x0]: 1:57
2018-07-25 18:34:53.419629+0300 Myapp[3135:1280358] TIC Read Status [7:0x0]: 1:57
2018-07-25 18:34:53.419697+0300 Myapp[3135:1280358] TIC Read Status [7:0x0]: 1:57
2018-07-25 18:34:53.605523+0300 Myapp[3135:1280230] Sentry Started -- Version: 3.12.4
    ************************ Crash Handler Notice ************************
    *     App is running in a debugger. Masking out unsafe monitors.     *
    * This means that most crashes WILL NOT BE RECORDED while debugging! *
    **********************************************************************
INFO : KSCrash.m (346): -[KSCrash sendAllReportsWithCompletion:]: Sending 0 crash reports
=================================================================
Main Thread Checker: UI API called on a background thread: -[UIApplication applicationState]
PID: 3135, TID: 1280370, Thread name: (none), Queue name: com.facebook.react.RNAmplitudeSDKQueue, QoS: 0
Backtrace:
4   Preply                              0x00000001007aaa84 -[Amplitude initializeApiKey:userId:setUserId:] + 372
5   Preply                              0x000000010096fcd4 -[RNAmplitudeSDK initialize:setTrackSessionEvents:] + 140
6   CoreFoundation                      0x0000000185a2e580 <redacted> + 144
7   CoreFoundation                      0x000000018590d748 <redacted> + 284
8   CoreFoundation                      0x000000018591256c <redacted> + 60
9   Preply                              0x00000001008e17c8 -[RCTModuleMethod invokeWithBridge:module:arguments:] + 492
10  Preply                              0x000000010092553c _ZN8facebook5reactL11invokeInnerEP9RCTBridgeP13RCTModuleDatajRKN5folly7dynamicE + 260
11  Preply                              0x000000010092529c ___ZN8facebook5react15RCTNativeModule6invokeEjON5folly7dynamicEi_block_invoke + 88
12  libdispatch.dylib                   0x00000001015491dc _dispatch_call_block_and_release + 24
13  libdispatch.dylib                   0x000000010154919c _dispatch_client_callout + 16
14  libdispatch.dylib                   0x0000000101557dfc _dispatch_queue_serial_drain + 768
15  libdispatch.dylib                   0x000000010154c6ac _dispatch_queue_invoke + 328
16  libdispatch.dylib                   0x0000000101558d54 _dispatch_root_queue_drain_deferred_wlh + 352
17  libdispatch.dylib                   0x000000010155fe38 _dispatch_workloop_worker_thread + 676
18  libsystem_pthread.dylib             0x000000018564be70 _pthread_wqthread + 860
19  libsystem_pthread.dylib             0x000000018564bb08 start_wqthread + 4
2018-07-25 18:34:53.914450+0300 Myapp[3135:1280370] [reports] Main Thread Checker: UI API called on a background thread: -[UIApplication applicationState]
PID: 3135, TID: 1280370, Thread name: (none), Queue name: com.facebook.react.RNAmplitudeSDKQueue, QoS: 0
Backtrace:
4   Preply                              0x00000001007aaa84 -[Amplitude initializeApiKey:userId:setUserId:] + 372
5   Preply                              0x000000010096fcd4 -[RNAmplitudeSDK initialize:setTrackSessionEvents:] + 140
6   CoreFoundation                      0x0000000185a2e580 <redacted> + 144
7   CoreFoundation                      0x000000018590d748 <redacted> + 284
8   CoreFoundation                      0x000000018591256c <redacted> + 60
9   Preply                              0x00000001008e17c8 -[RCTModuleMethod invokeWithBridge:module:arguments:] + 492
12  libdispatch.dylib                   0x00000001015491dc _dispatch_call_block_and_release + 24
13  libdispatch.dylib                   0x000000010154919c _dispatch_client_callout + 16
14  libdispatch.dylib                   0x0000000101557dfc _dispatch_queue_serial_drain + 768
15  libdispatch.dylib                   0x000000010154c6ac _dispatch_queue_invoke + 328
16  libdispatch.dylib                   0x0000000101558d54 _dispatch_root_queue_drain_deferred_wlh + 352
17  libdispatch.dylib                   0x000000010155fe38 _dispatch_workloop_worker_thread + 676
18  libsystem_pthread.dylib             0x000000018564be70 _pthread_wqthread + 860
19  libsystem_pthread.dylib             0x000000018564bb08 start_wqthread + 4
2018-07-25 18:34:55.297835+0300 Myapp[3135:1280375] Could not successfully update network info during initialization.
2018-07-25 18:34:55.408534+0300 Myapp[3135:1280342] TIC Read Status [10:0x0]: 1:57
2018-07-25 18:34:55.408646+0300 Myapp[3135:1280342] TIC Read Status [10:0x0]: 1:57
2018-07-25 18:34:55.551963+0300 Myapp[3135:1280371] Could not successfully update network info during initialization.
2018-07-25 18:34:55.555023+0300 Myapp[3135:1280356] Missing server connection for kCTConnectionInvalidatedNotification
2018-07-25 18:35:00.058746+0300 Myapp[3135:1280230] Status bar could not find cached time string image. Rendering in-process.
2018-07-25 18:35:06.861109+0300 Myapp[3135:1280343] TIC Read Status [11:0x0]: 1:57
2018-07-25 18:35:06.861261+0300 Myapp[3135:1280343] TIC Read Status [11:0x0]: 1:57
2018-07-25 18:35:07.143033+0300 Myapp[3135:1280539] TIC Read Status [12:0x0]: 1:57
2018-07-25 18:35:07.143185+0300 Myapp[3135:1280539] TIC Read Status [12:0x0]: 1:57
2018-07-25 18:35:07.365260+0300 Myapp[3135:1280343] TIC Read Status [13:0x0]: 1:57
2018-07-25 18:35:07.365416+0300 Myapp[3135:1280343] TIC Read Status [13:0x0]: 1:57
2018-07-25 18:35:11.933770+0300 Myapp[3135:1280539] Could not successfully update network info during initialization.
2018-07-25 18:35:17.492479+0300 Myapp[3135:1280371] TIC Read Status [14:0x0]: 1:57
2018-07-25 18:35:17.492592+0300 Myapp[3135:1280371] TIC Read Status [14:0x0]: 1:57
2018-07-25 18:35:22.363437+0300 Myapp[3135:1280534] TIC Read Status [15:0x0]: 1:57
2018-07-25 18:35:22.363597+0300 Myapp[3135:1280534] TIC Read Status [15:0x0]: 1:57
2018-07-25 18:35:41.853364+0300 Myapp[3135:1280230] [PW] HWID: XXXXXXX-XXXX-XXXX-XXXX-E05B8F6613AC
2018-07-25 18:35:41.858394+0300 Myapp[3135:1280230] [PW] [I] -[PushNotificationManager] Will show push notifications alert: 1
2018-07-25 18:35:41.886377+0300 Myapp[3135:1280535] Could not successfully update network info during initialization.
2018-07-25 18:35:42.125119+0300 Myapp[3135:1280230] [PW] [E] -[PWRequestManager] Sending registerUser failed, Error Domain=NSURLErrorDomain Code=-1002 "unsupported URL" UserInfo={NSLocalizedDescription=unsupported URL, NSUnderlyingError=0x143069440 {Error Domain=kCFErrorDomainCFNetwork Code=-1002 "(null)"}}
2018-07-25 18:35:42.125938+0300 Myapp[3135:1280230] [PW] [I] -[PWLocationHelper] location services authorization status has not been determined yet
2018-07-25 18:35:42.151319+0300 Myapp[3135:1280230] [PW] [E] -[PWRequestManager] Sending getInApps failed, Error Domain=NSURLErrorDomain Code=-1002 "unsupported URL" UserInfo={NSLocalizedDescription=unsupported URL, NSUnderlyingError=0x143069650 {Error Domain=kCFErrorDomainCFNetwork Code=-1002 "(null)"}}
2018-07-25 18:35:42.162890+0300 Myapp[3135:1280230] [PW] [E] -[PWRequestManager] Sending applicationOpen failed, Error Domain=NSURLErrorDomain Code=-1002 "unsupported URL" UserInfo={NSLocalizedDescription=unsupported URL, NSUnderlyingError=0x141fcb2a0 {Error Domain=kCFErrorDomainCFNetwork Code=-1002 "(null)"}}
2018-07-25 18:35:42.163036+0300 Myapp[3135:1280230] [PW] [I] -[PWDataManagerCommon] sending appOpen failed
2018-07-25 18:35:42.164620+0300 Myapp[3135:1280230] [PW] [E] -[PWRequestManager] Sending getTags failed, Error Domain=NSURLErrorDomain Code=-1002 "unsupported URL" UserInfo={NSLocalizedDescription=unsupported URL, NSUnderlyingError=0x141f693b0 {Error Domain=kCFErrorDomainCFNetwork Code=-1002 "(null)"}}
2018-07-25 18:35:42.164712+0300 Myapp[3135:1280230] [PW] [D] -[PWDataManagerCommon] loadTags completed
2018-07-25 18:35:42.166264+0300 Myapp[3135:1280230] [PW] [E] -[PWDataManagerCommon] loadTags failed
2018-07-25 18:35:42.172122+0300 Myapp[3135:1280230] [PW] [E] -[PWRequestManager] Sending registerUser failed, Error Domain=NSURLErrorDomain Code=-1002 "unsupported URL" UserInfo={NSLocalizedDescription=unsupported URL, NSUnderlyingError=0x143060600 {Error Domain=kCFErrorDomainCFNetwork Code=-1002 "(null)"}}
2018-07-25 18:35:42.178206+0300 Myapp[3135:1280230] [PW] [E] -[PWRequestManager] Sending setAttributes failed, Error Domain=NSURLErrorDomain Code=-1002 "unsupported URL" UserInfo={NSLocalizedDescription=unsupported URL, NSUnderlyingError=0x141fdc940 {Error Domain=kCFErrorDomainCFNetwork Code=-1002 "(null)"}}
=================================================================
Main Thread Checker: UI API called on a background thread: -[UIApplication isRegisteredForRemoteNotifications]
PID: 3135, TID: 1280534, Thread name: (none), Queue name: NSOperationQueue 0x14306f9b0 (QOS: UTILITY), QoS: 17
Backtrace:
4   Preply                              0x00000001008990b4 -[PWNotificationManagerCompatiOS10 getRemoteNotificationStatusWithCompletion:] + 220
5   Preply                              0x000000010087644c +[PWPushNotificationsManagerCommon getRemoteNotificationStatus] + 264
6   Preply                              0x000000010087060c -[PWAppOpenRequest requestDictionary] + 564
7   Preply                              0x000000010089ec30 -[PWCachedRequest initWithRequest:] + 136
8   Preply                              0x0000000100885940 __39-[PWRequestsCacheManager cacheRequest:]_block_invoke + 84
9   Foundation                          0x000000018644ee88 <redacted> + 16
10  Foundation                          0x00000001863908d0 <redacted> + 72
11  Foundation                          0x000000018638fcac <redacted> + 848
12  libdispatch.dylib                   0x000000010154919c _dispatch_client_callout + 16
13  libdispatch.dylib                   0x00000001015557cc _dispatch_block_invoke_direct + 232
14  libdispatch.dylib                   0x000000010154919c _dispatch_client_callout + 16
15  libdispatch.dylib                   0x00000001015557cc _dispatch_block_invoke_direct + 232
16  libdispatch.dylib                   0x00000001015556b0 dispatch_block_perform + 104
17  Foundation                          0x0000000186450750 <redacted> + 376
18  libdispatch.dylib                   0x000000010154919c _dispatch_client_callout + 16
19  libdispatch.dylib                   0x0000000101556454 _dispatch_continuation_pop + 588
20  libdispatch.dylib                   0x0000000101554d44 _dispatch_async_redirect_invoke + 628
21  libdispatch.dylib                   0x000000010155a7c8 _dispatch_root_queue_drain + 604
22  libdispatch.dylib                   0x000000010155a500 _dispatch_worker_thread3 + 136
23  libsystem_pthread.dylib             0x000000018564bfac _pthread_wqthread + 1176
24  libsystem_pthread.dylib             0x000000018564bb08 start_wqthread + 4
2018-07-25 18:35:42.220248+0300 Myapp[3135:1280534] [reports] Main Thread Checker: UI API called on a background thread: -[UIApplication isRegisteredForRemoteNotifications]
PID: 3135, TID: 1280534, Thread name: (none), Queue name: NSOperationQueue 0x14306f9b0 (QOS: UTILITY), QoS: 17
Backtrace:
4   Preply                              0x00000001008990b4 -[PWNotificationManagerCompatiOS10 getRemoteNotificationStatusWithCompletion:] + 220
5   Preply                              0x000000010087644c +[PWPushNotificationsManagerCommon getRemoteNotificationStatus] + 264
6   Preply                              0x000000010087060c -[PWAppOpenRequest requestDictionary] + 564
7   Preply                              0x000000010089ec30 -[PWCachedRequest initWithRequest:] + 136
8   Preply                              0x0000000100885940 __39-[PWRequestsCacheManager cacheRequest:]_block_invoke + 84
9   Foundation                          0x000000018644ee88 <redacted> + 16
10  Foundation                          0x00000001863908d0 <redacted> + 72
11  Foundation                          0x000000018638fcac <redacted> + 848
12  libdispatch.dylib                   0x000000010154919c _dispatch_client_callout + 16
13  libdispatch.dylib                   0x00000001015557cc _dispatch_block_invoke_direct + 232
14  libdispatch.dylib                   0x000000010154919c _dispatch_client_callout + 16
15  libdispatch.dylib                   0x00000001015557cc _dispatch_block_invoke_direct + 232
16  libdispatch.dylib                   0x00000001015556b0 dispatch_block_perform + 104
17  Foundation                          0x0000000186450750 <redacted> + 376
18  libdispatch.dylib                   0x000000010154919c _dispatch_client_callout + 16
19  libdispatch.dylib                   0x0000000101556454 _dispatch_continuation_pop + 588
20  libdispatch.dylib                   0x0000000101554d44 _dispatch_async_redirect_invoke + 628
21  libdispatch.dylib                   0x000000010155a7c8 _dispatch_root_queue_drain + 604
22  libdispatch.dylib                   0x000000010155a500 _dispatch_worker_thread3 + 136
23  libsystem_pthread.dylib             0x000000018564bfac _pthread_wqthread + 1176
24  libsystem_pthread.dylib             0x000000018564bb08 start_wqthread + 4
2018-07-25 18:35:43.380903+0300 Myapp[3135:1280799] TIC Read Status [2:0x0]: 1:57
2018-07-25 18:35:43.381015+0300 Myapp[3135:1280799] TIC Read Status [2:0x0]: 1:57
2018-07-25 18:35:47.188863+0300 Myapp[3135:1280535] Task <EB118DFB-80BC-4D55-B7BE-5B653AC334BF>.<7> finished with error - code: -1002
2018-07-25 18:35:47.189313+0300 Myapp[3135:1280230] [PW] [E] -[PWRequestManager] Sending registerDevice failed, Error Domain=NSURLErrorDomain Code=-1002 "unsupported URL" UserInfo={NSLocalizedDescription=unsupported URL, NSUnderlyingError=0x143131e50 {Error Domain=kCFErrorDomainCFNetwork Code=-1002 "(null)"}}
2018-07-25 18:35:47.190852+0300 Myapp[3135:1280230] [PW] [E] -[PWPushNotificationsManagerCommon] Registered for push notifications failed
2018-07-25 18:35:47.523898+0300 Myapp[3135:1280534] TIC Read Status [24:0x0]: 1:57
2018-07-25 18:35:47.524062+0300 Myapp[3135:1280534] TIC Read Status [24:0x0]: 1:57
2018-07-25 18:36:27.250624+0300 Myapp[3135:1281002] [PW] [D] -[PWNotificationManagerCompatiOS10] NotificationCenter authorization granted: 1
2018-07-25 18:36:27.301877+0300 Myapp[3135:1280230] [Intercom] ERROR - Tried to submit a device token, but no user has been registered yet.
2018-07-25 18:36:27.314797+0300 Myapp[3135:1281015] Task <A9C42FCE-7DB6-47FF-B0F0-E4E017DA5EF5>.<8> finished with error - code: -1002
2018-07-25 18:36:27.315255+0300 Myapp[3135:1280230] [PW] [E] -[PWRequestManager] Sending registerDevice failed, Error Domain=NSURLErrorDomain Code=-1002 "unsupported URL" UserInfo={NSLocalizedDescription=unsupported URL, NSUnderlyingError=0x1430273f0 {Error Domain=kCFErrorDomainCFNetwork Code=-1002 "(null)"}}
2018-07-25 18:36:27.316159+0300 Myapp[3135:1280230] [PW] [E] -[PWPushNotificationsManagerCommon] Registered for push notifications failed
2018-07-25 18:36:27.466059+0300 Myapp[3135:1281002] TIC Read Status [27:0x0]: 1:57
2018-07-25 18:36:27.466150+0300 Myapp[3135:1281002] TIC Read Status [27:0x0]: 1:57
2018-07-25 18:38:47.816714+0300 Myapp[3135:1281828] TIC Read Status [18:0x1432770b0]: 1:57
2018-07-25 18:38:47.817008+0300 Myapp[3135:1281828] TIC Read Status [18:0x1432770b0]: 1:57
2018-07-25 18:38:47.817084+0300 Myapp[3135:1281828] TIC Read Status [18:0x1432770b0]: 1:57
2018-07-25 18:38:53.935027+0300 Myapp[3135:1281879] TIC Read Status [5:0x0]: 1:57
2018-07-25 18:38:53.935180+0300 Myapp[3135:1281879] TIC Read Status [5:0x0]: 1:57
2018-07-25 18:43:00.008050+0300 Myapp[3135:1280230] Status bar could not find cached time string image. Rendering in-process.
2018-07-25 18:44:00.003251+0300 Myapp[3135:1280230] Status bar could not find cached time string image. Rendering in-process.
ASerga commented 6 years ago

Who is there?

wfhm commented 6 years ago

@ASerga Hi,

Checking it.

ASerga commented 6 years ago

At the same time, ALL WORKS when running app with Build Configuration=Debug

Xcode console logs

2018-07-25 18:54:16.382471+0300 Preply[3159:1286403] [PW] [I] -[PWRequestManager] 
x
|    Pushwoosh request:
| Url:      https://833AC-852C9.api.pushwoosh.com/json/1.3/registerUser
| Payload:  {"request":{"device_type":1,"application":"XXXXX-XXXXX","userId":"XXXXXXXXX-XXXX-XXXX-98DB-E05B8F6613AC","v":"5.8.0","hwid":"XXXXXXXX-XXXX-41F7-98DB-E05B8F6613AC"}}
| Status:   "200 no error"
| Response: {"status_code": 200, "status_message": "OK","response":null}
x
ASerga commented 6 years ago

After integration from scratch, I also can't reproduce it. So I just close it. Thank you a lot for support.