Framework to automate a Hybrid App with Chrome App Android and IOS

Im developing a framework for automate Android, IOS and Chrome App. Im searching for a Appropriate driver with which i can control all the 3 types.The problem is getcontexthandles(). this is crucial for switching webviews But Im not finding the correct driver which will support it for chromedriver, androiddriver and iosdriver.
If I use webdriver as driver here, it prompts to use the appropriate driver
Please guide me as to how this issue can be resolved.
Thanks in advance

  1. Identify the platform before starting the driver and based on platform type instantiate the driver.
    or
  2. Use AppiumDriver for creating the session, after that based on platform cast it with the appropriate driver type

Thanks @pr4bh4sh. I achieved generalisation through AppiumDriver. Can u tell me what is the difference between defining a variable as AppiumDriver and AppiumDriver.

Thanks in advance

Did not get your question can you rephrase it a bit.