on 07-07-2023 8:11 AM
Hi all,
Below code snipped does work and navigates to the generated link if the app is accessed over desktop browser, however it does not give any response if it is called from mobile phone browser (Iphone 14, Safari). Interestingly if the URLHelper control is called directly from the onpress function (see the dummy/hard-coded commented out line), then it works pretty fine. But it does not work if it is called in a binded function as below. I can not call the control in onpress since as you see I am making a callfunction to get the location parameters to generate the googlemaps link for every unique call. I am at this point out of options on what to do. I appreciate for any help.
onHandleDeviceLocationLinkPressed: function (oEvent, iEquipmentNumber)
{
// If this dummy hard-coded url is called right here, then it works
// URLHelper.redirect("https://www.google.com/maps/search/?api=1&query=49.2863488,8.6441984", true);
let that = this; this._oSystem = this.getOwnerComponent().getModel(“system”);
this._oSystem.callFunction("/getMachinePosition",
{
method: 'GET',
urlParameters: { Name: iEquipmentNumber, },
success: that._bindSystemCoordinatesSuccess,
error: that._bindSystemCoordinatesFailed });
},
_bindSystemCoordinatesSuccess: function (obj)
{
let oMachinePosition = obj.getMachinePosition;
let sUrl = 'https://www.google.com/maps/search/?api=1&query=';
// Does not response
URLHelper.redirect(sUrl + oMachinePosition.latitude + "," + oMachinePosition.longitude, true);
},
_bindSystemCoordinatesFailed: function (oText)
{
MessageToast.show(“Error”);
},
User | Count |
---|---|
77 | |
9 | |
9 | |
7 | |
7 | |
6 | |
6 | |
6 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.