Skip to content

j05u3/chats_manager

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

49 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

chats_manager

Display and answer your Whatsapp Cloud API chats.

image

What works so far:

  • Display the text messages stored on Firestore using these functions for bots built using whatsapp-cloud-api-express.
  • Display the message statuses (delivered, read, failed).
  • Display image messages.
  • Answer messages / send template messages (you need to implement your own backend endpoint for this to work).
  • Firebase authentication with Google.
  • Basic templates display support through the private_constants.dart file.
  • Only works on web (desktop and mobile), not native apps for the time being.

Roadmap:

  • Be able to send messages to a new phone number.
  • Be able to pause the bot or stop it.

Development and deployment setup:

  1. Run flutterfire configure and firebase init to setup firebase for your project. Choose build/web as the public folder. You also need to follow the instructions for each of the firebase libraries used here (check the pubspec.yaml file). Some of those are the Google Sign-in part in:
  1. Create and populate the file lib/private_constants.dart. You take a look at the example file lib/private_constants_example.dart.

Deployment:

  1. Setup hosting: the build folder for web is build/web.
  2. Using CMD on windows you can run the following command (&& is used to run the next command only if the previous one was successful):
flutter build web --release && firebase deploy --only hosting && time /t

# or if using targets:
flutter build web --release && firebase deploy --only hosting:TARGET_NAME

Notes:

  • When changing or using @JsonSerializable (to generate models) run flutter pub run build_runner build or flutter pub run build_runner watch --delete-conflicting-outputs to start the watcher.
  • If your are hosting your images on Google Storage don't forget to add the CORS configuration to allow the images to be displayed on the web. Example cors json config:
[
  {
    "origin": ["*"],
    "method": ["GET", "POST", "PUT", "DELETE"],
    "responseHeader": ["Content-Type"],
    "maxAgeSeconds": 3600
  }
]

Acknowledgements

Releases

No releases published

Packages

No packages published