인앱 구매를 제외하고 My Ionic 3 애플리케이션이 훌륭하게 작동합니다. 기본 코드 고지 알림 플러그인 (link here)을 사용하고 있습니다. 제가 연습을 시작해야 할 때 다른 apis와 작업 할 때 코드를 밟아 나가는 것이 최선이 아닙니다.Ionic Cordova In App Purchase - Fail
응용 프로그램을 빌드 할 때 오류가 발생하지 않으며 단추를 클릭 할 때 오류가 발생하지 않습니다. 나는 단순히 우둔 해.
은 = 'my.sku.that.is.active.in.the.ios.and.android.appstore은'
코드
this.purchaseId :buyButton() {
this.iap.buy(this.purchaseId)
.then((data) => {
console.log(data)
localStorage.setItem("premium", "1");
this.premiumUser = true;
let toast = this.toastCtrl.create({
message: "You are now a premium user. Congradulations and thank you for contributing.",
showCloseButton: true,
closeButtonText: "Welcome"
});
toast.present();
}).catch((err) => {
let toast = this.toastCtrl.create({
message: err + "",
showCloseButton: true,
closeButtonText: "OK"
});
toast.present();
});
}
없음 구매 상자가 나타납니다 없으며,
오류가 발생하지 않습니다. 아마도 누군가가 수정 사항을 알고있을 것입니다. 당신은 매우 높이 평가 될 것입니다.catch 문은 축배 알림에서 '[Object object]'를 반환합니다.
'ionic serve'를 사용하여 브라우저에서 테스트 중이십니까? – Sampath
어쩌면 promise.then 또는 catch 후에 오류 기능을 추가해보십시오. –
@Sampath 아니요. Ionic Serve에서는 테스트하지 않지만 iOS 10을 실행하는 iPad에서는 코드가 제대로 작동합니다. 예를 들어 SKU Playstore와 앱 스토어에서 일치합니다. 흠 ... –