Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 6 years ago.
Improve this question
I am developing an app in which there is a chatting functionality also , except chat my rest app is done now i want to integrate chat in my app for which i am trying xmpp , i have tried a sample for xmpp with my own jabbered server and its working.
Following are my question are
1.How to integrate my app php data with jabbered server to show list of user chatting with there image , name , time and last message like the whats app chat list etc. like the image below
2.Flow of xmpp , like how its works example first the message is sent to FCM then to jabbered server and then to Device or it works differentely.
How to manage chat history , do i need local database to maintain it or jabbered help for history also.
Any suggestion , link , example will be appreciated Thanks.
I think you are asking a lot of questions at once. The way you want to implement it all with your server depends on you. But the best I can say to my own knowledge is that chat storage on WhatsApp is done on the device. Messages can be stored in an Sqlite database. I use node.js to power my own server. It's not possible for me to give you the full detail of how it all links together but I can try by saying I have an xmpp client on my Node.js server. Once a user registers the xmpp client is made to register the user in the ejabbered server also with the same username. So since the user info is in the table with all of his/her details they can easily be queried for by username from the Android app.
You need to do some research on xmpp, and maybe Node.js and SQLite.
FCM is something different and you might not really need it in the flow
first sorry for my poor English.
Answer for 1st,
XMPP Provides Register using PHP Service. Basically, Register from your device if successfully then register save user data in your server database. after register user you have to register user in XMPP, right now i don't have PHP snidest code.
other way is if user successfully register then it will give you register data. Take user id as register user in XMPP from your device.
i don't know how you manage your friend list but suppose you have user id using it concatenation suffix name with it you can send message.
Answer for 2nd,
You need refer document and make message format in XML and/or son .
in Message format you have to define sender id, receiver id, sending time, message and you can define your custom attribute. sender send message in XML format and receiver evaluate message.
Answer for 3rd,
You have manage local database for individual chat because it server work is over after delivering message to you. In group it will provide history message but here also you have to manege local it's database.
hope this information help you.
Related
Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 3 years ago.
Improve this question
My question is about logic not api specific.
if I have an e-commerce application that consist of 2 separate components (one is for the seller and the other for the buyers) and I have, lets say, laravel php admin panel for customer support (as super admin) and amdin panel for sellers can use web browser to edit their product pages and reply to customer in realtime. (now sellers has 2 options android app and web page to do same job)
How the hosting is done for the website (admin page) and android application, according to my understanding is:
1- admin panel (webpage) will be on server hosting the Laravel and MySQL database.
2- Android application will retrieve data from database from server.
3- when sellers use their android application to add products.. Database on server will be updated.. so buyers can see the new added items.
4-When Buyers uses the chat interface in android application then this database will not use the server where the Laravel (or any framework) admin page are hosted.. instead it will connect to real time plateform like firebase.
That is my understanding for this type of application and the overall relations between web server and android app.. Is that logic is right? please any advise will be helpful.
I was using pusher for my realtime chat, you can store messages in your database and broadcast MessageSent event with pusher, listen channel on front of your website/app and append chat with received info from pusher.
You have to make 2 channels
Broadcast::channel('/user/chat/{userId}', function ($user) {
return $user->id === $userId;
});
Broadcast::channel('/admin/chat', function () {
return $user->isAdmin === 1;
});
and broadcast user messages to /admin/chat route and admin replies to /user/chat/{userId}, hope it helps
Read docs: https://laravel.com/docs/5.7/broadcasting
we have a android project that needs the following objectives:
*we also have a web application for this app that needs to communicate with the same database as the android application
what I have done so far:
a view of a map with a pinpoint on my current Location
mysql db containing information (including latitude and longtitude position)
registration and login
Real Time Database Objectives:
state that people are online or offline(updating a database).
Google Map Objectives:
When I press a button, the map will show other users who are online within a given radius so basically I need to view online people who are near me
Send a message to them [2 ways]
2.1 I send them a message by clicking their icon
2.2 I send everyone[online people within the radius] the message
Questions:
I am currently using php mysql for login/register. Can I use this for a real time database or is there any other way?
is Firebase somehow similar to a hosting site?
if there are other needed information needed, pls inform me, I may not have included information that could help with my questions :)
ill update my question too if I have more questions.
thank you.
I think for your requirements its is more appropriate to use Firebase as it fulfills all your expectations and provides additional features.
I hired a programmer to make a basic program in for me that is written in PHP.
I am hosting it on my own web host.
It is basically a web crawler that returns data on certain websites that are entered into the database.
This software was created without any "user account" functionality- it is just a single instance that is not even properly protected by a login/password button.
I want to finish developing this cloud-hosted software and then be able to sell it to people on a monthly subscription. Obviously I will need a way to create an account for every person that signs up- so they can each access their own account of the software with their own database of whatever websites they want to enter into the software(in other words just how every cloud software works).
My question is definitely a newb one, but basically I want to know, what technology is used to do this? What kind of program/service/code is used to add simple "user account functionality to a basic cloud software?
P.S. I would ask the guy who made it but he took my money and ran after making a a piece of junk.
The way that this is done is to modify the PHP to add a login feature. There is unlikely to be an out of the box solution that will work. Rather than having to create a new database every time someone signs up, you would modify the existing database to add a user column to each table, and then update the code to only display the data for the currently logged in user.
Unless you want to spend a few months learning PHP and whatever database you are using, you're going to want to hire another programmer to do this for you. Someone good would charge $200-300 for this. Or you can try taking the lowest bidder for $50 or so, and hope they don't run off too.
Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 9 years ago.
Improve this question
I'm developing a mobile web for android, iphone & blackberry. We should enforce license for users. Let us say this product comes with 3 types of license.
1 user 50USD
3 user 100USD
5 user 200USD
10 user 300 USD and so on...
They say "if customer has purchased application for 3 users then he should be allowed to access the application only in 3 devices, when he tries to access the same in 4th device he should be sent to some error page"
Let me explain further, we are designing a table, order selection app for restaurant, where every table(or waiter) will have a mobile, he/she opens the application and orders for the selected table. In such case a web app can be accessed in any device and customer may buy and install the app on their server and ask every one to access. That means he'll buy the product for one device and uses in many. So through PHP we need to limit the product to only one device. Remember it can be any device he's wish whenever, whatever the device he might use application should be accessed by/on x devices.
How can we do this? Any suggestions are welcomed.
Thanks in advance.
(FWIW I'd be very skeptical of buying a product licenced per device rather than on the basis of a named user).
The problem will be differentiating between devices.
While browser finger printing can provide very impressive results these datasets are predominantly filled with desktop browsers - I suspect you would see a lot less variation between mobile browsers (when was the last time you installed a new font on your android / iphone).
make a database of allowed devices, and set those devices with a cookie or track the users ip address (not recommended since it changes). You might also want to look into UNIX timestamps for figuring out time operations related to this.
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 5 years ago.
Improve this question
I am trying to learn how I can add PayPal Subscription to my existing PHP app using IPN and looking for a good article that explains the ins-and-outs.
In my app, users can register for a free account and then they can select a membership type and rate (daily, weekly, monthly and yearly). When they have made their selection, the configured PayPal button is displayed. They can click the Subscribe button which takes them to PayPal.
I need to know how to identify the user: what custom information to send to PayPal that is then sent back? I would also like to know what information PayPal sends back to the IPN page.
It seems that the button can be configured for the notify url. Does that mean I still have to turn on IPN?
I just have too many questions to list here... The PayPal site does not have any teaching material that explains Subscriptions and how to integrate it into a site.
Any good and recent articles you know of?
anon445699, I completely agree with you about the subscribe information it mostly shows you how to generate a button with no parameters.
Maybe this will help some people in the future, it oulines all the possible parameters for subscriptions. I know it helped me
https://www.paypalobjects.com/en_US/ebook/subscriptions/html.html
There are plenty of articles out there, just google it. The date doesn't matter as much, most of the main functionality is basically the same, they don't change it much because a ton of people rely on it being the same. What you really need to do though, is look at the documentation at paypal, its quite thorough, and even has code samples. Including for subscriptions, how do you think the people who wrote articles, and everyone who has implemented it did it? Did they just guess and hope for the best?
Next get yourself an account on the paypal sandbox. Want to know what the IPN sends back? Setup a script to catch an IPN post, and save all the $_POST data to a file, and see for yourself using the sandbox to complete a fake order. Thats what I did when implementing paypal. Of course, the return values are also noted in the documents as well.
Edit
I believe the field they will send back is called custom. You could hijack a field you are not using, like productnumber. Or maybe use the payer_id field. Or identify them with their email. There is not just one way to do it. The best way to find out though, is to try it on the sandbox rather than waiting for someone to do it for you or write an article. You could have saved yourself 3 days of reading if you would just try it.
Links
Found these in about 2 minutes, there is more than enough info in these to get the job done.
Various IPN and subscription tutorials:
http://net.tutsplus.com/tutorials/php/using-paypals-instant-payment-notification-with-php/
http://www.web-development-blog.com/archives/easy-payments-using-paypal-ipn/
http://www.paymentsplus.com.au/joomla/faq/paypal-buy-now-guide.html
Sandbox:
https://developer.paypal.com/devscr?cmd=_signup-run
Paypal Documentation:
https://cms.paypal.com/us/cgi-bin/?cmd=_render-content&content_ID=developer/e_howto_html_subscribe_buttons (this is the one you really want)
https://cms.paypal.com/us/cgi-bin/?cmd=_render-content&content_ID=developer/e_howto_admin_IPNIntro