Skip to content

This repo is a demo for using ionic react with Apollo and cordova http plugin to avoid cors restrictions on ios

Notifications You must be signed in to change notification settings

williamkwao/ionic-react-apollo-yelp

Repository files navigation

Ionic React Yelp Search

This repo is a demo for how to avoid CORS restrictions imposed on hybrid apps by ios. I chose to use the YELP api since it is one of the few public API with CORS restrictions

The app avoids CORS restrictions by using cordova-plugin-advanced-http and linking a fetch implemetation of the plugin to Apollo graphql client.

Setup

  • Install the Ionic CLI if you dont it installed. npm install -g @ionic/cli
  • npm install
  • Get a Yelp API key
  • Create a .env file in the root of the project and add the yelp API key as REACT_APP_YELP_API_KEY=youryelpapikey

How to run on an ios simulator

  • ionic cap sync
  • ionic cap open ios This will open the project in xcode
  • Select your target simulator and hit the play button to run

Screenshot

demo gif

About

This repo is a demo for using ionic react with Apollo and cordova http plugin to avoid cors restrictions on ios

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages