Store InApp-Kauf verbessert
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user