store.init() will not connect to Amazon App Tester

So, I am at my wits end. I have not been able to test IAP with the Amazon App Tester. I followed the instructions on getting the Amazon App Tester setup with my amazon.sdktester.json file. It runs, and it has my products in it, so that seems to be running.

I added the latest amazon IAP plugin to my build.settings file.

--
-- For more information on build.settings see the Corona SDK Build Guide at:
-- http://docs.coronalabs.com/guide/distribution/buildSettings/index.html
--

settings =
{
	
	orientation =
	{
		-- Supported values for orientation:
		-- portrait, portraitUpsideDown, landscapeLeft, landscapeRight

		--default = "portrait"
		--supported = "portraitUpsideDown"
		default = "landscapeRight",
		supported = { "landscapeRight", }
	},
	
	splashScreen =
    {
        ios = {
            enable = true
        },
        android = {
            enable = true
        }
    },

	excludeFiles =
	{
		-- Include only the necessary icon files on each platform
		iphone = { "Icon-*dpi.png", },
		android = { "Icon.png", "Icon-??.png", "Icon-???.png", "LaunchScreen.storyboardc", },
	},

	--
	-- iOS Section
	--
	iphone =
	{
		xcassets = "Images.xcassets",
		plist =
		{
			UIStatusBarHidden = false,
			UIPrerenderedIcon = true, -- set to false for "shine" overlay
			--UIApplicationExitsOnSuspend = true, -- uncomment to quit app on suspend

			--[[
			-- iOS app URL schemes:
			CFBundleURLTypes =
			{
				{
					CFBundleURLSchemes =
					{
						"fbXXXXXXXXX",  -- replace XXXXXXXXX with your Facebook appId
					}
				}
			}
			--]]
		}
	},
	
	--
	-- Android Section
	--
	android =
	{
		usesPermissions =
		{
				--useGoogleServicesJson = true,
				"android.permission.INTERNET"
		},
	},
	--
	--
	--
	window = {
		defaultMode = "normal",
		defaultViewWidth = 1024,
		defaultViewHeight = 768,
		minViewHeight = 768,
		minViewWidth = 1024,
		resizable = false,
		enableCloseButton = true,
		enableMinimizeButton = true,
		enableMaximizeButton = true,
		suspendWhenMinimized = true,
        titleText = {
            -- The "default" text will be used if the system is using a language and/or
            -- country code not defined below. This serves as a fallback mechanism.
            default = "Hand & Foot Ultimate Edition - © 2022 GameLife LLC All Rights Reserved.",
            -- This text is used on English language systems in the United States.
            -- Note that the country code must be separated by a dash (-).
            ["en‐us"] = "Hand & Foot Ultimate Edition - © 2022 GameLife LLC All Rights Reserved.",
            -- This text is used on English language systems in the United Kingdom.
            -- Note that the country code must be separated by a dash (-).
            ["en‐gb"] = "Window Title Test (English‐UK)",
            -- This text is used for all other English language systems.
            ["en"] = "Hand & Foot Ultimate Edition - © 2022 GameLife LLC All Rights Reserved.",
            -- This text is used for all French language systems.
            ["fr"] = "Window Title Test (French)",
            -- This text is used for all Spanish language systems.
            ["es"] = "Window Title Test (Spanish)",
        },
    },
    --
    --
    --
    win32 = {
    	preferenceStorage = "sqlite",
    	singleInstance = true,
    },
    --
    --
    --
    plugins = {
		--["plugin.googleAnalytics.v2"] =
		--{
		    --publisherId = "com.solar2d"
		--},
		["plugin.amazon.iap.v3"] =
        {
            publisherId = "com.solar2d"
        },
	},
}

added the simple example code just to get the store running in my main.lua

local store = require( "plugin.amazon.iap.v3" )
local json = require( "json" )

-- Transaction listener function
local function transactionListener( event )
 
    if not ( event.isError ) then  -- Successful transaction
        print( json.prettify( event ) )     
        print( "event.transaction: " .. json.prettify( event.transaction ) )
 
    else  -- Unsuccessful transaction; output error details
        print( "store failed to load" )
        print( event.errorType )
        print( event.errorString )
    end
 
    -- Notify Amazon about the transaction being processed
    store.finishTransaction( event.transaction )
end
 
-- Initialize Amazon IAP
store.init( transactionListener )

Then I set adb in the console like instructed
adb shell setprop debug.amazon.sandboxmode debug
I added my AppstoreAuthenticationKey.pem file in my project folder with main.lua
then I fired it up and it just doesnt want to init. here is the adb window dump

