I am using the salesforce SDK cordova plugin to login to a salesforce environment. When I load the app for the first time and attempt to login the app will crash:
2015-04-15 11:32:33.646 MyApp[252:12601] THREAD WARNING: [‘com.salesforce.oauth’] took ‘214.018799’ ms. Plugin should use a background thread.
2015-04-15 11:32:56.723 MyApp[252:12601] TIMING com.salesforce.oauth:getAuthCredentials: 23282ms
If I kill the app and re-run, the login works as expected.
The login always happens after I register for push notification. In fact, I originally encountered the problem with ngCordova during push notification registration. I found this solution http://stackoverflow.com/questions/23662121/cordova-plugins-only-work-in-ios-the-second-time-its-opened-with-a-thread-warnin and was able to work around the original crash. Now, however, the crash has been pushed down the road to a different callout. I have tried to set the jsToNative bridge set on that call, but this does not seem to solve the problem this time around.
It appears to happen when the plugin is first loaded in the app…