Skip to content

Commit

Permalink
Add some ios product debug
Browse files Browse the repository at this point in the history
  • Loading branch information
Hugh Sanderson committed Nov 30, 2021
1 parent 28bc2c3 commit 8e60d3c
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 22 deletions.
2 changes: 1 addition & 1 deletion src/nme/store/BillingManager.hx
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ class BillingManager
AndroidBillingManager.init(key);
#elseif ios
IosBillingManager.init();
updateSkuDetails();
//updateSkuDetails();
#end
return available;
}
Expand Down
52 changes: 31 additions & 21 deletions src/nme/store/IosStore.mm
Original file line number Diff line number Diff line change
Expand Up @@ -110,32 +110,42 @@ - (void)validateProductIdentifiers:(NSSet *)productIdentifiers
}



// SKProductsRequestDelegate protocol method.
- (void)productsRequest:(SKProductsRequest *)request didReceiveResponse:(SKProductsResponse *)response
{
hx::NativeAttach haxe;
@autoreleasepool {
NSLog(@"Got response products: %@",response.products);
bool found = false;
for(SKProduct *product in response.products)
NSLog(@"Got response : %@",response);
if (response!=nil)
{
BM::addSkuDetails(
product.productIdentifier,
product.localizedTitle,
product.localizedDescription,
priceToString( product ),
String()
);
found = true;
}
if (found)
BM::onSkuDetailsDone( );


self.products = response.products;

NSLog(@"Got response errors: %@",response.invalidProductIdentifiers);
for (NSString *invalidIdentifier in response.invalidProductIdentifiers) {
// Handle any invalid product identifiers.
NSLog(@"Got response products: %@",response.products);
bool found = false;
for(SKProduct *product in response.products)
{
NSLog(@" product: %@",product);
NSLog(@" p id: %@",product.productIdentifier);
NSLog(@" p tit: %@",product.localizedTitle);
NSLog(@" p des: %@",product.localizedDescription);
BM::addSkuDetails(
product.productIdentifier,
product.localizedTitle,
product.localizedDescription,
priceToString( product ),
String()
);
found = true;
}
if (found)
BM::onSkuDetailsDone( );


self.products = response.products;

NSLog(@"Got response errors: %@",response.invalidProductIdentifiers);
for (NSString *invalidIdentifier in response.invalidProductIdentifiers) {
// Handle any invalid product identifiers.
}
}
}
}
Expand Down

0 comments on commit 8e60d3c

Please sign in to comment.