Awesome @lukasz.k we will pull your fix. Thanks for looking into this.
On the latest develop, the InAppPurchases PIP fails to build (ios).
Showing Recent Errors Only
Prepare build
note: Using new build systemnote: Planning buildnote: Constructing build description
Build target InAppPurchasesDemo - App of project InAppPurchasesDemo with configuration Debug
CompileC /Users/oli/Library/Developer/Xcode/DerivedData/InAppPurchasesDemo-gdpsdcimfotxejgwbgapmydgtzue/Build/Intermediates.noindex/InAppPurchasesDemo.build/Debug-iphoneos/InAppPurchasesDemo\ -\ App.build/Objects-normal/arm64/Main.o /Users/oli/Desktop/InAppPurchasesDemo/Source/Main.cpp normal arm64 c++ com.apple.compilers.llvm.clang.1_0.compiler (in target: InAppPurchasesDemo - App)
cd /Users/oli/Desktop/InAppPurchasesDemo/Builds/iOS
export LANG=en_US.US-ASCII
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -x c++ -arch arm64 -fmessage-length=0 -fdiagnostics-show-note-include-stack -fmacro-backtrace-limit=0 -std=c++14 -stdlib=libc++ -Wno-trigraphs -fpascal-strings -O0 -fno-common -Wno-missing-field-initializers -Wno-missing-prototypes -Wunreachable-code -Wnon-virtual-dtor -Wno-overloaded-virtual -Wno-exit-time-destructors -Wno-missing-braces -Wparentheses -Wswitch -Wunused-function -Wno-unused-label -Wno-unused-parameter -Wunused-variable -Wunused-value -Wempty-body -Wuninitialized -Wno-unknown-pragmas -Wno-shadow -Wno-four-char-constants -Wno-conversion -Wconstant-conversion -Wint-conversion -Wbool-conversion -Wenum-conversion -Wno-float-conversion -Wnon-literal-null-conversion -Wobjc-literal-conversion -Wshorten-64-to-32 -Wno-newline-eof -Wno-c++11-extensions -D_DEBUG=1 -DDEBUG=1 -DPIP_JUCE_EXAMPLES_DIRECTORY=L1VzZXJzL29saS9EZXYvTXlKVUNFUHJvamVjdHMvSlVDRS9leGFtcGxlcw== -DJUCER_XCODE_IPHONE_5BC26AE3=1 -DJUCE_APP_VERSION=1.0.0 -DJUCE_APP_VERSION_HEX=0x10000 -DJucePlugin_Build_VST=0 -DJucePlugin_Build_VST3=0 -DJucePlugin_Build_AU=0 -DJucePlugin_Build_AUv3=0 -DJucePlugin_Build_RTAS=0 -DJucePlugin_Build_AAX=0 -DJucePlugin_Build_Standalone=0 -DJucePlugin_Build_Unity=0 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS12.1.sdk -fstrict-aliasing -Wdeprecated-declarations -Winvalid-offsetof -miphoneos-version-min=9.3 -g -fvisibility-inlines-hidden -Wno-sign-conversion -Winfinite-recursion -Wmove -Wcomma -Wblock-capture-autoreleasing -Wstrict-prototypes -Wrange-loop-analysis -Wno-semicolon-before-method-body -fembed-bitcode-marker -index-store-path /Users/oli/Library/Developer/Xcode/DerivedData/InAppPurchasesDemo-gdpsdcimfotxejgwbgapmydgtzue/Index/DataStore -I/Users/oli/Desktop/InAppPurchasesDemo/Builds/iOS/build/Debug/include -I../../JuceLibraryCode -I/Users/oli/Dev/MyJUCEProjects/JUCE/modules -I/Users/oli/Library/Developer/Xcode/DerivedData/InAppPurchasesDemo-gdpsdcimfotxejgwbgapmydgtzue/Build/Intermediates.noindex/InAppPurchasesDemo.build/Debug-iphoneos/InAppPurchasesDemo\ -\ App.build/DerivedSources/arm64 -I/Users/oli/Library/Developer/Xcode/DerivedData/InAppPurchasesDemo-gdpsdcimfotxejgwbgapmydgtzue/Build/Intermediates.noindex/InAppPurchasesDemo.build/Debug-iphoneos/InAppPurchasesDemo\ -\ App.build/DerivedSources -Wreorder -F/Users/oli/Desktop/InAppPurchasesDemo/Builds/iOS/build/Debug -MMD -MT dependencies -MF /Users/oli/Library/Developer/Xcode/DerivedData/InAppPurchasesDemo-gdpsdcimfotxejgwbgapmydgtzue/Build/Intermediates.noindex/InAppPurchasesDemo.build/Debug-iphoneos/InAppPurchasesDemo\ -\ App.build/Objects-normal/arm64/Main.d --serialize-diagnostics /Users/oli/Library/Developer/Xcode/DerivedData/InAppPurchasesDemo-gdpsdcimfotxejgwbgapmydgtzue/Build/Intermediates.noindex/InAppPurchasesDemo.build/Debug-iphoneos/InAppPurchasesDemo\ -\ App.build/Objects-normal/arm64/Main.dia -c /Users/oli/Desktop/InAppPurchasesDemo/Source/Main.cpp -o /Users/oli/Library/Developer/Xcode/DerivedData/InAppPurchasesDemo-gdpsdcimfotxejgwbgapmydgtzue/Build/Intermediates.noindex/InAppPurchasesDemo.build/Debug-iphoneos/InAppPurchasesDemo\ -\ App.build/Objects-normal/arm64/Main.o
In file included from /Users/oli/Desktop/InAppPurchasesDemo/Source/Main.cpp:10:
/Users/oli/Desktop/InAppPurchasesDemo/Source/InAppPurchasesDemo.h:56:37: error: use of undeclared identifier 'InAppPurchases'
class VoicePurchases : private InAppPurchases::Listener
^
/Users/oli/Desktop/InAppPurchasesDemo/Source/InAppPurchasesDemo.h:56:53: error: expected class name
class VoicePurchases : private InAppPurchases::Listener
^
/Users/oli/Desktop/InAppPurchasesDemo/Source/InAppPurchasesDemo.h:132:44: error: use of undeclared identifier 'InAppPurchases'
void productsInfoReturned (const Array<InAppPurchases::Product>& products) override
^
/Users/oli/Desktop/InAppPurchasesDemo/Source/InAppPurchasesDemo.h:177:41: error: unknown type name 'PurchaseInfo'
void productPurchaseFinished (const PurchaseInfo& info, bool success, const String&) override
^
/Users/oli/Desktop/InAppPurchasesDemo/Source/InAppPurchasesDemo.h:200:45: error: use of undeclared identifier 'PurchaseInfo'
void purchasesListRestored (const Array<PurchaseInfo>& infos, bool success, const String&) override
^
/Users/oli/Desktop/InAppPurchasesDemo/Source/InAppPurchasesDemo.h:83:9: error: use of undeclared identifier 'InAppPurchases'
InAppPurchases::getInstance()->removeListener (this);
^
/Users/oli/Desktop/InAppPurchasesDemo/Source/InAppPurchasesDemo.h:92:13: error: use of undeclared identifier 'InAppPurchases'
InAppPurchases::getInstance()->addListener (this);
^
/Users/oli/Desktop/InAppPurchasesDemo/Source/InAppPurchasesDemo.h:94:13: error: use of undeclared identifier 'InAppPurchases'
InAppPurchases::getInstance()->restoreProductsBoughtList (true);
^
/Users/oli/Desktop/InAppPurchasesDemo/Source/InAppPurchasesDemo.h:111:17: error: use of undeclared identifier 'InAppPurchases'
InAppPurchases::getInstance()->purchaseProduct (product.identifier, false);
^
/Users/oli/Desktop/InAppPurchasesDemo/Source/InAppPurchasesDemo.h:134:15: error: use of undeclared identifier 'InAppPurchases'
if (! InAppPurchases::getInstance()->isInAppPurchasesSupported())
^
/Users/oli/Desktop/InAppPurchasesDemo/Source/InAppPurchasesDemo.h:227:13: error: use of undeclared identifier 'InAppPurchases'
InAppPurchases::getInstance()->getProductsInformation (identifiers);
^
11 errors generated.
Build failed 16/12/2018, 12:50 12.4 seconds
ah, ok, just have to enable the capability in the exporter in projucer [edit as explained in the metatdata ]
Donate to charity.
What is the best way to retry a failed InAppPurchases::Download
? To call startDownloads
or resumeDownloads
, I need a Download*
pointer.
Initially, if I call restoreProductsBoughtList
with includeDownloadInfo
, I get Download*
pointers and can call startDownloads
.
But when a download fails, Listener::productDownloadFinished
gets called, and the Download
gets destroyed. From that point, how do I get a fresh Download*
pointer, so I can call startDownloads
or resumeDownloads
again to retry the failed download?
It seems that the only two ways are:
-
purchaseProduct
->productPurchaseFinished
. But I don’t want to prompt the user to purchase again. -
restoreProductsBoughtList
->purchasesListRestored
. This is what I’m doing right now, but I don’t really want to restore IAP purchases.
Is there a better way? And is it possible to resume the download from the progress at which it failed?
[EDIT]
A different issue, but: Often when I use a Download*
pointer in the purchasesListRestored
callback, I get an EXC_BAD_ACCESS when calling Download::getStatus()
. I’m calling it synchronously, but the Download*
pointer already seems to be dangling.