diff options
author | Juan Linietsky <reduzio@gmail.com> | 2014-04-10 00:18:27 -0300 |
---|---|---|
committer | Juan Linietsky <reduzio@gmail.com> | 2014-04-10 00:18:27 -0300 |
commit | 7ea3e8267afaf626256c84a9a3dc61e2954fc6a2 (patch) | |
tree | 0aa7588918b814d1781fc94e8b518c7095a0bab7 /platform/iphone | |
parent | b4969373b3475799d6b24cdffeda4659c37f0b8a (diff) |
-Fixed a few bugs in Viewport
-Made a few demos using Viewport to show it's true power!
-Fixed some start-up error messages.
Diffstat (limited to 'platform/iphone')
-rw-r--r-- | platform/iphone/app_delegate.mm | 6 | ||||
-rw-r--r-- | platform/iphone/detect.py | 2 | ||||
-rw-r--r-- | platform/iphone/in_app_store.mm | 20 |
3 files changed, 21 insertions, 7 deletions
diff --git a/platform/iphone/app_delegate.mm b/platform/iphone/app_delegate.mm index 93b9563988..56cb73ba7b 100644 --- a/platform/iphone/app_delegate.mm +++ b/platform/iphone/app_delegate.mm @@ -33,7 +33,7 @@ #include "core/globals.h" #include "main/main.h" -#ifdef FACEBOOK_ENABLED +#ifdef MODULE_FACEBOOKSCORER_IOS_ENABLED #include "modules/FacebookScorer_ios/FacebookScorer.h" #endif @@ -250,7 +250,7 @@ static int frame_count = 0; } - (BOOL)application:(UIApplication *)application handleOpenURL:(NSURL *)url { -#ifdef FACEBOOK_ENABLED +#ifdef MODULE_FACEBOOKSCORER_IOS_ENABLED return [[[FacebookScorer sharedInstance] facebook] handleOpenURL:url]; #else return false; @@ -259,7 +259,7 @@ static int frame_count = 0; // For 4.2+ support - (BOOL)application:(UIApplication *)application openURL:(NSURL *)url sourceApplication:(NSString *)sourceApplication annotation:(id)annotation { -#ifdef FACEBOOK_ENABLED +#ifdef MODULE_FACEBOOKSCORER_IOS_ENABLED return [[[FacebookScorer sharedInstance] facebook] handleOpenURL:url]; #else return false; diff --git a/platform/iphone/detect.py b/platform/iphone/detect.py index 4b95ef2bea..566249099a 100644 --- a/platform/iphone/detect.py +++ b/platform/iphone/detect.py @@ -81,7 +81,7 @@ def configure(env): '-framework', 'AudioToolbox', '-framework', 'SystemConfiguration', '-framework', 'Security', - #'-framework', 'AdSupport', + '-framework', 'AdSupport', '-framework', 'MediaPlayer', ]) diff --git a/platform/iphone/in_app_store.mm b/platform/iphone/in_app_store.mm index 71e95666af..9b932d147b 100644 --- a/platform/iphone/in_app_store.mm +++ b/platform/iphone/in_app_store.mm @@ -168,6 +168,9 @@ Error InAppStore::request_product_info(Variant p_params) { ret["result"] = "ok"; ret["product_id"] = pid; + NSData* receipt = nil; + int sdk_version = 6; + if([[[UIDevice currentDevice] systemVersion] floatValue] >= 7.0){ NSURL *receiptFileURL = nil; @@ -178,19 +181,30 @@ Error InAppStore::request_product_info(Variant p_params) { receiptFileURL = [bundle appStoreReceiptURL]; // Read in the contents of the transaction file. - ret["receipt"] = receiptFileURL; + receipt = [NSData dataWithContentsOfURL:receiptFileURL]; + sdk_version = 7; } else { // Fall back to deprecated transaction receipt, // which is still available in iOS 7. // Use SKPaymentTransaction's transactionReceipt. - ret["receipt"] = transaction.transactionReceipt; + receipt = transaction.transactionReceipt; } }else{ - ret["receipt"] = transaction.transactionReceipt; + receipt = transaction.transactionReceipt; + } + + NSString* receipt_to_send = nil; + if (receipt != nil) + { + receipt_to_send = [receipt description]; } + Dictionary receipt_ret; + receipt_ret["receipt"] = String::utf8([receipt_to_send UTF8String]); + receipt_ret["sdk"] = sdk_version; + ret["receipt"] = receipt_ret; InAppStore::get_singleton()->_post_event(ret); [[SKPaymentQueue defaultQueue] finishTransaction:transaction]; |