score:0
you didn't describe what is going wrong, but here's a basic configuration that works for me on ios.
i'm only including the part about the store:
index.tsx
import { iapproduct, inapppurchase2 } from '@ionic-native/in-app-purchase-2';
const startstoreeventlisteners = () => {
if (isplatformmobile()) {
document.addeventlistener(
'deviceready',
() => {
const store = inapppurchase2;
// needed to use iap + cordova plugins.
// set debug messages.
// default.
store.verbosity = store.quiet;
// store.verbosity = store.debug;
store.register([
{
id: submonthly,
type: store.paid_subscription,
},
{
id: subannual,
type: store.paid_subscription,
},
]);
// upon approval, verify the receipt.
store.when(submonthly).approved((product: iapproduct) => {
product.verify();
});
store.when(subannual).approved((product: iapproduct) => {
product.verify();
});
// upon receipt validation, mark the subscription as owned.
store.when(submonthly).verified((product: iapproduct) => {
product.finish();
});
store.when(subannual).verified((product: iapproduct) => {
product.finish();
});
// track all store errors
store.error((err: error) => {
debuglog('store error', json.stringify(err));
});
// https://billing-dashboard.fovea.cc/setup/cordova
store.validator =
'https://validator.fovea.cc/v1/validate?appname=secret';
store.refresh();
startionic();
},
false,
);
} else {
startionic();
}
};
startstoreeventlisteners();
serviceworker.unregister();
note that @ionic-native packages are deprecated and need to be converted.
Source: stackoverflow.com
Related Query
- How to In App Purchases with ReactJS and Capacitor
- How can I configure react-router to with nginx/cherrypy and my current reactjs app
- Not Sure How to Start and Deploy ReactJS App on Production Server with ExpressJS
- How to customize bootstrap 4 in reactjs app with reactstrap dependency?
- How to read console.log from a mounted component with Enzyme and Jest in Create React App
- How do you test a reactjs web app with selenium?
- Managing 'window' object in Isomorphic App with ReactJS and Flask Python
- How to design a ReactJS component that listens to a WebSocket and interacts with CSS animation
- How to fix "Failed to load resource: net::ERR_FILE_NOT_FOUND" for static images on cordova app using Reactjs and create-react-app
- How to add login authentication and session to ReactJS React Router and Redux with MongoDB + NodeJS Express?
- How to split app and vendor code with Webpack
- how to build a standalone desktop app built with react, using a node backend, and wrap both frontend and backend in electron as a desktop app?
- How to serve React app with Material-UI and react-router
- How do I integrate React with a non-trivial AngularJS app and existing grunt configurations?
- how to run my node application and react app in the same time with one command?
- How to send email with ReactJS and SendGrid?
- ReactJs : how to check Proptypes with function and shape?
- How can I build a React app with Webpack and import an assets folder?
- My ReactJS flux App has too many 'actiontype' constants, how can I separate and namespace them?
- How to determine the order of css in my create react app build with webpack and customize-cra?
- How to use reduce() instead a traditional foreach loop with ReactJs app
- How to run production build of a ReactJS app with Parcel bundler?
- How to paginate Cloud FireStore data with ReactJs and Hooks
- How can I configure create-react-app to create an app with classes and not functions?
- How to conect docker nginx with express and react app on windows
- How to deploy React app with docker and serve -s build
- How can I Fetch and display Mysql data into ReactJS front end with Node JS as backend?
- How can I create a button which Fetches image from API and download to the local with using ReactJs
- How to deploy reactJS app with json-server
- How to uploading file with ReactJS and Axios
More Query from same tag
- Target an object while fetching json from mock api with ReactJS
- Building a SPA with react on top of MVC Routes
- React Router `browserHistory`: Do I have to render on server?
- How to Jump to particular section using React router-dom Link
- How to rerender the tree in antd after adding a node to an existing node?
- How to setup redux-promise so that axios request has time to finish?
- Why isn't onSubmit working for my React-Bootstrap form?
- How to access the updated state after setState method with react hooks?
- React/Webpack applying styles to tags but not classes/ids
- incorporating p5.js in a Next.js (React App) website
- How do i use setState to update an object inside an array
- Sort by date on React database call not working - just returning oldest first
- How can I update the state in a class component?
- How to style child component in a react styled-component?
- ReactJS - Adding (Mollie) script to React page
- jest test:coverage with react propTypes / defaultProps
- React Router 404 page
- Access the data set in the parent component using setState
- React Context API - Consuming context inside a function, undefined error
- How do I trigger an action after login using react-redux and react-aad-msal?
- console.log is returning the function instead of returning interger
- this.setState isn't making changes in state
- Calling setState in render is not avoidable
- Why is react react-hooks/exhaustive-deps changing my code?
- How to pass data to a single component
- How class call other class function in react?
- React Router *Not Found* rendered first before main routes
- [React]Module not found: You attempted to import ../../img/photo.jpg which falls outside of the project src/ directory. src/ are not supported
- In the following code, why does useEffect care if a variable is null?
- How to render data from API response in React?