I am using Chrome customTabs in android and I need to get the current URL in real time, which means once it changed, trigger a callback.
I found two things that may be useful.
CustomTabsCallback.onNavigationEvent(int navigationEvent, Bundle extras); It can return a navigation event code when URL changed or refreshed. How to get Url change from CustomTabsClient
BroadcastReceiver + PendingIntent can get url by clicking. https://gist.github.com/YeWang0/d344618bf8ac269dc3c39fa45214cf8b#handle-actions-using-a-broadcastreceiver
I am thinking, is it possible to fake a click event when onNavigationEvent() called, then I should be able to get the URL in real time.