01-08 13:02:45.899 5451 5468 I Corona : Platform: KFTRWI / ARM64 / 9 / Mali-G72 MP3 / OpenGL ES 3.2 v1.r14p0-01rel0.01e5c7ea2a98fd18e15a3ddbd079d568 / 2022.3685 / English | US | en_US | en
01-08 13:02:45.916 5451 5468 V Corona : > Class.forName: shared.google.play.services.base.LuaLoader
01-08 13:02:45.921 5451 5468 V Corona : > Class.forName: plugin.liveBuild.LuaLoader
01-08 13:02:45.921 5451 5468 V Corona : < Class.forName: plugin.liveBuild.LuaLoader
01-08 13:02:45.924 5451 5468 V Corona : Loading via reflection: plugin.liveBuild.LuaLoader
01-08 13:02:45.932 5451 5468 I Corona : this app is on android
01-08 13:02:45.964 5451 5468 V Corona : > Class.forName: plugin.amazon.iap.v3.LuaLoader
01-08 13:02:45.964 5451 5468 V Corona : < Class.forName: plugin.amazon.iap.v3.LuaLoader
01-08 13:02:45.965 5451 5468 V Corona : Loading via reflection: plugin.amazon.iap.v3.LuaLoader
01-08 13:02:47.358 5451 5468 I Corona : FAILED
01-08 13:02:47.358 5451 5468 I Corona : failed

Is there anyone that can point out something I have forgot? done incorrectly?

I use plugin.amazon.iap and have never had any issues so can’t really help

I think I am confused as to how my app looks to communicate with another running app on my device instead of the actual appstore. I read that adb shell setprop debug.amazon.sandboxmode debug puts the device in sandbox mode, whatever that means.

I’m with SGS- I ran into problems with v3 and switched back to
["plugin.amazon.iap"] = { publisherId = "com.coronalabs", },
I test Amazon IAP by doing a full test through the developer panel. It sucks because it takes about an hour for Amazon to process the build, but it works.

Thanks for the heads up. I think I may also be stuck using the LIVE APP TESTING for in app purchase testing. Honestly I am surprised anyone even uses Corona anymore. but since I started this side project back in 2015, and I am too lazy to port it to another engine like unity or gadot, I am stuck. But whatever I do next, it wont be on here. Sad because back in the day Corona was alive with devs and activity.

Ok, so I re-submitted, but this time I did not add any other plugins, and behold it works. I was able to init the store for testing using LAT.

01-09 23:05:41.916 24204 24221 I Corona : Platform: KFTRWI / ARM64 / 9 / Mali-G72 MP3 / OpenGL ES 3.2 v1.r14p0-01rel0.01e5c7ea2a98fd18e15a3ddbd079d568 / 2022.3685 / English | US | en_US | en
01-09 23:05:41.934 24204 24221 V Corona : > Class.forName: shared.google.play.services.base.LuaLoader
01-09 23:05:41.941 24204 24221 I Corona : this app is on android
01-09 23:05:41.952 24204 24221 V Corona : > Class.forName: plugin.amazon.iap.v3.LuaLoader
01-09 23:05:41.952 24204 24221 V Corona : < Class.forName: plugin.amazon.iap.v3.LuaLoader
01-09 23:05:41.952 24204 24221 V Corona : Loading via reflection: plugin.amazon.iap.v3.LuaLoader
01-09 23:05:43.901 24204 24204 I Corona : amazaon
01-09 23:05:43.901 24204 24204 I Corona : true
01-09 23:05:43.901 24204 24204 I Corona : false
01-09 23:05:43.901 24204 24204 I Corona : Licensed
01-09 23:05:43.901 24204 24204 I Corona : Verified!
01-09 23:05:43.938 24204 24204 I Corona : amazaon
01-09 23:05:43.938 24204 24204 I Corona : true
01-09 23:05:43.939 24204 24204 I Corona : false
01-09 23:05:43.939 24204 24204 I Corona : Licensed
01-09 23:05:43.939 24204 24204 I Corona : Verified!

But I did notice that you were correct about this misspelling. that was not me that was in the plugin

print(store.target) returns amazaon

I fixed that typo, thanks for reporting!

is there any reason why during init() it reports twice?

Ok, I raised the white flag, I know when I have been beat…lol. I went back to the old version of IAP plugin like colinmorgan did, and guess what…poof, it worked first try. I regret the 3 days of time I wasted on v3. Sorry, I should have learned from your experience.

I use the Amazon app test (forget its name). Simply upload the json file to the kindle root and test on device before pushing to the store. It’s quick and easy.

I’ve got a preflight checklist that I run on builds downloaded from the actual app store, so using that test thing wouldn’t really save me any time, since I’m going to use Live App Testing anyway. (Although, yes, in a troubleshooting scenario, very helpful.)

That’s a pity- I was hoping you could find out what was causing the conflict. It would have saved a lot of frantic testing when/if Amazon deprecates v2.
Thank you for trying!

I do all testing on Android. The only thing I check on an actual kindle is that purchasing and ads work. My games are too large/complicated for their automated testing and it always fails.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.