Skip to content

Commit 7fdde44

Browse files
committed
Android 33 Support and Firebase Messaging Updates
1 parent 14e012f commit 7fdde44

9 files changed

Lines changed: 133 additions & 0 deletions

File tree

6 KB
Binary file not shown.
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
android.defaultConfig {
2+
minSdkVersion Math.max(minSdkVersion?.apiLevel ?: 15, 19)
3+
}
4+
ext["minSdkVersion"] = Math.max(ext.find("minSdkVersion")?:15, 19)
5+
dependencies {
6+
implementation 'com.google.firebase:firebase-messaging:23.2.1'
7+
}
21 KB
Binary file not shown.
200 KB
Binary file not shown.
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
local metadata =
2+
{
3+
plugin =
4+
{
5+
format = "staticLibrary",
6+
staticLibs = { 'NotificationsV2Plugin', },
7+
frameworks = { },
8+
frameworksOptional = { "UserNotifications", "UserNotificationsUI" },
9+
delegates = { "CoronaNotificationsDelegate" }
10+
}
11+
}
12+
13+
return metadata
211 KB
Binary file not shown.
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
local metadata =
2+
{
3+
plugin =
4+
{
5+
format = "staticLibrary",
6+
staticLibs = { 'NotificationsV2Plugin', },
7+
frameworks = { },
8+
frameworksOptional = { "UserNotifications", "UserNotificationsUI" },
9+
delegates = { "CoronaNotificationsDelegate" }
10+
}
11+
}
12+
13+
return metadata
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
-- Notifications V2 plugin
2+
3+
local Library = require "CoronaLibrary"
4+
5+
-- Create library
6+
local lib = Library:new{ name="plugin.notifications.v2", publisherId="com.coronalabs", version=1 }
7+
8+
-------------------------------------------------------------------------------
9+
-- BEGIN
10+
-------------------------------------------------------------------------------
11+
12+
-- This sample implements the following Lua:
13+
--
14+
-- local notifications = require "plugin.notifications.v2"
15+
--
16+
17+
local function showWarning(functionName)
18+
print( functionName .. " WARNING: The Notifications V2 plugin is only supported on iOS and Android devices")
19+
end
20+
21+
function lib.registerForPushNotifications()
22+
showWarning("notifications.registerForPushNotifications()")
23+
end
24+
25+
function lib.subscribe()
26+
showWarning("notifications.subscribe()")
27+
end
28+
29+
function lib.unsubscribe()
30+
showWarning("notifications.unsubscribe()")
31+
end
32+
33+
function lib.getDeviceToken()
34+
showWarning("notifications.getDeviceToken()")
35+
end
36+
37+
function lib.scheduleNotification()
38+
showWarning("notifications.scheduleNotification()")
39+
end
40+
41+
function lib.cancelNotification()
42+
showWarning("notifications.cancelNotification()")
43+
end
44+
45+
-------------------------------------------------------------------------------
46+
-- END
47+
-------------------------------------------------------------------------------
48+
49+
-- Return an instance
50+
return lib
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
-- Notifications V2 plugin
2+
3+
local Library = require "CoronaLibrary"
4+
5+
-- Create library
6+
local lib = Library:new{ name="plugin.notifications.v2", publisherId="com.coronalabs", version=1 }
7+
8+
-------------------------------------------------------------------------------
9+
-- BEGIN
10+
-------------------------------------------------------------------------------
11+
12+
-- This sample implements the following Lua:
13+
--
14+
-- local notifications = require "plugin.notifications.v2"
15+
--
16+
17+
local function showWarning(functionName)
18+
print( functionName .. " WARNING: The Notifications V2 plugin is only supported on iOS and Android devices")
19+
end
20+
21+
function lib.registerForPushNotifications()
22+
showWarning("notifications.registerForPushNotifications()")
23+
end
24+
25+
function lib.subscribe()
26+
showWarning("notifications.subscribe()")
27+
end
28+
29+
function lib.unsubscribe()
30+
showWarning("notifications.unsubscribe()")
31+
end
32+
33+
function lib.getDeviceToken()
34+
showWarning("notifications.getDeviceToken()")
35+
end
36+
37+
function lib.scheduleNotification()
38+
showWarning("notifications.scheduleNotification()")
39+
end
40+
41+
function lib.cancelNotification()
42+
showWarning("notifications.cancelNotification()")
43+
end
44+
45+
-------------------------------------------------------------------------------
46+
-- END
47+
-------------------------------------------------------------------------------
48+
49+
-- Return an instance
50+
return lib

0 commit comments

Comments
 (0)