Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handle empty Product Data case with event #43

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions extension/iap/IAPEvent.hx
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ class IAPEvent extends Event {
public static inline var PURCHASE_CONSUME_FAILURE = "consumeFailed";
public static inline var PURCHASE_PRODUCT_DATA_COMPLETE = "productDataComplete";
public static inline var PURCHASE_PRODUCT_DATA_FAILED = "productDataFailed";
public static inline var PURCHASE_PRODUCT_DATA_EMPTY = "productDataEmpty";
public static inline var PURCHASE_QUERY_INVENTORY_COMPLETE = "queryInventoryComplete";
public static inline var PURCHASE_QUERY_INVENTORY_FAILED = "queryInventoryFailed";
public static inline var DOWNLOAD_COMPLETE = "downloadComplete";
Expand Down
4 changes: 4 additions & 0 deletions extension/iap/ios/IAP.hx
Original file line number Diff line number Diff line change
Expand Up @@ -291,6 +291,10 @@ import haxe.Json;

dispatchEvent (new IAPEvent (IAPEvent.PURCHASE_PRODUCT_DATA_FAILED, data));

case "productDataEmpty":

dispatchEvent (new IAPEvent (IAPEvent.PURCHASE_PRODUCT_DATA_EMPTY, data));

default:

}
Expand Down
1 change: 1 addition & 0 deletions project/iphone/InAppPurchase.mm
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,7 @@ - (void)productsRequest:(SKProductsRequest *)request didReceiveResponse:(SKProdu
else
{
NSLog(@"No products are available");
sendPurchaseEvent("productDataEmpty", nil);
}
}

Expand Down