No More Posting New Topics!

If you have a question or an issue, please start a thread in our Github Discussions Forum.
This forum is closed for new threads/ topics.

Navigation

    Quasar Framework

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search

    get in-app purchase working with cordova-plugin-purchase

    Framework
    cordova in-app purchase
    2
    2
    518
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • P
      pankaj last edited by

      Re: In app purchase for iOS and Android Example?

      @walfin can you pls post the code or steps for implementing the cordova-plugin-purchase in quasar and getting the products.

      W 1 Reply Last reply Reply Quote 0
      • W
        walfin @pankaj last edited by

        @pankaj I have gotten it working already.

        cordova plugin add cordova-plugin-purchase.

        Here is my boot file:

        import productIds from '../utils/productIds';
        
        export default ()=>{
        	if(process.env.MODE!=='cordova')return;
        	if(!window.store){
        		console.log('Store not available');
        		return;
        	}
        	store.validator='https://validator.fovea.cc/v1/validate?appName=...&apiKey=...';
        	productIds.forEach(id=>{
        		store.register({
        			id,
        			type:id.endsWith('_single')?store.CONSUMABLE:store.PAID_SUBSCRIPTION
        		});
        		store.when(id).approved(product=>product.verify()).verified(product=>product.finish());
        	});
        	store.error(error=>{
        		console.log(error);
        		store.refresh();
        	});
        	store.refresh();
        };
        

        And in my store component page I just call

        store.order(product);
        

        I also used PayPal for the equivalent purchases in electron.

        1 Reply Last reply Reply Quote 1
        • First post
          Last post