For my internship I'm asked to develop a mobile application based on this website (www.claroline.net). The technology I have to use is Nativescript combined with Angular 2. I managed to implement the login function so users of the website can now sign in on the app.
Then I have to be able to get the notifications of the website on the app. At the beginning I just want to display the notifications in a JSON array. I already have the url to get the JSON array (the get request works on the browser) but when I do that from the mobile application, I get a 500 error.
I heard then about JSONP which might help me solve my problem. Apparently there is few things to do : - import JSONP_PROVIDERS in the root component and bootstrap it - import Jsonp in the component you want to do the Jsonp call - add a callback parameter in the url
Am i missing anything ? Because even though I did all that, I get an error in the console :"ReferenceError : document is not defined" in some Javascript file which is weird because since I'm coding in Typescript, there are no variables called document.