Share session to Webview property

Official Content
This documentation is valid for:
Sets whether to copy the session from a native app to a WebView component.

Values

False
True

Scope

Objects: Menu, Panel, Work With (Only Main Objects)
Generators: Android, Apple

Description

Allows sharing the session between the mobile application (Android and iOS) and the Web part, allowing for communication between them, by default, this property has 'false' value. It also makes it possible to share the session of a GAM user; this implementation is a valid alternative to the one already existing in this example: HowTo: Access a web panel component using the Smart Devices

Run-time/Design-time

This property applies only at design-time.

Samples

In your Main Panel for Smart Devices, place the variable on the screen and call your test Panel for Smart Devices by sending it via a parameter ("ShareWebSession" in the example). 

Event 'RunTest'
    ShareWebSession(&SetSomeValue)
Endevent 

ImageSDPanelMain_20188914043_1_png

In your test Panel for Smart Devices, place a variable based on the SD Component domain (variable &webview in the example). Also, add the value sent via a parameter to the web session:

Event Start
    &WebSession.Set('Test', &SetSomeValue)
    &WebView = WebPanel.Link()
Endevent

webpanellayout_20188914253_1_png

Retrieve the value on your Web Panel and show it on the screen.

Event Start
    &WebVarchar = &WebSession.Get('Test')    
Endevent

Untitled_2018891451_1_png

Untitled_20188914171_1_png Untitled_20188914149_1_png

How to apply changes

To apply the corresponding changes when the property value is configured, Build the Main Object.

Availability

This property is available since GeneXus 15 upgrade 12.