1

I'm trying to open a component that redirects the user to VF page - on The Salesforce Application on the mobile.

Android devices can be redirected successfully, while IOS users don't.

Can anyone tell me if there are any settings I need to change on the mobile device or in the Salesforce platform?

The aura component:

<aura:component description="ApprovalMobile" implements="flexipage:availableForAllPageTypes,force:hasRecordId,force:lightningQuickActionWithoutHeader" controller="MyController">
    <aura:handler name="init" value="{!this}" action="{!c.doInit}"/>
</aura:component>

The init function on the controller:

({
    doInit: function(component, event, helper){
        helper.approve(component, event, helper);
    }
})

The Approve function on the Helper:

({
    approve: function(component, event, helper){
        var action = component.get("c.checkValidButtons");
        var currenId = component.get("v.recordId");

        action.setParams({
            myId : currenId
        });

        action.setCallback(this, function(response) {
            var state = response.getState();
            if (state === "SUCCESS") {
                alert("Both IOS and Android see this alert");
                helper.gotoURL("/apex/myVFPage?id=" + currenId + "&actionType=approve");
            }
      
        });

        $A.enqueueAction(action);
    },

    gotoURL : function(url) {
        let urlEvent = $A.get("e.force:navigateToURL");
        urlEvent.setParams({
            "url":url
        });
        urlEvent.fire();
    }
})

The Android and iOS users can see the alert pop up: "Both IOS and Android see this alert".

But on the VF page (myVFPage) I have an alert that only Android users can see:

myVfPage - that have a script in it:

<script>
    $(document).ready(function() {
        alert('Only Android device can see this');
        
    });
</script>

This alert pops up only for the Android devices.

I tried to check the checkbox on the VF page:

enter image description here

But that didn't help.

I also tried to change the redirect to the page. with window.open,

and that didn't help as well.

Any help will be much appreciated,

many thanks.

0

You must log in to answer this question.

Browse other questions tagged .