inAppPurchaseSetTitle(getAppName())
InAppPurchaseSetKeys ( "******", "" )
InAppPurchaseAddProductID( "token_0", 0 )
InAppPurchaseSetup()
filename$ = "tokens.datas"
do
if GetFileExists( filename$ )
if GetInAppPurchaseAvailable2(0) = 0
InAppPurchaseActivate(0)
PurchaseStat = GetInAppPurchaseAvailable2(0)
if PurchaseStat = 4
file = OpenToRead(filename$)
TOKENS=val(Readline(file))
TOKENS = TOKENS+10
CloseFile(file)
file = OpenTowrite( filename$, 0 )
WriteString(file,str(TOKENS))
CloseFile(file)
endif
endif
endif
Sync()
loop
filename$ = "tokens.datas"
if GetFileExists( filename$ )
if GetInAppPurchaseAvailable2(0) = 0
InAppPurchaseActivate(0)
PurchaseStat = GetInAppPurchaseAvailable2(0)
while (PurchaseStat < 2)
sync()
endwhile
if PurchaseStat = 4
file = OpenToRead(filename$)
TOKENS=val(Readline(file))
TOKENS = TOKENS+10
CloseFile(file)
file = OpenTowrite( filename$, 0 )
WriteString(file,str(TOKENS))
CloseFile(file)
endif
endif
endif
while GetInAppPurchaseState()=0
sync()
endwhile
InAppPurchaseAddProductID("token_0",0)
InAppPurchaseAddProductID("null",2) // Add a second redundant value as type 2
So the IAP option will only work once you've uploaded the bundle to Google Play
The title you are specifying in 'InAppPurchaseSetTitle()' matches the GooglePlay value exactly (compare your 'getAppName()' result with the app name as it appears in Google Play).
The 'InAppPurchaseSetKeys()' value matches the string as displayed in GooglePlay exactly.
message(getAppName())
//In App Purchass Setup
inAppPurchaseSetTitle(getAppName())
InAppPurchaseSetKeys ("******", "" )
InAppPurchaseAddProductID("token0",0)
InAppPurchaseAddProductID("null",2) // Add a second redundant value as type 2
InAppPurchaseSetup()
//--
filename$ = "tokens.datas"
if GetFileExists( filename$ )
if GetInAppPurchaseAvailable2(0) = 0
InAppPurchaseActivate(0)
while GetInAppPurchaseState()=0
sync()
endwhile
PurchaseStat = GetInAppPurchaseAvailable2(0)
while (PurchaseStat < 2)
sync()
endwhile
if PurchaseStat = 4
file = OpenToRead(filename$)
TOKENS=val(Readline(file))
TOKENS = TOKENS+10
CloseFile(file)
file = OpenTowrite( filename$, 0 )
WriteString(file,str(TOKENS))
CloseFile(file)
endif
endif
endif