Auto Renewing Subscriptions for iOS Apps with Laravel
This repository help you to handle iOS Application Subscription on server side.
- Save and Check User Subscription
- Check Webhook Logs
- Simple Admin panel for Check App User with device token and User subscription
This demo for handel iOS Application Subscription server side.
- Download the repository by cloning it or in zip format & extract to your project folder
- Run 'composer install' to install the packages used in this project.
- Copy .env.example to .env & update the necessary parameters.
- import database/migrate (apple_subscription.sql), If your importing database credential email : admin, password : admin
php artisan migrate
How it's works?
- There one api
api/subscribewhich is used for save/check subscription with parameters
- This iOS app is made for usable for without login/register, So for that we are creating user with device token.
- For saving subscription store
original_transaction_idwhich is we can get after apple subscription response.
- For checking subscription we are checking end_date from database which is update from webhook, API for webhook
api/webhookand URL for webhook
https://example.com/api/webhookthis url we have to add in Apple account and
httpsis must for Apple webhook.
end_dateis updated from webhook when the some one cancel or subscription has beed expired.
- If you want to check webhook is working fine and check logs you can check all logs at
- There are not clear documentation available but you can get more details here
- I have get all idea from this source and created this demo for others
This project is free for anyone who wishes to copy and replicate / customize for their needs as long as they adhere to the license terms & conditions of the packages included.