Closed ALiangLiang closed 11 months ago
Thanks for reporting this, may I know the value of SOURCE_ORIGIN
you are using?
So that wasn't mentioned in the demo but the SOURCE_ORIGIN
has to either start with http:// or https://, please try it and let me know if the issue still persists.
So that wasn't mentioned in the demo but the
SOURCE_ORIGIN
has to either start with http:// or https://, please try it and let me know if the issue still persists.
I follow the comment. So I leave it as "my-app-origin-uri". I just tried to changing it to "https://peconn.github.io" and it seems to work. Thanks
Thanks for the confirmation.
Read this First If you have a Trusted Web Activity related question, the best place to ask it is on StackOverflow, on the trusted-web-activity tag, which is also monitored by the team.
Describe the bug
I'm not sure it's a bug or not. I can't repro the demo. I can compile it but cannot works correctly.
CustomTabsCallback
.validateRelationship
aftermSession = mClient.newSession(customTabsCallback);
. ButrequestPostMessageChannel
returnfalse
. I'm sure I've putPostMessageService
inAndroidManifest.xml
.To Reproduce Steps to reproduce the behavior:
cd android-browser-helper/demos/twa-post-message
MainActivity.java
. ReplaceURL
andTARGET_ORIGIN
by localhost site my owned. The site I already has assetlink.json which has correct sha256 of debug keystore and relation. And add following code at line 142. (already importedCustomTabsService
)adb logcat | grep PostMessageDemo
../../gradlew installDebug
and open the app by hands.Expected behavior A clear and concise description of what you expected to happen.
requestPostMessageChannel
returnfalse
should returntrue
Did this ever used to work
no
Screenshots
Code Snippets If applicable, add or link to code snippets describing how the API is being used.
Smartphone (please complete the following information):
Additional context Add any other context about the problem here.