Hello, I'm a data analyst.
I am trying to implement Amplitude to a Hybrid (Webview) App. Our project made web page that use JS and it’s shown on a webview inside our app (android/IOS).
I want to implement Amplitude to mobile Web and Hybrid App. But I couldn’t find how to implement amplitude to hybrid environments in The official development guide.
However, since there are few resource for hybrid app, it would be good to have some materials for hybrid app. Could I get any useful resources for development?
Best answer by eddie.gaonaView original
@J GS happy to help!
You will need to install the Mobile SDKs(iOS, Android) to your app and the webview would need to have the Browser SDK.
I found this piece that was advised previously when it came to bridging both Mobile and Web SDKs that might be helpful:
Thanks for your help!
I have understood that native sessionId should be passed to web JS.
Could I question one more about how to track events in mobile web and hybrid app?
Our page can be accessible through web browser and hybrid app. It’s same page.
I want to track events and distinguish the events source (from mobile web or hybrid app).
In this case, how I implement event track method by native sdk or web sdk?
I just thought rough idea. First, I should get JSONobject variable that include events and parameters in webpage JS. Then If the page was opened by hybrid app webview, pass the variable to native SDK track method by using JS bridge. And if the page was opened by web browser, just pass the variable to web SDK track method.
But I’m not sure about that because I didn’t have any experience in hybrid environment.
Could you check the idea is correct and give advice for event tracking?
Or there is a way to get events from web SDK then pass to native SDK?