How to create Flutter chat app with PHP Mysql rest api? - mysql

I want to create a chat app in Flutter but all chat data need to store on my server Mysql via PHP API as backend. (I do not want Firebase Firestore or Realtime database)
As many people create chat app on the web via the help of JavaScript, jQuery & Ajax but I don't know how I will use this on Flutter.

You can create your database with MySQL, and your backend API with php. For the backend you can use SLIM or Laravel or any other php framework. Then in your flutter code you will need to make http requests to this API.
A problem that you can face is Realtime because streams in flutter do not make the data retrieval realtime from a php API. To solve this you will need to add a timer that periodically refreshes the chat. A better solution is to use sockets to make the chat realtime. You can also use firebase cloud messaging for notifications which is free of charge.
This might be useful for you:
https://www.youtube.com/watch?v=6vOIk2-WoxQ&list=PL_5DleQzXnX4GRhKef32CiSs2oBfTVxe3

Related

How to call third party site's json api from shopify custom app

I created custom app in shopify admin. But I don't know how to call thirdparty site json api with that app. Can anyone help me about this.
In your App, set up the App Proxy. That is an endpoint in your App, GET or POST that you can receive data at. Shopify will call that endpoint with security so you know inside your App the call is a good one. Since you are inside your secure App, this is the place where you can call your third-party API to get data. Once that call completes, you can return JSON to Shopify.
In Shopify theme, the call is /apps/my_end_point with data. Shopify mangles all that, and sends it to your Proxy. So your proxy get data from the front-end, and you can then safely call your APIs, and return JSON to Shopify.
Simple and elegant pattern of use you have to use. There really is no other way to do it securely.

How to test WebHooks without an on-premise external system?

I'm trying to teach myself about integrating systems via WebHooks.
In a free/hosted GIS system, I can create a WebHook that would, in theory, POST a JSON object to an external system.
The problem is, I don't have an external system that's available right now for for receiving the POST.
I think I need some sort of publicly available sample server that would:
Receive the POST requests
Do something with the requests (ie. create some sort of record)
...so that I could determine if the WebHook worked correctly or not.
How can I test my WebHooks without having an on-premise external system?
I've poked around websites like Postman Echo and Amazon Lambda. But to my untrained eye, it seems like they're not quite designed for what I need.
You could use any of these options depending on your requirements:
You could use webhooks modules in services like Integromat or Zapier to receive webhook data and then apply transformation.
You could deploy a script on heroku and use the URL generated there to send the webhooks calls.
You could also use services like requestbin, webhook.site etc if you just want to receive webhooks data.
Regards

How do i create api keys for users on my client instead of developer portal offered in azure api management?

I have an enpoint in my MERN app which I would like to expose to developers.
I came across APIM and would like to use it.
After going to the documentation I would like to know how do I can use APIM for my specific enpoint and where I allow users to generate API's in my client side react app.
I am also going through the API management API. but don't know how to generate user specific API keys...
You could simply mimic what the Developer Portal does using APIMs REST API.
If you are using the Consumption Tier of APIM, you can just create a standalone subscription using the Create or Update Subscription API. Yon don't have to set properties.ownerId in the request payload here.
On the other tiers, standalone subscriptions are not supported yet (but will be as mentioned in the official announcement blog under New Features), so you will have to create a user first using the Create or Update User API and then create a new subscription mentioning this user under properties.ownerId as /users/{userId}.
Since these REST APIs call the Azure Management API, you shouldn't be making these requests from the client and instead should be calling this from your backend.

How to show Laravel database data in Ionic

I am integrating an Ionic Framework with Laravel. In MYSQL table there is a option table(master-table) which is having certain options says Table, chairs, suite case etc etc.
I am not getting how can I fetch the data of table in ionic view to display all the options in dropdown.
When I was developing web Application as its in laravel, so in blade view I can directly able to fetch it.But I am not getting an Idea how to do it in ionic view, as I am consuming API services.
Please guide me for this.
For safety reasons it is usually best practice to create a rest api and call the endpoints via the http module to access your database. See the link: https://ionicframework.com/docs/native/http/
If you choose to access the database that means you would have to store credentials in the ionic app which is quite dangerous.

Connecting to mysql database from ios

What is the right way to connect to database from an iphone app? I built a website and now I want to biild an app that can enter and veiw information from the database, like autotrader and rightmove how they get the same information on the website in the iphone app?
You need to create a REST API (PHP) fetch & update data from the centralized Mysql DB.
You can call this through NSURLConnection. Your REST API returns XML or JSON.from you coding u can write coding to parse.