Ionic Backand Chat

Ionic Backand Chat

Cool chat with Backand Real Time

Free!

(5)
Tamir Kfir

Tamir Kfir

Member since 2016

Details

Version:
1.1
Size:
3mb
Ionic:
1.3.x
Platforms:
iOS, Android
View ID:
BDF3A832
Released:
8 years ago
Updated:
7 years ago
Category:
Starters
Tags:
Backand, Chat, backend, database, BAAS

Leveraging Backand, this super-easy Ionic chat provides a boatload of functionality including real-time communication and a database API.

Set up instructions:

1 - To run starter, run ionic start on the repository:

ionic start backand-ionic-chat https://github.com/backand/backand-ionic-chat
cd backand-ionic-chat

2 - Install Backand

bower install socket.io-client#1.4.5
bower install backand-angular1-sdk

3 - Run with ionic serve function

ionic serve

In order to run the app on another platform (Android/iOS):

cordova platform add <platform>
ionic run <platform>

Setting up your own realtime Backand app

1 - Create a free personal app at backand.com

2 - Set the following Backand DB model:

[
  {
    "name": "users",
    "fields": {
      "email": {
        "type": "string"
      },
      "firstName": {
        "type": "string"
      },
      "lastName": {
        "type": "string"
      },
      "chats": {
        "object": "chats"
      }
    }
  },
  {
    "name": "chats",
    "fields": {
      "participants": {
        "collection": "users",
        "via": "chats"
      },
      "messages": {
        "collection": "messages",
        "via": "chat"
      },
      "name": {
        "type": "string"
      }
    }
  },
  {
    "name": "messages",
    "fields": {
      "message": {
        "type": "string"
      },
      "chat": {
        "object": "chats"
      }
    }
  }
]

3 - On the messages object, add a server side action that triggers after the create event. Call it SendMessage and use the following code:

'use strict';
function backandCallback(userInput, dbRow, parameters, userProfile) {
    socket.emitAll("send_message" + dbRow.chat, dbRow.message);
  return {};
}

4 - Modify the following code on www/js/app.js with your Backand app name, sign up token and anonymous token:

  BackandProvider.setAppName('Your-App-Name');

  BackandProvider.setSignUpToken('Your-SignUp-Token');

  BackandProvider.setAnonymousToken('Your-Anonymous-Token');

5 - Enjoy your custom Real Time app! You can add whatever functionality you want both to the client or the server!

For more info about Backand Real Time feature: http://docs.backand.com/en/latest/apidocs/realtime/index.html

Hey there! You'll need to log in before you can leave a comment here.

Jose Moraes

Jose Moraes   ·   8 years ago

Its expected the starter woks properly when using ionic serve --lab? messages are not being rendered in the view.

Jose Moraes

Jose Moraes   ·   8 years ago

Yep, it works fine. My bad: a single typo on the server code. Great Starter!.

Tamir Kfir

Tamir Kfir   ·   8 years ago

Thank you! Let me know if you have any other questions :)

  ·   just now

{{ reply.comment }}



Hey there! You'll need to log in before you can leave a comment here.

Marco bakker

Marco bakker   ·   8 years ago

this project is never working now!!!!

  ·   just now

{{ reply.comment }}



Hey there! You'll need to log in before you can leave a comment here.

Marco bakker

Marco bakker   ·   8 years ago

I am really sorry. I have contacted with backand support team and they had issue with socket feature. so the issue was not your. your project is working well now since they have fixed it. I am sorry. Very good project!!!! 5 star rating!!!!

  ·   just now

{{ reply.comment }}



Hey there! You'll need to log in before you can leave a comment here.

  ·   just now

{{ comment.comment }}

  ·   just now

{{ reply.comment }}



Hey there! You'll need to log in before you can leave a comment here.

  ·   just now

{{ comment.comment }}

  ·   just now

{{ reply.comment }}



Hey there! You'll need to log in before you can leave a comment here.

Marco bakker

Marco bakker   ·   8 years ago

I am really sorry. I have contacted with backand support team and they had issue with socket feature. so the issue was not your. your project is working well now since they have fixed it. I am sorry. Very good project!!!! 5 star rating!!!!

  ·   just now

{{ reply.comment }}



Hey there! You'll need to log in before you can leave a comment here.

Marco bakker

Marco bakker   ·   8 years ago

this project is never working now!!!!

  ·   just now

{{ reply.comment }}



Hey there! You'll need to log in before you can leave a comment here.

Jose Moraes

Jose Moraes   ·   8 years ago

Its expected the starter woks properly when using ionic serve --lab? messages are not being rendered in the view.

Jose Moraes

Jose Moraes   ·   8 years ago

Yep, it works fine. My bad: a single typo on the server code. Great Starter!.

Tamir Kfir

Tamir Kfir   ·   8 years ago

Thank you! Let me know if you have any other questions :)

  ·   just now

{{ reply.comment }}



Hey there! You'll need to log in before you can leave a comment here.

Hey there! You'll need to log in before you can leave a rating here.

Itay   ·     ·   8 years ago

Thanks for this great chat starter

Tal Peretz   ·     ·   8 years ago

Awesome job with this stater! Looking forward to play with the backend api and ionic , thanks.

Jose Moraes   ·     ·   8 years ago

It's definitely one the best starters here. Thx!

ziv chen   ·     ·   8 years ago

Cool starter

Marco bakker   ·     ·   8 years ago

never work!!!!

  ·     ·   just now

{{ rating.comment }}

  ·     ·   just now

{{ rating.comment }}

Marco bakker    ·     ·   8 years ago

never work!!!!

ziv chen    ·     ·   8 years ago

Cool starter

Jose Moraes    ·     ·   8 years ago

It's definitely one the best starters here. Thx!

Tal Peretz    ·     ·   8 years ago

Awesome job with this stater! Looking forward to play with the backend api and ionic , thanks.

Itay    ·     ·   8 years ago

Thanks for this great chat starter