Store InApp-Kauf verbessert

This commit is contained in:
2016-01-07 23:08:12 +01:00
parent a2b2b6b37e
commit 4e31f6eda6
2 changed files with 26 additions and 11 deletions

View File

@@ -19,11 +19,7 @@ angular.module('starter.controllers', [])
};
function buysuccessHandler (result) {
inappbilling.consumePurchase(successHandler, errorHandler, $scope.preis);
}
function successHandler (result) {
function successBuyHandler (result) {
var strResult = "";
if(typeof result === 'object') {
strResult = JSON.stringify(result);
@@ -33,16 +29,35 @@ angular.module('starter.controllers', [])
alert("SUCCESS: \r\n"+strResult );
}
function errorHandler (error) {
function successConsumeHandler (result) {
var strResult = "";
if(typeof result === 'object') {
strResult = JSON.stringify(result);
} else {
strResult = result;
}
alert("SUCCESS: \r\n"+strResult );
}
function errorBuyHandler (error) {
alert("ERROR: \r\n"+error );
}
}
$scope.buyAdFree = function() {
function errorConsumeHandler (error) {
alert("ERROR: \r\n"+error );
}
alert($scope.preis);
function buysuccessHandler (result) {
inappbilling.consumePurchase(successConsumeHandler, errorConsumeHandler, $scope.preis);
}
$scope.buyRose = function() {
//alert($scope.preis);
if((window.device && device.platform == "Android") && typeof inappbilling !== "undefined") {
inappbilling.buy(buysuccessHandler, errorHandler, $scope.preis);
inappbilling.buy(successBuyHandler, errorBuyHandler, $scope.preis);
}
}