shopify_app: Webhooks not being generated in client shops
I hope I am not misunderstanding the documentation but after running the following rails command I thought that when a new OAuth session was created the gem would ensure the webhook exists in the clients shop. It seems like the proper line is added to the config/initializers/shopify_app.rb but the webhook is not created on install of the app.
Rails generator code:
shopify_app:add_webhook -t orders/create -a \ http://moedesigns.dyndns.org:3000/webhooks/orders_create
config/initializers/shopify_app.rb code:
config.webhooks = [
{topic: 'orders/create', address: 'http://xxxxx.dyndns.org:3000/webhooks/orders_create', format: 'json'},
]
Am I wrong to think that the webhook should be automatically generated on the client shop when the app is installed or once the OAuth handshake is complete?
About this issue
- Original URL
- State: closed
- Created 8 years ago
- Comments: 16 (7 by maintainers)
The admin endpoint in the browser will only show webhooks that belong to the shop. If you want to see the webhooks that belong to your API Client you need to make an API call to fetch them.
The quickest way to do this to update the example controller that is generated to fetch webhooks instead of products.
Thank you so much, Kevin! For other newbies like me who follow Kevin’s webhooks tutorial, here is the the line to add to the Home Controller (index action):
@webhooks = ShopifyAPI::Webhook.find(:all, :params => {:limit => 10})And then modify the view to display the webhooks:
Thank you very much again @kevinhughes27, you are awesome!!