My latest app update was rejected due to a lack of Apple Sign-In (institutional policy was to require LinkedIn login exclusively). I’m trying to incorporate Scott’s Apple Sign-In plugin with no success.
Using it as the documentation suggests, I get this error on app startup in Xcode simulator:
Runtime error: module 'plugin.appleSignIn' not found:resource (plugin.appleSignIn.lu) does not exist in archive no field package.preload['plugin.appleSignIn'] no file '/Users/joseph/Library/Developer/CoreSimulator/Devices/2B352632-10DA-43DF-8C20-7306E42791B1/data/Containers/Bundle/Application/8E148A70-7728-4E27-B582-7BC11F66FBE5/Propass.app/corona-plugins/plugin/appleSignIn.lua'
In the Solar2D simulator, the app loads fine but when I click the Sign-In button I get “WARNING: The ‘plugin.appleSignIn’ library is not available on this platform.” and nothing happens (not unexpected).
If I run the example app Scott loaded to GitHub, I get the same warning response in the Solar2D simulator. It doesn’t error out in Xcode but the button effectively does nothing. I’m never prompted to sign-in, and nothing ever hits the system log. His build.settings in the example app does not match his documentation setting since it lacks the marketplace ID argument. If I drop the marketplace ID argument before building for the xCode, I stop getting the error but my button does nothing.
I know next to nothing about plugins, but looking at the tar files in my Solar2D plugins folder, it appears the extent of the code there is simply to print that warning message and nothing else.
I have activated the plugin through my account at Solar2Dmarketplace.com and the profile I’m using to build has the Apple Sign In entitlement.
Here is my build.settings (marketplaceID intentionally removed):
settings = {
orientation = {
default = "portrait",
supported = {"portrait", "portraitUpsideDown"},
},
iphone =
{
xcassets = "Images.xcassets",
plist =
{
CFBundleIconFiles = {},
UILaunchStoryboardName = "LaunchScreen",
CoronaWindowMovesWhenKeyboardAppears = true
},
entitlements = {
["com.apple.developer.applesignin"] = {"Default"},
}
},
plugins = {
["plugin.appleSignIn"] =
{
publisherId = "tech.scotth",
marketplaceId = "******",
},
},
}
And the relevant part of my sign-in page:
local composer = require( "composer" )
local widget = require "widget"
local appleSignIn = require "plugin.appleSignIn"
local json = require "json"
local centerX = display.contentCenterX
local centerY = display.contentCenterY
local screenTop = display.screenOriginY
local screenLeft = display.screenOriginX
local bottomMarg = display.contentHeight - display.screenOriginY
local rightMarg = display.contentWidth - display.screenOriginX
function AppleSignInButtonOnPressHandler( event )
print("You pressed the button AppleSignInButton")
LISigninButton.alpha = 0
AppleSignInButton.alpha = 0
appleSignIn.show("name", function (e)
print(json.encode(e))
end )
end
AppleSignInButton = widget.newButton({
x = centerX,
y = centerY-100,
width = 500,
height = 100,
id = "AppleSignInButton",
label = "",
labelAlign = "center",
font = "Helvetica Neue",
fontSize = 22,
labelColor = { default = {0.25, 0.54, 0.87, 1.0}, over = {0.17, 0.37, 0.61, 1.0} },
defaultFile = "appleSignIn.png",
overFile = "appleSignIn.png",
onPress = AppleSignInButtonOnPressHandler,
})
If anyone has gotten this plugin working and can give me some advice, it would be much appreciated!