This article covers these topics:
- The gotolink() function
- Displaying a web page in an in-app browser
- Displaying a web page in an external browser
The gotolink() function
The gotolink() function can be used to display a web page in an internal browser within QMob, or in an external browser. It can be used as an action in a postcondition.
gotolink(link,open_in_app,title)
| Parameter | Description |
| link | The link you want to display. Links used within the app must be secure (https://). |
| open_in_app | How you want the link to be displayed. Setting this to 0 will display in an external browser, setting to 1 will display in an in app browser. |
| title | The page title displayed in the in app browser. |
Note: If the link is displayed in an external browser, any postconditions after the gotolink() will be paused until the app is reopened.
Displaying a web page in an in-app browser
<question type="single" max_select="1" order="fixed" style="more-options-below" enable_lookup="false" optional_response="false" id="1" text="Open survey" alias="Q1">
<postcondition if="answer(Q1)==1" then="gotolink('https://qmobme.com/',1,Test link)"/>
<postcondition if="answer(Q1)==1" then="setvar(test,123456)"/>
<choice id="1" label="Yes" anchored="false" exclusive="false" alias=""/>
<choice id="2" label="No" anchored="false" exclusive="false" alias=""/>
</question>
Displaying a web page in an external browser
<question type="single" max_select="1" order="fixed" style="more-options-below" enable_lookup="false" optional_response="false" id="1" text="Open survey" alias="Q1">
<postcondition if="answer(Q1)==1" then="gotolink('https://qmobme.com/',0,Test link)"/>
<postcondition if="answer(Q1)==1" then="setvar(test,123456)"/>
<choice id="1" label="Yes" anchored="false" exclusive="false" alias=""/>
<choice id="2" label="No" anchored="false" exclusive="false" alias=""/>
</question>