app works in simulator not on device and ajax call is not working in android devices

2 posts, 0 answers
  1. Rakesh
    Rakesh avatar
    5 posts
    Member since:
    Nov 2016

    Posted 14 Dec 2016 Link to this post

    if (accessToken != undefined) {
                        var clientID = $("#txtClientDetailsID").val();
                        $.ajax({
                            url: "https://dev-api.safenames.com/clientaccount/" + clientID,
                            method: "GET",
                            data: {},
                            contentType: "application/json; charset=utf-8",
                            cache: false,
                            beforeSend: function (xhr) {
                                /* Authorization header */
                                xhr.setRequestHeader("Authorization", "Bearer " + accessToken);
                            },
                            success: function (response, textStatus, xhr) {
                                if (response.ClientAccount != null) {
                                    $("#contact-name").html(response.ClientAccount.ContactName); $("#company-id").html(response.ClientAccount.CustomerID);
                                    $("#company-name").html(response.ClientAccount.CompanyName); $("#registrant-name").html(response.ClientAccount.Registrant);
                                    $("#telephone-no").html(response.ClientAccount.TelephoneNumber); $("#fax-no").html(response.ClientAccount.FaxNumber);
                                    $("#email-id").html(response.ClientAccount.EmailAddress); $("#address1").html(response.ClientAccount.Address1);
                                    $("#address2").html(response.ClientAccount.Address2); $("#city").html(response.ClientAccount.City);
                                    $("#state").html(response.ClientAccount.State); $("#postal-code").html(response.ClientAccount.PostalCode);
                                    $("#country-code").html(response.ClientAccount.CountryCode);
                                    $("#clientdetails").css('display', 'inline');
                                    $(".km-content").removeClass("loadingIcon");
                                }
                                else {
                                    $(".km-content").removeClass("loadingIcon");
                                    $("#modal_content").html("The customer identifier supplied has not been found in your account structure.");
                                    $("#responseModal").modal('show');
                                }
                            },
                            error: function (xhr, textStatus, errorThrown) {
                                var errorRes = exceptionHandling(xhr);
                                $(".km-content").removeClass("loadingIcon");
                                $("#modal_content").html(errorRes);
                                $("#responseModal").modal('show');
                            }
                        });
                    }
  2. Preslav
    Admin
    Preslav avatar
    225 posts

    Posted 19 Dec 2016 Link to this post

    Hello Rakesh,

    Since you have already posted the same problem in this forum post, we can get the details and investigate the issue there.

    Regards,
    Preslav
    Telerik by Progress
     

    Visit the Telerik Verified Plugins Marketplace and get the custom Cordova plugin you need, already tweaked to work seamlessly with AppBuilder.

     
Back to Top