Sending simple data with notification to another app - android

I'm working on two seperate apps that need at some point to exchange messages, both apps share a MYSQL database, I want the first app to be able to send some data to one of the other app's users (specified by his id, email or phone number ), and this last to be able to reply to the request by accepting or rejecting with a button click.
Now, I don't know what is the best:
Something similar to chat ?Is it possible to extract the necessary data from the rest of the chat message ?
A broadcast.
A push notification.
Or something else ?
Help me please I'm a total newbie, I would use an expert opinion.

What you are describing is basically every other Chat App that exists.
I can only suggest you to read this code example to get an idea how to approach this:
Android Chat Example code

Related

group chat in flutter using firebase with a twist

Disclaimer: I have never worked with firebase or any other DB so my idea is pretty rough and I will be glad if u correct me in some of my assumptions. Also this is my first question on StackOverflow so I hope it will be detailed enough.
I am currently working on my project which is basically a group chat in flutter using firebase, where I should be able to create a new group chat(create a new DB in firestore) trough the app, let other ppl join(assign them to the new group chat DB).
The twist: If I send a message to the group chat I want other ppl to see a pop-up saying: "do you accept this message", no=> doesn't show / yes=> Shows the message but deletes it for others.
This app is nothing but my idea of how to confirm my theory and also learn a little bit more about both flutter and firebase, so please do not mind if it's useful or not.
Assumption: Each groupchat has it's own DB (Can I create a DB in firestore trough app / send request to?)
Question: Can I assign a specific ID to each message and choose and further edit who is going to be able to see the message trough the app(app_instance_1"I accepted the message so only I and sender can see it")?
Here's a great article for making a Flutter chat app: https://medium.com/flutter-community/building-chat-app-in-flutter-with-firebase-888b6222fe20. If you need more detail or help just write a comment.
About your assumption. Each app usually is connected to one database, and within the database, you can have separate documents to hold each group chat. You can also set up documents for each individual user to save the chats that only they can see. Within documents, you add collections that hold your data.

WhatsApp Clone in android for message identifier

I'm working on a chat app message like whatsapp clone in android using firebase.
Right now the application can chat user to user.
My problem right now is the messages was no identifier that the other user see the messages of one another.
In order to make a solution I concat the userId and currentUserId so that it will be the unique message identifier since I'm using firebase-auth.
So my question right now is if this solution is somewhat ok? or any suggestions for message identifier for app chat?
This is some of my code in my ChatActivity for retrieving chat messages
mFirebaseDatabaseRef!!.child("messages").child(mFirebaseUser!!.uid+userId))
Here is saving the messages for every message I push both for user devices
mFirebaseDatabaseRef!!.child("messages")
.child(mCurrentUserId+userId)
.push()
.setValue(friendlyMessage)
mFirebaseDatabaseRef!!.child("messages")
.child(userId+mCurrentUserId)
.push()
.setValue(friendlyMessage)
Here is the sample generated format in firebase (It will both generate two unique coming from two userId's want to chat)
Thanks
So my question right now is if this solution is somewhat ok?
Yes it is. Since this solution works and help you get your job done, it ia a very good solution. You may wonder, is there a better one?
There is no better or perfect solution for how to identify the messages in your app. The best solution, is the solution that fits your needs and makes your job easier. And I personally don't think that can be a better solution than the one that you are comfortable with.
or any suggestions for message identifier for app chat?
Since it is a one to one chat application, the way you identify a "chat room" that contain messages it right, since it is very easy to query. You can simply attach a listener on fromUidtoUid or toUidfromUid reference, and that's it, you got all the messages of a conversation between two users.

Push notification integration in meteor

I am having two applications one is for admin and another is for users.I want to implement push notification in it so that when ever user rate the offer in application then Admin can get notification of it with user phone-number and rating count.I found one good example of push notification but unable to implement in my application as its storing data in local mongoDb not in main so that my other application do not get the stored value in order to hit push notification.I am stuck at this point. can any one provide me a simple approach/process to achieve my goal.I am really new to meteor and have not much knowledge about it.
To implement Push-Notification I am taking reference of :-
1) https://github.com/richsilv/meteor-cordova-notifications/
2) https://github.com/richsilv/cordova-notifications-demo
Any help will be greatly appreciated.
Thanks.
I highly recommend using Parse:
https://parse.com/docs
They make push notifications super easy, and for an affordable price.

how to segregate Chat history messages in android without using local storage? I am using service to get history

How to load chat history message in android without using local storage? My doubt is, I am getting chat history messages from a service and I am loading it to a list. But if any other person chat at that time I am getting that message in that list itself, how to segregate that message from other person chat? Like how they have done in Google talk.
It is hard to give you an appropriate answer without further details:
1) How is the service passing data to your UI? (Cursor, Object Oriented Domain Model)
2) From where are those Chat Messages coming? If it is a online service, is offline caching really no option?
Code snippets are also helping to clarify the situation.
Its some complex, see
when you opening chat screen, just save userId(id of that friend with which you are chating) in prefrences, so when you receive new message in onMessage() method of GCMIntentService class then compare userId(coming with message) with userId(you saved in preferences), if id matched you do not need to call generate notification method, just simply show message in your chat list, if id does not matched, then call to generate notification method(as currently happening), and does not put message in chat list.

Can I send periodic messages to my Android app users?

Is it possible to make a app on Android such that whoever downloads this app receives a message from me weekly? I want to be the only person who can write on this message board and no one else. If this is possible, where should I start looking for tutorials about doing this sort of stuff?
You can create a RSS/Atom feed for yourself. Your android app can then just sync to this feed. Update the feed as often as you like. If you like this approach I can give more details.
yes , you can send periodic messages see this
in that SendMessage(); function is there so you have to make code for send message to recipient

Categories

Resources