You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I would like to have a getter method or some other way to access the mSession property from the TwaLauncher class. Currently, this property is private and there is no getter method to retrieve it.
Describe alternatives you’ve considered
As an alternative, I've tried overriding the createTwaLauncher method in the LauncherActivity class to return an extended custom class from the TwaLauncher class to access the mSession property of CustomTabsSession, or overriding the TwaCustomTabsServiceConnection subclass. However, they are still private, so this requires modifying the library's source code, which isn't ideal.
Additional context
I have successfully made postal messages work based on the twa-post-message demo and the documentation without any problem where I was able to communicate between the TWA application and my Web app. The thing is, I use Bubblewrap to generate the project and the structure has nothing to do with that of the demo. I would simply like to add a new class to the project generated by Bubblewrap without having to modify the entire project structure and having to maintain it with each new update of the “android-browser-helper” repo.
If it is possible to find a solution to use post messages in a project generated by Bubblewrap without having to make hacks, it would be greatly appreciated.
The text was updated successfully, but these errors were encountered:
Is your feature request related to a problem? Please describe.
I am currently working on a project where I need to manage the sending of post messages to the browser. I have successfully overridden the getCustomTabsCallback method in the LauncherActivity class to return a custom class extended from the QualityEnforcer class. This extended class contains the logic of CustomTabsCallback as described in the documentation. However, to do this, I need access to the session created in the onCustomTabsServiceConnected method of the TwaCustomTabsServiceConnection subclass in the TwaLauncher class.
Describe the solution you’d like
I would like to have a getter method or some other way to access the mSession property from the TwaLauncher class. Currently, this property is private and there is no getter method to retrieve it.
Describe alternatives you’ve considered
As an alternative, I've tried overriding the createTwaLauncher method in the LauncherActivity class to return an extended custom class from the TwaLauncher class to access the mSession property of CustomTabsSession, or overriding the TwaCustomTabsServiceConnection subclass. However, they are still private, so this requires modifying the library's source code, which isn't ideal.
Additional context
I have successfully made postal messages work based on the twa-post-message demo and the documentation without any problem where I was able to communicate between the TWA application and my Web app. The thing is, I use Bubblewrap to generate the project and the structure has nothing to do with that of the demo. I would simply like to add a new class to the project generated by Bubblewrap without having to modify the entire project structure and having to maintain it with each new update of the “android-browser-helper” repo.
If it is possible to find a solution to use post messages in a project generated by Bubblewrap without having to make hacks, it would be greatly appreciated.
The text was updated successfully, but these errors were encountered: