Closed ChaseTargaryen closed 2 years ago
I tried the plugin with a clean project. No luck on Android 12.
build.setting.
settings =
{
orientation =
{
-- Supported values for orientation:
-- portrait, portraitUpsideDown, landscapeLeft, landscapeRight
default = "portrait",
supported = { "portrait", },
},
--
-- Android section
--
android =
{
usesPermissions =
{
"android.permission.INTERNET",
"android.permission.RECEIVE_BOOT_COMPLETED",
"android.permission.POST_NOTIFICATIONS"
},
},
--
-- iOS section
--
iphone =
{
xcassets = "Images.xcassets",
plist =
{
UIStatusBarHidden = false,
UILaunchStoryboardName = "LaunchScreen",
},
},
--
-- Plugins section
--
plugins =
{
["plugin.notifications.v2"] =
{
publisherId = "com.coronalabs"
},
},
--
-- Project section
--
excludeFiles =
{
-- Exclude unnecessary files for each platform
all = { "Icon.png", "Icon-*dpi.png", "Images.xcassets", },
android = { "LaunchScreen.storyboardc", },
},
}
local notifications = require( "plugin.notifications.v2" )
-- Get the app's launch arguments in case it was started when the user tapped on a notification local launchArgs = ...
-- Set up notification options local options = { alert = "Start a free trial!\ Try all of the units in the app for 7 days.", badge = 0, sound = "alarm.caf", custom = { date="Sep 03 00:00", hoursSinceInstall="744", message="LN_START_FREE_TRIAL", name="LN_START_FREE_TRIAL", order="9", orientation="portrait", postcard="notification-start-trial", userType="free" }, }
local options2 = { alert = "Start a free trial! Try all of the units in the app for 7 days.", badge = 0, sound = "alarm.caf", custom = { name = "bar" } }
-- Schedule a notification to occur 60 seconds from now local notification1 = notifications.scheduleNotification( 10, options )
local notification2 = notifications.scheduleNotification( 20, options2 ) -- Listen for notifications local function onNotification( event ) print(event.name) print(event.custom.name) end Runtime:addEventListener( "notification", onNotification )
-- The launch arguments provide a notification event if this app was started when the user tapped on a notification -- In this case, you must call the notification listener manually if ( launchArgs and launchArgs.notification ) then onNotification( launchArgs.notification ) end
This is fixed with 2022.3681+
Describe the bug Like the title said, the plugin itself isn't working at all on Android 12. Even the sample code on documentation is not working.
To Reproduce Steps to reproduce the behavior:
Target platform and where build was made:
Something weird happened after I switch to v2. I was using the plugin the same way as I used v1. I got these warnings:
whole test project or build.settings