2

Apple hasn't approved Google Voice as an App so Google created a web "app". So somehow they are accessing the microphone thru the browser. The browser doesn't have access to the Mic so I'm wondering how they (and thus I) did that.

Only thing I can think of is something like PhoneGap or Titanium.

Clay Nichols
  • 11,848
  • 30
  • 109
  • 170

1 Answers1

3

It's not possible to access the microphone or the camera from a web app running within Safari on iOS. It may be possible in a few years once the W3C finalizes HTML5, but it's a long way off. I believe Google Voice's servers actually call your phone and then the audio runs over your phone's voice connection.

If you're willing to make yourself a minimal native app, there is a solution that will let you do most everything as a web app, using native code only for the audio-related stuff:

  1. Create your app as a web app. Design and build everything so it looks great in Safari on the iPad.

  2. Create a new native app that will act as a shell for your website. It can just be a very basic Objective-C app with a web view in it.

  3. When your web app needs to open up an audio recording interface, make it request an url (via javascript or via the user clicking a link) like this one:

    startaudio://whatever-variables-you-need-to-pass

  4. Implement the UIWebView delegate function webView:shouldLoadRequest: in your Objective-C code. Check each URI that the web view tries to load and intercept your custom "startaudio://" url. At this point, your app would bring up the audio interface in native Objective-C, perhaps over top of the website view.

  5. Upload recorded audio data to your server in Objective-C (probably) and then use [webView executeJavascript: ] to tell the browser that the audio recorder has been dismissed.

Hope that helps!

Ben Gotow
  • 14,805
  • 3
  • 42
  • 47