viestat / react-native-spotify

A native module that allows you to use the Spotify SDK API with react-native
MIT License
108 stars 23 forks source link

Authentication: Cache system not on main thread #10

Open digitaldavenyc opened 8 years ago

digitaldavenyc commented 8 years ago
screen shot 2016-10-10 at 11 52 11 am

This is error very sporadic, it happens about 20% of the time but it is pretty serious since it causes the app to crash. I have tried wrapping SpotifyAuth.login in a try catch but this error seems to be lower level on the Objective-C side.

Steve62 commented 7 years ago

Doing the following fixed the issue for me:

Find [delegate.window.rootViewController presentViewController: controller animated:YES completion:nil]; in SpotifyAuth.m and replace it with:

dispatch_async(dispatch_get_main_queue(), ^{ //Present the webView over the rootView [delegate.window.rootViewController presentViewController: controller animated:YES completion:nil]; });