Ionic Backand Chat

Ionic Backand Chat

Cool chat with Backand Real Time

Free!

(5)
Tamir Kfir

Tamir Kfir

Member since 2016

Details

Version:
1.0
Size:
3mb
Ionic:
1.3.x
Platforms:
iOS, Android
View ID:
BDF3A832
Released:
4 months ago
Updated:
4 months ago
Category:
Starters
Tags:
Backand, Chat, back-end, 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 - 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 or create an account before you can leave a comment here.

Jose Moraes

Jose Moraes   ·   4 months ago

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

Jose Moraes

Jose Moraes   ·   4 months ago

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

Tamir Kfir

Tamir Kfir   ·   4 months ago

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

  ·   just now

{{ reply.comment }}



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

Marco bakker

Marco bakker   ·   3 months ago

this project is never working now!!!!

  ·   just now

{{ reply.comment }}



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

Marco bakker

Marco bakker   ·   3 months 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 or create an account before you can leave a comment here.

  ·   just now

{{ comment.comment }}

  ·   just now

{{ reply.comment }}



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

  ·   just now

{{ comment.comment }}

  ·   just now

{{ reply.comment }}



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

Marco bakker

Marco bakker   ·   3 months 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 or create an account before you can leave a comment here.

Marco bakker

Marco bakker   ·   3 months ago

this project is never working now!!!!

  ·   just now

{{ reply.comment }}



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

Jose Moraes

Jose Moraes   ·   4 months ago

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

Jose Moraes

Jose Moraes   ·   4 months ago

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

Tamir Kfir

Tamir Kfir   ·   4 months ago

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

  ·   just now

{{ reply.comment }}



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

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

Itay   ·     ·   4 months ago

Thanks for this great chat starter

Tal Peretz   ·     ·   4 months ago

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

Jose Moraes   ·     ·   4 months ago

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

ziv chen   ·     ·   4 months ago

Cool starter

Marco bakker   ·     ·   3 months ago

never work!!!!

  ·     ·   just now

{{ rating.comment }}

  ·     ·   just now

{{ rating.comment }}

Marco bakker    ·     ·   3 months ago

never work!!!!

ziv chen    ·     ·   4 months ago

Cool starter

Jose Moraes    ·     ·   4 months ago

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

Tal Peretz    ·     ·   4 months ago

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

Itay    ·     ·   4 months ago

Thanks for this great chat starter