This is a migrated thread and some comments may be shown as answers.

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

1 Answer 78 Views
Android Devices
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Rakesh
Top achievements
Rank 1
Rakesh asked on 14 Dec 2016, 12:47 PM
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');
                        }
                    });
                }

1 Answer, 1 is accepted

Sort by
0
Preslav
Telerik team
answered on 19 Dec 2016, 01:11 PM
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.

 
Tags
Android Devices
Asked by
Rakesh
Top achievements
Rank 1
Answers by
Preslav
Telerik team
Share this question
or