I was starting a small project making a mobile app using Apache Cordova (PhoneGap) to pull data from LinkedIn. The first step I did was signing up for LinkedIn’s Developer program so that I could obtain an API key.
While this is a typical question when you are asking a web developer, this would be http://localhost if you are developing locally or simply http://yourdomain if you were hosting it. However, I wasn’t sure how it applied to mobile, and specifically in the case of Cordova.
I initially tried “http://localhost” but received the following error being thrown in LogCat:
After searching around I was able to find other people asking similar questions, however I was unable to find any answers.
It wasn’t until I noticed the following line in the logs did I realise what I should provide as the API Domain.
"I/Web Console: Received Event: deviceready at file:///android_asset/www/js/
Then it occurred to me, all they were looking for was “file:///” and after saving those changes in LinkedIn’s Developer site, I was up and running.