0

I need to send something to tell the android app that a customer just clicked the buy button in the page. The online store is written in php, and is embedded into android app by webview.

Usually I will write api to android, and they will just call the php url, then my php can communicate with the front end. However, in this case, it seems that the android has to provide me some kind api to call, so I can send my data to him.

Or is there a way android can set a listener to check if the buy button is clicked?

SSD
  • 295
  • 1
  • 4
  • 15

1 Answers1

0

You can achieve this using 2 ways.

1) Create a java-script in your PHP code and from android Webview you can call that java-script to check whether button clicked or not. You can refer this for implementation.

2) You can use Firebase Cloud Messaging Or anyother 3rd party Push Notification services. But for my opinion FCM is best and you don't need to pay for it. You can refer this for implementation.

Andy Developer
  • 3,071
  • 1
  • 19
  • 39