Facebook Oauth + PHP +MySql DB + AdMob in Ionic Framework
Released App Link : https://play.google.com/store/apps/details?id=com.anupkumarpanwar.ifeel
Download this example project from GitHub and run the following commands:
- Go to developers.facebook.com
- Create a new app
- Choose website from platfrom
- Put http://localhost/callback in callback uri
- Copy the client id
With the client id in hand, open www/js/app.js and find the following line (line no 89):
$cordovaOauth.facebook("XXX_FACEBOOK_APP_ID_XXX", ["email", "read_stream", "user_website", "user_location", "user_relationships"])
Replace "XXX_FACEBOOK_APP_ID_XXX" with Facebook Client Id that you obtained from facebook developer console.
- Now install WAMP and goto C:\wamp\www
- Copy the 3 PHP scripts from PHP folder in the project and paste into the C:\wamp\www directory
- Start the wamp server and open localhost/phpmyadmin in web browser
- Create a database named test
- Correct the corresponding database details in 3 PHP scripts present in C:\wamp\www
Run the following command in the project folder
$cordova platform add android
$cordova plugin add cordova-plugin-inappbrowser
$cordova plugin add cordova-plugin-whitelist
$cordova plugin add cordova-plugin-admobpro
$ionic run android
The above commands will add the Android build platform and install the required plugins.
Ionic Framework - http://www.ionicframework.com
AngularJS - http://www.angularjs.org
Apache Cordova - http://cordova.apache.org
ngCordova - http://www.ngcordova.com
Nic Raboy's Code Blog - https://blog.nraboy.com