Create a mobile application with ionic and backand. NOTE: Compatible with Ionic 3.1.2
Due to recent changes of Ionic CLI it does no support creating an app from a GitHub repo. Hence, you will need to clone or download these starter and use the src
and www
folderd.
- Create an Ionic app:
$ ionic start mynewapp blank
$ cd mynewapp
- Replace folders from this starter:
src
www
- Install dependencies:
$ npm i -S @backand/angular2-sdk socket.io-client @types/node @types/socket.io-client ionic-native
- Install Cordova Plugins
$ ionic cordova plugin add cordova-plugin-inappbrowser
- Run the app
$ ionic serve
- In order to run the app on another platform (Android/iOS):
$ ionic cordova platform add <platform>
$ ionic cordova run <platform>
If you want to customize the data model, or change how authentication takes place, follow these steps:
-
Create a free personal application at backand.com
-
Change the app's parameters (/src/app/app.component.ts) in the init function with your new app parameters:
backand.init({
appName: 'your app name',
signUpToken: 'your signup token',
anonymousToken: 'your anonymousToken token',
runSocket: true,
mobilePlatform: 'ionic'
});
- Delete the starter content, and begin writing your app!
Review our Angular 2 SDK to get started - angular2-sdk.
In App social login is intended to use the native social SDK of Faceboook or Google. For Google this is due to recent restrictions in Google that prevent using the Signup with Google through web views.
In the signup
screen we label this functionality as In App Social
Install Ionic Native Google Plus plugin
Install Ionic Native Facebook plugin
When an Ionic web app is shared in Facebook feed, the usual Backand social signup with Facebook will not work.
-
Detect this case in your code with:
function isFacebookApp() { var ua = navigator.userAgent || navigator.vendor || window.opera; return (ua.indexOf("FBAN") > -1) || (ua.indexOf("FBAV") > -1); }
-
Install
ngx-facebook
:npm install ngx-facebook --save
-
Use the code labeled Social Web in
signup
screen.