Local Notification Android/iOS

Hello,

I’ve a problem with receiving Local Notifaction on the iOS. It work on Android, but when trying it on iOS, no notification is being received. Shouldn’t it work for both platforms, or am I missing something?

Here is the code, left non related code out

main.lua

SOLVED

Can you post your build.settings?

Here it is: BTW, after the event.phase in the setAlarm function, I have all the code in a ‘for SELECT’ loop to the datase for checks, including the notification launchArgs etc, dont know if that could be a problem?

settings = { orientation = { -- Supported values for orientation: -- portrait, portraitUpsideDown, landscapeLeft, landscapeRight default = "portrait", supported = { "portrait", } }, excludeFiles = { -- Include only the necessary icon files on each platform iphone = { "Icon-\*dpi.png", }, android = { "Icon.png", "Icon-Small-\*.png", "Icon\*@2x.png", }, }, plugins = { ["plugin.notifications"] = { publisherId = "com.coronalabs" }, ['plugin.toast'] = { publisherId = 'com.spiralcodestudio' }, }, -- -- iOS Section -- iphone = { plist = { UIStatusBarHidden = false, UIPrerenderedIcon = true, -- set to false for "shine" overlay --UIApplicationExitsOnSuspend = true, -- uncomment to quit app on suspend CFBundleIconFiles = { "Icon.png", "Icon@2x.png", "Icon-60.png", "Icon-60@2x.png", "Icon-60@3x.png", "Icon-72.png", "Icon-72@2x.png", "Icon-76.png", "Icon-76@2x.png", "Icon-Small.png", "Icon-Small@2x.png", "Icon-Small@3x.png", "Icon-Small-40.png", "Icon-Small-40@2x.png", "Icon-Small-50.png", "Icon-Small-50@2x.png", }, --[[-- iOS app URL schemes: CFBundleURLTypes = { { CFBundleURLSchemes = { "fbXXXXXXXXX", -- replace XXXXXXXXX with your Facebook appId } } } --]] } }, -- -- Android Section -- android = { permissions = { { name = ".permission.C2D\_MESSAGE", protectionLevel = "signature" }, }, usesPermissions = { "android.permission.INTERNET", "android.permission.GET\_ACCOUNTS", "android.permission.RECEIVE\_BOOT\_COMPLETED", "com.google.android.c2dm.permission.RECEIVE", ".permission.C2D\_MESSAGE", "android.permission.RECEIVE\_BOOT\_COMPLETED", "android.permission.WRITE\_EXTERNAL\_STORAGE", }, }, }

This is on top of the code (in the set alarm scene), forgot to mention:

local badge = "none" local notiOptions = { alert = myApp.baslik, badge = 1, sound = "default", custom = { foo = "bar" } }

This is the config.lua:

application = { content = { -- -- width and height will be calcuated at about 160 points per inch -- -- Adaptive is based on a 320 point content area and larger screens will have more screen space -- to use. width = 320, height = 480, scale = "adaptive", fps = 60, imageSuffix = { ["@2x"] = 1.5, ["@3x"] = 2.5, ["@4x"] = 3.1, }, }, notification = { iphone = { types = { "badge", "sound", "alert" } }, google = { projectNumber = "" }, } }

What syntax is this:  row…

?

For loop, that checks if the value in the database is equal to that.

local function setAlarm( event ) if (event.phase == "ended") then for row in db:nrows( "SELECT id FROM table" ) do -- Here are the checks that use the syntax 'row', eg. 'row.id' -- All of the code is in here, including the notifications.scheduleNotification and launchArgs end end end

I was specifically referring to lines like this:

if ( row… == ‘2’) then

I don’t know what you’re trying to do with row… I’ve never seen this.

Sorry, should’ve been more clear about this. I just replaced the actual column name with the dots, thats all. Doesn’t mean anything.

Can you post your build.settings?

Here it is: BTW, after the event.phase in the setAlarm function, I have all the code in a ‘for SELECT’ loop to the datase for checks, including the notification launchArgs etc, dont know if that could be a problem?

settings = { orientation = { -- Supported values for orientation: -- portrait, portraitUpsideDown, landscapeLeft, landscapeRight default = "portrait", supported = { "portrait", } }, excludeFiles = { -- Include only the necessary icon files on each platform iphone = { "Icon-\*dpi.png", }, android = { "Icon.png", "Icon-Small-\*.png", "Icon\*@2x.png", }, }, plugins = { ["plugin.notifications"] = { publisherId = "com.coronalabs" }, ['plugin.toast'] = { publisherId = 'com.spiralcodestudio' }, }, -- -- iOS Section -- iphone = { plist = { UIStatusBarHidden = false, UIPrerenderedIcon = true, -- set to false for "shine" overlay --UIApplicationExitsOnSuspend = true, -- uncomment to quit app on suspend CFBundleIconFiles = { "Icon.png", "Icon@2x.png", "Icon-60.png", "Icon-60@2x.png", "Icon-60@3x.png", "Icon-72.png", "Icon-72@2x.png", "Icon-76.png", "Icon-76@2x.png", "Icon-Small.png", "Icon-Small@2x.png", "Icon-Small@3x.png", "Icon-Small-40.png", "Icon-Small-40@2x.png", "Icon-Small-50.png", "Icon-Small-50@2x.png", }, --[[-- iOS app URL schemes: CFBundleURLTypes = { { CFBundleURLSchemes = { "fbXXXXXXXXX", -- replace XXXXXXXXX with your Facebook appId } } } --]] } }, -- -- Android Section -- android = { permissions = { { name = ".permission.C2D\_MESSAGE", protectionLevel = "signature" }, }, usesPermissions = { "android.permission.INTERNET", "android.permission.GET\_ACCOUNTS", "android.permission.RECEIVE\_BOOT\_COMPLETED", "com.google.android.c2dm.permission.RECEIVE", ".permission.C2D\_MESSAGE", "android.permission.RECEIVE\_BOOT\_COMPLETED", "android.permission.WRITE\_EXTERNAL\_STORAGE", }, }, }

This is on top of the code (in the set alarm scene), forgot to mention:

local badge = "none" local notiOptions = { alert = myApp.baslik, badge = 1, sound = "default", custom = { foo = "bar" } }

This is the config.lua:

application = { content = { -- -- width and height will be calcuated at about 160 points per inch -- -- Adaptive is based on a 320 point content area and larger screens will have more screen space -- to use. width = 320, height = 480, scale = "adaptive", fps = 60, imageSuffix = { ["@2x"] = 1.5, ["@3x"] = 2.5, ["@4x"] = 3.1, }, }, notification = { iphone = { types = { "badge", "sound", "alert" } }, google = { projectNumber = "" }, } }

What syntax is this:  row…

?

For loop, that checks if the value in the database is equal to that.

local function setAlarm( event ) if (event.phase == "ended") then for row in db:nrows( "SELECT id FROM table" ) do -- Here are the checks that use the syntax 'row', eg. 'row.id' -- All of the code is in here, including the notifications.scheduleNotification and launchArgs end end end

I was specifically referring to lines like this:

if ( row… == ‘2’) then

I don’t know what you’re trying to do with row… I’ve never seen this.

Sorry, should’ve been more clear about this. I just replaced the actual column name with the dots, thats all. Doesn’t mean anything.