Compatible with Ionic 2.0.0-rc.0
-
Create an Ionic app:
ionic start myApp https://github.com/backand/backand-ionic2-starter --v2
cd myApp
-
Install Cordova Plugins
ionic plugin add cordova-plugin-inappbrowser
-
Set details of your app in
src/app/app.component.ts
:backandService.setAppName('your app name');
backandService.setSignUpToken('your signup token');
backandService.setAnonymousToken('your anonymousToken token');
-
Install dependencies:
npm install socket.io-client --save
npm install @types/node --save-dev --save-exact
npm install @types/socket.io-client --save-dev --save-exact
-
Run the app
ionic serve
To fetch, create, and filter rows, from an object, say stuff
, modify
the object used in these functions:
getItems
filterItems
postItem
replacing todo
with the name of your object, stuff
The app opens a dialog supplied by the social network.
Use the Facebook Connect plugin to obtain access to the native FB application on iOS and Android.
Install it with:
ionic plugin add cordova-plugin-facebook4 --save --variable APP_ID="<Facebook APP ID>" --variable APP_NAME="<Facebook APP NAME>"
Use BackandService
function inappSocial
-
To subscribe to event
items_updated
from server side via sockets, in your component do, as insrc/app/pages/crud/crud.ts
:this.backandService.on('items_updated') .subscribe( data => { }, err => { console.log(err); }, () => console.log('received update from socket') ); ```