Question: I'm developing a hybrid mobile application and am trying to get HTML5 Geolocation working on iPhone IOS8, but am having no luck. Does anyone know any known problems? I've tried lots of examples but none are even prompting the user to allow geolocation. It works fine in browser, but as soon as upload to PhoneGap Build and install on my mobile it doesn't do anything. 

Some example code i've tried is:

```
 <!DOCTYPE html>
 <html>
 <body>

 <p>Click the button to get your coordinates.</p>

 <button onclick="getLocation()">Try It</button>

 <p id="demo"></p>

 <script>
 var x = document.getElementById("demo");

 function getLocation() {
     if (navigator.geolocation) {
         navigator.geolocation.getCurrentPosition(showPosition);
     } else { 
         x.innerHTML = "Geolocation is not supported by this browser.";
     }
 }

 function showPosition(position) {
     x.innerHTML = "Latitude: " + position.coords.latitude + 
     "<br>Longitude: " + position.coords.longitude; 
 }
 </script>

 </body>
 </html>

```

I would use the PhoneGap plugin but couldn't get that working.

Thanks.

Answer: 
Finally I found the combination of Generic Controller and **shared** view as the best way. In this case also there could be an authentication for each controller separately.

**Generic Controller :**

```
 public abstract class GenericController<T> : Controller
        where T : BaseInformation
    {  //Controller Implementation for Index, Create, Edit, Delete   }

```

**View** in Shared folder

```
@model BaseInformation
//Model Implementation 

```

**Final controller**

```
[Authorize(Roles = "Admin")]
      public class Base1Controller : GenericController<Base1>
        {
        }
[Authorize(Roles = "Helpdesk")]
        public class Base2Controller : GenericController<Base2>
        {
        }

```
You can use a view with dynamic view model and controller action that accepts Entity (your base class). It could look like this

Controller:

```
public ActionResult Index(Entity foo)
{
    if(foo is Example1)
{
    var e1 = foo as Example1;
    //do your stuff
}

    return View();
}

```

View:

```
@model dynamic

   @{
    ViewBag.Title = "IndexNotStonglyTyped";
    }

<h2>Index Not Stongly Typed</h2>

<p>
    <label>@Model.Name</label>
    <label>@Model.Id</label>
</p>

```