Search code examples
javascriptandroidcordovamobilephonegap

HTML Mobile App / Google APIs


I've a question regarding mobile app development. I currently making an application in javscript / html / css, but I run into an issue.

The application uses the client sided javascript API for Google calendar access. I intend to deploy the application via Adobe PhoneGap. The problem is, is that the API requires an API key, which requires a domain. This context is lost when using javascript on a mobile device instead (you can't whitelist the domain anymore.

How would one go about deploying a mobile app using Google APIs?


Solution

  • You have two options from the research I have done.

    You can either use this plugin:

    https://www.npmjs.com/package/cordova-plugin-calendar

    Or you could create your own server side API that you send the requests to and then that can forward the request to the Google API using your API key. Sort of like this:

    APP > YOUR_API > GOOGLE_API > YOUR_API > APP