diff --git a/plugins/2020.3569/iphone-sim/libNotificationsV2Plugin.a b/plugins/2020.3569/iphone-sim/libNotificationsV2Plugin.a index a60749b..955eedc 100644 Binary files a/plugins/2020.3569/iphone-sim/libNotificationsV2Plugin.a and b/plugins/2020.3569/iphone-sim/libNotificationsV2Plugin.a differ diff --git a/plugins/2020.3569/iphone/libNotificationsV2Plugin.a b/plugins/2020.3569/iphone/libNotificationsV2Plugin.a index f990111..ce90a9c 100644 Binary files a/plugins/2020.3569/iphone/libNotificationsV2Plugin.a and b/plugins/2020.3569/iphone/libNotificationsV2Plugin.a differ diff --git a/src/Corona/main.lua b/src/Corona/main.lua index 6eee5c7..a70b9e7 100644 --- a/src/Corona/main.lua +++ b/src/Corona/main.lua @@ -334,7 +334,7 @@ local scheduleLocalNotification = widget.newButton { labelColor = { default={ 0, 0, 0 }, over={ 0.7, 0.7, 0.7 } }, onRelease = function(event) local options = { - alert = "Wake up!", + alert = {title="Cool Title Here", body="Cool Body Here"},--alert="Title Here" sound = "notification.wav", badge = 2, custom = { foo = "bar" } diff --git a/src/ios/Plugin/IPhoneNotificationEvent.mm b/src/ios/Plugin/IPhoneNotificationEvent.mm index 7ac4e44..e482fde 100644 --- a/src/ios/Plugin/IPhoneNotificationEvent.mm +++ b/src/ios/Plugin/IPhoneNotificationEvent.mm @@ -135,6 +135,14 @@ } else if ( lua_istable( L, -1 ) ) { + lua_getfield( L, -1, "title" ); + body = lua_tostring( L, -1 ); + if ( body ) + { + notification.alertTitle = [NSString stringWithUTF8String:body]; + } + lua_pop( L, 1 ); + lua_getfield( L, -1, "body" ); body = lua_tostring( L, -1 ); if ( body ) @@ -202,7 +210,8 @@ int index = lua_gettop( L ); - SetStringField( L, index, "alert", notification, @"alertBody" ); + SetStringField( L, index, "title", notification, @"alertTitle" ); + SetStringField( L, index, "alert", notification, @"alertBody" ); SetStringField( L, index, "action", notification, @"alertAction" ); SetStringField( L, index, "launchImage", notification, @"alertLaunchImage" ); SetStringField( L, index, "sound", notification, @"soundName" ); @@ -302,6 +311,7 @@ else { SetStringField( L, index, "alert", notificationData, @"alert" ); } + SetStringField( L, index, "title", notificationData, @"title" ); SetStringField( L, index, "action", notificationData, @"action-loc-key" ); SetStringField( L, index, "launchImage", notificationData, @"launch-image" );