I’ve created a shopify app with PHP. and registered a webhook for ‘app/uninstalled’. Which will remove data from my database.
But when I delete this app the webhook isn’t triggering. Because the store isn’t removing from my database.
Here is my code:
`POST /admin/webhooks.json
'webhook' => array(
"topic" => "app/uninstalled",
"address" => "https://my-domain/apps/app-name/uninstall.php",
"format" => 'json',
),`
Can anyone tell me what is the problem and what things should I need to edit?
I’ve tried for a long time but now I’m stuck with this….
2
Answers
Try to use with exception handling:-
You can pass store-name with address in link and can fetch on delhook.php or your file.
Delhook.php
If you get any error then it will print the error.
If you believe that the webhook had been created. In
https://my-domain/apps/app-name/uninstall.php
put these line of codeIt will catch the json shopify send when you uninstall your apps and put into file something.txt after that get the info your use to store. Json usually look like