iOS Question Error Purchase in the App

toro1950

Active Member
Licensed User
Hi, after much research I managed to understand at least in part, or at least I hope, of what is reported in the link https://www.b4x.com/android/forum/threads/istore-in-app-purchases.49301/#content.
Created a test account
After having inserted the code reported in the link to test it I have this error :
Using a ProvisionFile with * character that I used before inserting the code I have:
Provisioning profile used doesn't support the Purchase in the App capability
If I try to use an explicit provisional file nothing is installed on the iphone
I can only download the archive.zip file
if I try Compile and run I have this error :
The provision profile can only be used in the Release build
If I understand correctly, maybe I should create a new profile
but I have no idea what kind? or I didn't understand anything at all.
 

toro1950

Active Member
Licensed User
Hi Erel, this is the displayed text
B4i Versione: 8.51
Analisi del Codice. (0.19s)
Building folders structure. (0.16s)
Esecuzione azione personalizzata. (0.04s)
Compilazione del codice. (0.20s)
Compilazione del codice di layouts (0.00s)
Compilazione Progetto Xcode. (0.07s)
Preparazione del progetto per la sua costruzione. (0.29s)
Dimensioni del progetto: 2.87 MB
Invio dati a compilatore remoto. Error
Out: Command line invocation:
/Applications/Xcode.app/Contents/Developer/usr/bin/xcodebuild -configuration Release PRODUCT_NAME=RealPetBook CONFIGURATION_BUILD_DIR=/Users/administrator/Documents/UploadedProjects/<user id>/Payload "CODE_SIGN_IDENTITY=iPhone Distribution: NVR Software di Navarra Rosaria (5F3BY4JZWQ)" "OTHER_CODE_SIGN_FLAGS=--keychain <user id>" PROVISIONING_PROFILE=fbf67cd1-9e6c-47ed-89b9-50d8254928cf -arch arm64

User defaults from command line:
IDEPackageSupportUseBuiltinSCM = YES

Build settings from command line:
ARCHS = arm64
CODE_SIGN_IDENTITY = iPhone Distribution: NVR Software di Navarra Rosaria (5F3BY4JZWQ)
CONFIGURATION_BUILD_DIR = /Users/administrator/Documents/UploadedProjects/<user id>/Payload
OTHER_CODE_SIGN_FLAGS = --keychain <user id>
PRODUCT_NAME = RealPetBook
PROVISIONING_PROFILE = fbf67cd1-9e6c-47ed-89b9-50d8254928cf

note: Using codesigning identity override: iPhone Distribution: NVR Software di Navarra Rosaria (5F3BY4JZWQ)
ComputeTargetDependencyGraph
note: Building targets in dependency order
note: Target dependency graph (1 target)
Target 'B4iProject' in project 'B4iProject' (no dependencies)

GatherProvisioningInputs

CreateBuildDescription

ExecuteExternalTool /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -v -E -dM -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS17.4.sdk -x c -c /dev/null

ExecuteExternalTool /Applications/Xcode.app/Contents/Developer/usr/bin/ibtool --version --output-format xml1

ExecuteExternalTool /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -v -E -dM -arch arm64 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS17.4.sdk -x objective-c -c /dev/null

ExecuteExternalTool /Applications/Xcode.app/Contents/Developer/usr/bin/actool --print-asset-tag-combinations --output-format xml1 /Users/administrator/Documents/UploadedProjects/<user id>/Images.xcassets

ExecuteExternalTool /Applications/Xcode.app/Contents/Developer/usr/bin/actool --version --output-format xml1

ExecuteExternalTool /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -v -E -dM -arch arm64 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS17.4.sdk -x c -c /dev/null

ExecuteExternalTool /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld -version_details

Build description signature: e7d9997c2abb825caba1d4c2ae5652d7
Build description path: /Users/administrator/Documents/UploadedProjects/<user id>/build/XCBuildData/e7d9997c2abb825caba1d4c2ae5652d7.xcbuilddata
/Users/administrator/Documents/UploadedProjects/<user id>/B4iProject.xcodeproj: error: Provisioning profile "Pertutto" doesn't support the In-App Purchase capability. (in target 'B4iProject' from project 'B4iProject')

Error: ** BUILD FAILED **
 
Upvote 0

toro1950

Active Member
Licensed User
Thanks Erel, I followed your instructions, now it works well, but since it's the first time I sell an app on the Apple Store I still have some requests to make.
I would like the app to be able to be downloaded for free, tried for 10 days and if you like it it can be purchased for 1 year and after
1 year for another year and so on for each year, by checking the days passed, I could do it with the following code
B4X:
If testo1="annuale" Then
    If giornitr>355 Then
            MyStore.Initialize("MyStore")
            If MyStore.CanMakePayments = True Then
                MyStore.RequestPayment("product.id")
            End If
    End If
End If
    If testo1="vers trial" Then
        If giornitr >10 Then
            MyStore.Initialize("MyStore")
            If MyStore.CanMakePayments = True Then
                MyStore.RequestPayment("product.id")
            End If
        End If
                       
    End If

B4X:
Sub MyStore_PurchaseCompleted (Success As Boolean, Product As Purchase)

    Log("Purchase completed")
    If Product.IsInitialized Then
        Log("Product: " & Product.ProductIdentifier & ", date=" & DateTime.Time(Product.TransactionDate) & _
       ", Transaction identifier=" & Product.TransactionIdentifier)
    End If
    If Success =True Then
'Record the current date
    End If
End Sub

Is it possible to do all this? Does Apple allow it?
I tried the test version with an annual product.it, which I think is the right option, and it allows me to pay the annual
subscription at the next test it warns me that the subscription expires in a year so it does not allow me to pay
in this case how to try the app for a trial period (eg 10 days)? will the subscription renewal request be checked and managed
by Apple? what to do if the subscription is not renewed? does the loop payment request not allow you to use the app?
The second code
Sub MyStore_PurchaseCompleted (Success As Boolean, Product As Purchase)
lets me know that the purchase has been made
Erel if you can help me it would be a great pleasure for me and I will try to repay you in some way.

In the meantime, prepare for my next post for the android version if I don't find anything on the forum
 
Upvote 0
Top