Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/j3k0/cordova-subscription-example
Example of a cordova app implementing subscriptions
https://github.com/j3k0/cordova-subscription-example
Last synced: 22 days ago
JSON representation
Example of a cordova app implementing subscriptions
- Host: GitHub
- URL: https://github.com/j3k0/cordova-subscription-example
- Owner: j3k0
- Created: 2023-09-27T06:26:17.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2024-01-22T09:35:38.000Z (10 months ago)
- Last Synced: 2024-04-08T00:24:12.949Z (7 months ago)
- Language: CSS
- Size: 220 KB
- Stars: 0
- Watchers: 3
- Forks: 2
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# cordova-subscription-example
> How to unlock a simple subscription-based premium feature in a cordova application.
[View the demo in action](https://j3k0.github.io/cordova-subscription-example/).
## How to get started
### Example without a backend server
- Run `npm install` at the root of the project to install cordova locally for the project.
- From the `without-server/` directory:
- `npm run browser` will run the demo in the browser
- To run the demo on Android, a few extra steps are required:
- Update `config.xml` to use your own application id.
- Update `www/ts/subscription-service.ts` to use your own [iaptic](https://iaptic.com) configuration and product identifiers.
- From the `without-server/` directory, `npm run android` will build the demo for android.> Note: If you are curious to know what those `npm run` commands do, just type `npm run` without arguments.
### Example with a backend server
This example requires you to deploy the demo server: https://github.com/iaptic/iaptic-example-nodejs-backend
It's a minimal server that handles user sessions and subscription status.Running the demo is similar to the example without a server.
All configuration for that example is in `www/ts/configuration.ts`
## Reading through the code
Source code in typescript is included in the `cordova/www/ts` directory.
- The entrypoint is `index.ts`
- In-App Purchases are handled in `subscription-service.ts`
- The pages are rendered in `pages/*-page.ts`## Copyright
(c) 2023, Jean-Christophe HOELT
License: MIT