Error in calling the API from a Cordova application


When I build my application with cordova, a js script that starts when the page is loaded must execute the call from the backendless api but it is still an error that is issued, as shown below:

<script type="text/javascript" src="cordova.js"></script>
<script type="text/javascript" src="js/jquery-3.2.1.min.js"></script>
<script src="//"></script>
<script type="text/javascript">

	$(document).ready(function() {

		Backendless.serverURL = '';
		Backendless.initApp(APP_ID, API_KEY);
		var profilStorage = Backendless.Data.of( "Profil" );
		var queryBuilder = Backendless.DataQueryBuilder.create();
		queryBuilder.setWhereClause( "mobile = 0645331012" );

		profilStorage.find( queryBuilder )
		.then( function( profilArray ) {
			if (profilArray.length == '0') {
			} else {

The white list of cordova is enabled on all domains in config.xml:

<universal-links> <host name="" scheme="https" /> </universal-links>

The result is always the same no response, what to do?

Hi Franck,

Try the following:

  1. add a “.catch” method as described in the doc:
  2. your “whereClause” might need some tweaking if the data type of the “mobile” column is string. In that case, it should look like this (notice the single quotes around the value):

mobile = ‘0645331012’

hello Mark,
I added the “.catch” method as described in the link documentation below, but it has not changed anything?

I do not know if you understood me because I explain that my application cordova is built in apk, access to the api launch in server mode on the browser works perfectly as in emulation but when it is built in apk, it does not work!

I would like to know why?
And if this comes from backendless and its security or cordova that blocks any application access built in apk?

Thank you

Hi Franck,

Adding the catch method will not change a lot, except, if there is a problem, you’d be able to handle it (perhaps display a message).

I assume my suggestion about the where clause was not relevant?

If there is a difference in the runtime between an emulator and a device, I would recommend creating a very simple app which does only one API call and see if it works. This would validate whether there is a general configuration issue from the backendless perspective.