-
Notifications
You must be signed in to change notification settings - Fork 305
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
What's the 'AdjustExample-WebView.html' ?? #411
Comments
Example app we have in repository which shows how web bridge SDK works is loading Cheers |
@jsungh88 Any update on this one? |
In case you are still facing this issue, feel free to reopen the issue and ping us in here. Cheers |
@uerceg hi, do we have to include following lines in HTML document for webview cases on both IOS and Android? Or they injected by native app's webview container? <script type="text/javascript" src="adjust_event.js"></script> <script type="text/javascript" src="adjust_config.js"></script> <script type="text/javascript" src="adjust.js"></script> |
Hey @bahcetepe, Sorry for delay in replying. You do need to add those scripts in case of Android (iOS is handling this under the hood). In addition to that (with current state of Android web bridge) you'd need to make sure to copy those For usage example, you can inspect source code of our example web app we're using in our web bridge examples: https://adjustweb.neocities.org. There you can see how one can build a web app so that it works with our web bridges once loaded in web views on iOS and Android. In case you have any further questions, feel free to ping. Cheers |
@uerceg thank you for your invaluable response. Just another question: is there any way to test html that contains adjust js codes within web browser. When i tried your example link, it throws following exception:
I just don't want to try it inside a webview to see it runs or not. I initially want to test it say on Chrome with any android/ios user agent setting. Hope there is a way. Regards, |
Hey @bahcetepe, No, unfortunately there's no way to do that. Our Javascript abstractions were built just to streamline usage of native Adjust SDK under the hood and make API between Javascript and Java / Kotlin more similar. But those wrappers are there just for that and their purpose is to pass data down to the native world to be processed and executed by the native Android SDK. So in order to test if things work as expected, you need to have everything set up -> native SDK and web bridge added, things hooked inside of your native Android app and web page which uses our Javascript wrappers properly loaded inside of the web view. |
@uerceg thank you for your response dude. it would be nice to have a simulated mock responses from 'bridge' to js side. So this might make front end side test isolated and fail fast style. |
That's an interesting thing for us to know, thanks. I'd be curious to know how would you exactly expect this to look like? If you can maybe share a small example with some pseudo code involved, that should be enough - just to gain basic understanding. |
I mean that instead of following error If you have an additional js file which initialize AdjustBridge as a mock object, then at least i will be sure that i did remaining adjust js development as expected. I might see the alerts, console.logs etc. Assume you have an integration with a backend rest service and assume this rest service returns http 404 right now. It would be enough to have a mocked http 200 with some data for front end development right? |
In theory, that'd require quite a lot development effort on our end to build. Here's the rationale, lemme know if something sounds wrong to you. Uncaught reference error which you see is coming because lack of native setup (as we already mentioned). If you would expect some way to verify way of usage of our Javascript wrappers inside of your web app, I see two possible ways how we can do that:
Our native SDK is not just a layer which is transforming user input into direct HTTP requests and is letting you know back what the HTTP responses were. It has a lot of inner logic (packaging user input, queueing mechanisms, features such as offline mode, event buffering, inner states like disabled / enabled, GDPR forgotten which all depend on storage, etc) which one can't just mock and expect that usage of the API in web app is something which you can know with 100% certainty that is good and that the only missing part is to hook the native part. |
@uerceg Yeah the options and your opinions are pretty reasonable. So, thank you again :) |
Hi @uerceg, You mentioned that you'll start shipping web bridge as an AAR and will be bundeling the .js files so that you don't need to import them manually anymore. Are those changes live in the current (stable) SDK packages? And might you have an example of how to use those .js files inside of an hybrid Android app. In particular if a hybrid Android app loads an external public facing website into a webview. How should the .js files be linked, if the HTML page is hosted on an external server? Or should those .js files be hosted on that same external server? |
Commented galaxyapps_sdk_referrer dependency
Hi,
I am applying sdk to webview.
I saw 'example-app-webbridge'.. so I have a question.
What's the 'AdjustExample-WebView.html' ??
I already have a url which is loading in 'main activity'. By the way, [ webview.loadUrl (file: ///AdjustExample-Webview.html); ].... Where should I declare the existing url?
How should I integrate with my existing web url....?!?
The code below is my AdjustExample-Webview.html. Please check if there is something wrong.
<!doctype html>
<style type='text/css'> html { font-family:Helvetica; color:#222; } h1 { color:steelblue; font-size:24px; margin-top:24px; } button { margin:0 3px 10px; font-size:12px; } .logLine { border-bottom:1px solid #ccc; padding:4px 2px; font-family:courier; font-size:11px; }The text was updated successfully, but these errors were encountered: