Skip to main content

This content has been archived and is no longer being updated. Links may not function; however, this content may be relevant to outdated versions of the product.

Support Article

Application URL not opening in Facebook Browser on iOS

SA-29032

Summary



The Application URL below is not opening in the in-app Facebook browser (through Facebook messenger) on iOS.


Error Messages



The application does not load. Blank screen is displayed.


Steps to Reproduce



Open the Mashup URLs in in-app Facebook browser (through Facebook messenger) for iOS.


Root Cause



The gadget code did not have a check for handling the Facebook in app browser which is not supported

Mashup has a logic in mashup (html) and at PRPC level to check for valid browsers. In mashup html just for Safari there is an extra code path to solve the cross-domain cookie issue.
All these check is done using “user-agent” string that comes as part of the request header from the client. In this case for “Facebook In app browser on IOS” the user-agent string is totally different with “AppleWebKit” which is not checked in any of the existing browser check code both at mashup html and at PRPC. Hence the page returns empty without loading any content.

Resolution



Include this new user agent string “AppleWebKit” both at mashup and at PRPC.

Note: This is added user-agent string in the Web-Login html rule and bypassed all these browser checks that was done at the decision table and packaged in “Ruleset:01-01-01” ruleset.

User agent string is very important on how uniquely it identifies each device to take separate code path basis on this.


 Code Changes:

1.    Mashup HTML Code - Application_FaceBook_Final.html:
Include the new user agent for this type of browser "AppleWebKit"

function myFunction(prpcHostName){
                                                var ua = navigator.userAgent;
                                                if((ua.indexOf("Trident") == -1) && (ua.indexOf("Firefox") == -1) && (ua.indexOf("Chrome") == -1) && ((ua.indexOf("Safari") != -1) || (ua.indexOf("AppleWebKit") != -1))){
                                                                if(document.cookie.indexOf("redirected=true") != -1){




2.    PRPC – Web-Login HTML rule:
Include the new user agent string “AppleWebKit”

<% 
                String userAgentString = pega_desktop_httprequestheader.pyGetUserAgent(tools);
                if(!userAgentString.contains("Trident") && !userAgentString.contains("Firefox") && !userAgentString.contains("Chrome") &&  (userAgentString.contains("Safari") || userAgentString.contains("AppleWebKit")))
    {
  %>
                                <script>





3.    PRPC – IsUnsupportedOS Decision Table rule:
Modify the rule to bypass this check


 

 

Published October 21, 2016 - Updated October 8, 2020

Was this useful?

0% found this useful

Have a question? Get answers now.

Visit the Collaboration Center to ask questions, engage in discussions, share ideas, and help others.

Did you find this content helpful?

Want to help us improve this content?

We'd prefer it if you saw us at our best.

Pega Community has detected you are using a browser which may prevent you from experiencing the site as intended. To improve your experience, please update your browser.

Close Deprecation Notice
Contact us