OneSignal Issue

When I build my app with Solar2D version 2021.3654, OneSignal notifications don’t work. When I look at the OneSignal dashboard, I get the following error:

Does anyone know what is happening?

Thanks in advance.

What do your build settings look like?

settings =
{
splashScreen =
{
enable = false,
– image = “splash.png”
},

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

	default = "portrait",
	supported = { "portrait", },
},

excludeFiles =
{
	-- Include only the necessary icon files on each platform
	all = { "Icon.png", "Icon-*dpi.png", "Images.xcassets", },
	android = { "LaunchScreen.storyboardc", },
	-- iphone = { "Icon-*dpi.png", },
	-- android = { "Icon.png", "Icon-Small-*.png", "Icon*@2x.png", },
},

--
-- iOS Section
--
iphone =
{
	xcassets = "Images.xcassets",
	plist =
	{
		-- Importante para poder hacer request de sitios no seguros
		NSAppTransportSecurity =
        {
        	-- Añadido hace poco por "the resource could not be loaded because the app transport security policy"
            -- NSAllowsLocalNetworking = true, 
			NSExceptionDomains =
			{
				["gym.masdedos.es"] =
		        {
		 			NSIncludesSubdomains = true,
        			NSThirdPartyExceptionAllowsInsecureHTTPLoads = true,
		        },
				["ufit365.com"] =
		        {
		 			NSIncludesSubdomains = true,
        			NSThirdPartyExceptionAllowsInsecureHTTPLoads = true,
		        },
				["panel.upro365.com"] =
		        {
		 			NSIncludesSubdomains = true,
        			NSThirdPartyExceptionAllowsInsecureHTTPLoads = true,
		        },
				["panel.ufit365.com"] =
		        {
		 			NSIncludesSubdomains = true,
        			NSThirdPartyExceptionAllowsInsecureHTTPLoads = true,
		        },
				["panel.uwork365.es"] =
		        {
		 			NSIncludesSubdomains = true,
        			NSThirdPartyExceptionAllowsInsecureHTTPLoads = true,
		        },
				["prisiones.masdedos.es"] =
		        {
		 			NSIncludesSubdomains = true,
        			NSThirdPartyExceptionAllowsInsecureHTTPLoads = true,
		        },
				["panel.unioncdp.com"] =
		        {
		 			NSIncludesSubdomains = true,
        			NSThirdPartyExceptionAllowsInsecureHTTPLoads = true,
		        },
			},
        },
		UIBackgroundModes = {"remote-notification"}, -- Agregado por OneSignal
		UIStatusBarHidden = false,
		UILaunchStoryboardName = "LaunchScreen",
		--UIPrerenderedIcon = true, -- set to false for "shine" overlay
		--UIApplicationExitsOnSuspend = false,
		--UIApplicationExitsOnSuspend = true, -- uncomment to quit app on suspend
		NSLocationWhenInUseUsageDescription = "A description of why the app needs access to location services.",
	},
},

--
-- Android Section
--
android =
{
	minSdkVersion = "16",
	usesPermissions =
	{
		"android.permission.INTERNET",
        "android.permission.CALL_PHONE",

        -- ************* SÓLO PARA UWORK (Comentar en otro caso) ****************
        -- Permission to retrieve current location from the GPS
        -- "android.permission.ACCESS_FINE_LOCATION",
        
        -- Permission to retrieve current location from WiFi or cellular service
        -- "android.permission.ACCESS_COARSE_LOCATION",
        -- **********************************************************************
	},
    usesFeatures =
    {
        -- ************* SÓLO PARA UWORK (Comentar en otro caso) ****************
        -- If you set permissions "ACCESS_FINE_LOCATION" and "ACCESS_COARSE_LOCATION" above,
        -- you may want to set up your app to not require location services as follows.
        -- Otherwise, devices that do not have location sevices (such as a GPS) will be unable
        -- to purchase this app in the app store.
        -- { name = "android.hardware.location", required = false },
        -- { name = "android.hardware.location.gps", required = false },
        -- { name = "android.hardware.location.network", required = false }
        -- **********************************************************************
    },
},

--
-- Plugins
--
plugins =
{
    ["plugin.OneSignal"] = -- Agregado por OneSignal
	{
    	publisherId = "com.onesignal",
    },
    -- Omit if you're using 'plugin.googleAnalytics'
    -- ["plugin.google.play.services"] = -- Agregado por OneSignal
    -- {
    --     publisherId = "com.coronalabs",
    --     supportedPlatforms = { android=true, ["android-kindle"]=true },
    -- },
    -- Plugin para previsualizar pdfs y demás documentos
    ["CoronaProvider.native.popup.quickLook"] =
    {
        publisherId = "com.coronalabs",
		supportedPlatforms = { iphone=true, ["iphone-sim"]=true },
    },
    -- Plugin para mostrar el desplegable de redes sociales en las que compartir algo en Android.
    ["CoronaProvider.native.popup.social"] =
    {
        publisherId = "com.coronalabs"
    }, 
    -- Plugin para mostrar el pop up de redes sociales en las que compartir algo en iOS.       
    ["CoronaProvider.native.popup.activity"] =
    {
        publisherId = "com.coronalabs",
		supportedPlatforms = { iphone=true, ["iphone-sim"]=true },
    },
    -- Notificaciones locales
    -- ["plugin.notifications.v2"] =
    -- {
    --    publisherId = "com.coronalabs"
    -- },
    -- Sólo se usa para el tema de la firma
    ["plugin.imageCrop"] = {publisherId = "tech.scotth"},
},

}

And this use to work with the previous versions?

I’m pretty sure the version I was using a month ago worked fine.

same issue here … i also downlaoded JDK 17 and latest solar2d 2021.3656 …
see attached image

i just contacted onesignal

this is what they told me… not sure what to do! should i just wait for Solar2D update?

Hi there,

The Google Play Services Library Error is likely due to the Google Play Store App on the device being outdated, force quit, or non-existent. If this is your device, can you check the Google Play Store App is on the device, updated and running?

You can further check for issues using our SetLogLevel method to Verbose and check the log from the device.

You can find more on this method in the SDK docs: https://documentation.onesignal.com/docs/sdk-reference#debugging

If you are having a hard time, feel free to send over these logs through Pastebin or a text file that would be much appreciated and help us better see what is happening in the app.

Thanks

At least on my machine, I was able to fix this by upgrading the plugin to the latest 3.x version.

As you can see the latest version in the 3.x.x branch is 3.16.0 created in Jun 2021. The plugin is using 3.15.2 created in Jul 2020.

Untar the file in your cache and open the corona.grindle file:

Change the version to whatever version you want to try (fairly sure the newer 4.x won’t work) and tar the entire thing back up:

dependencies {
    implementation 'com.onesignal:OneSignal:3.16.0'
}

The tar command I use to tar it back up:

tar -czvf data.tgz --exclude=".*" --exclude="*.command" *
1 Like

you are a genius man … it worked … you saved my day

1 Like

Thank you very much for giving us a solution :smiley: