Hi All;
I have a pair of apps that we are updating that have used the older “system” notification calls for a long time to do LOCAL notifications. I thought that the move to the plugin setup in January would be straightforward. These apps have Apple App IDs that have never had PUSH Notifications enabled — we are only using LOCAL notifications. So I moved the calls over to using the plugin as I was working on the updates.
Build Settings includes:
[lua]
[“plugin.notifications”] =
{
publisherId = “com.coronalabs”,
},
[/lua]
And I built the app using my Development Provisioning Profile (based on the App ID) using Corona Build #2583. When I put the app on my iPad for test, I bump into these problems.
#1 - Regarding registerForPushNotifications() — If I call the following . . .
[lua]
local notifications = require(“plugin.notifications”)
notifications.registerForPushNotifications()
[/lua]
I get this error message in the console:
<Warning>: AppDelegate.mm: didFailToRegisterForRemoteNotificationsWithError: no valid ‘aps-environment’ entitlement string found for application
And no Apple Alert appears asking me (the user) for notifications permission.
#2 - Regarding notifications.scheduleNotification(time, options) — If I call the following using exact commands and variables that have worked in the past . . .
[lua]
local notifications = require(“plugin.notifications”)
notifications.scheduleNotification( time, options )
[/lua]
I get this error message in the console:
<Warning>: Attempting to schedule a local notification <UIConcreteLocalNotification: 0x1bbe0720>{fire date = Friday, April 17, 2015 at 9:35:42 AM Eastern Daylight Time, time zone = (null), repeat interval = 0, repeat count = UILocalNotificationInfiniteRepeatCount, next fire date = Friday, April 17, 2015 at 9:35:42 AM Eastern Daylight Time, user info = { body = “Good luck with my\nnext several puzzles!\n\n-- David L. Hoyt --”;id = levelattained; title = “Glad You are Playing”;}} with an alert but haven’t received permission from the user to display alerts
And I get the above error message whether or not I have attempted to registerForPushNotifications() before or after I have tried to schedule something.
Also, I have tried all of the above with and without the following section in my config.lua file:
[lua]
notification =
{
iphone =
{
types = { “badge”, “sound”, “alert” }
}
}
[/lua]
The documentation at AppNotification Doc leads me to think that this entry is only necessary for PUSH (and not LOCAL). Putting in this config.lua table entry doesn’t alter either of the errors I get when the “registerForPushNotifications()” or “scheduleNotification” calls.
==============================================================================
In essence, I am confused by this problem. Do I now have to have Push Notifications (with 3rd party SSL Certificates, etc.) enabled for an App ID if ALL I WANT TO DO IS LOCAL NOTIFICATIONS? Or am I missing something important in the new plugin setup? Not certain if this is a bug of my failure to understand.
Thanks for any guidance.
Steve