From 6a6568af7cf3d5e79e4a35ad588475311ab4cadd Mon Sep 17 00:00:00 2001 From: Vlad Shcherban Date: Mon, 16 Aug 2021 17:03:25 +0300 Subject: [PATCH] implementing registerForPushNotifications({useFCM=false}) for Android to ignore FCM messages --- .../android/plugin.notifications.v2.jar | Bin 19740 -> 20326 bytes .../v2/CoronaFirebaseMessagingService.java | 14 ++++++++++ .../plugin/notifications/v2/LuaLoader.java | 26 ++++++++++-------- 3 files changed, 28 insertions(+), 12 deletions(-) diff --git a/plugins/2020.3569/android/plugin.notifications.v2.jar b/plugins/2020.3569/android/plugin.notifications.v2.jar index f960d1939a438ece8ca559ec951cef359c2f9fab..72d99f5f9243c86782930ac4dfcfbd6b11d960d9 100644 GIT binary patch delta 11376 zcmY+KWmuid(xwUS?(P=cW#R7b7ThhkuHdk6x8UxJ7#QHW`i3<2J1&uhg&HQ@cL-*bSy*$(LQxw+8}a?sSfT^f z?D=rx@&vp_a)nyz%^vyOeBd+PSc<6N!r4`i^iCmX_jjEAK-)1JE3amO6TzMKpO3x3 zcbqzyC-TYZl%J}F)6DVSIdK`GF2DL&U}LAD$I989#0)abQn2nm$6(3zszAvcd1L zT-EBn=p3k3<{TW4zq^}gpCp!;i1`r)Os7a9)VGMV`i@BVJ@|)@Yh%m67L57OKIRBJ ziv65Rm_Hh8(RjcB* z$*piUes)_NtqoTn(J*`__Q7)&lOvW^CFNNt7;tS{T={9K`OD_-huf^Z+ws>R^a4ZA z3nK^PeOf#eV^e$u9L2Iy9g;FT*8uL~{FUE)r!>ZHuL)RrY16>g_J}%sX_ipYXUiQn z-s2cweA1=*=+{md>yQoPoQmYk1ZfSO5GKmv&NPBPc-p4OL3M%^gVful21bKEp}fe z1Sb06&6u;FbLoriraLmJnjk@{bs2uC5R-?qas$Z~59^ z?C|^P!H4I3)a@~hjb+ruHziNOGjY+@=vr<3}*;U=kxHNA?_;y6g7mlQ3u`S#Ja;LZuw!c zaLzbOR}Ehv1*hw}P;>1nYsewSQTHvmmgUq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p80Sf8`{hu6AT^gS{4$6OSKY?%LgJC?7z!=K3 z;4B47xPLD+^eEuN1R?)B_Nu^1`kxXh6ciuSUw{06A8GV|MUIMWr2nY^K|x9Vm&gwL zUr`qhE%;rLfK=;$b5c-HBL5{M#Q!U#1LqQwfW1`+NdL(_u)#nf%CsaU6g-CO8-AjFjB^cNu~SuGbkAGz%|MQr2iOqo4+$x{{5f-o?V>r ze}t%DY!wR9|EwPr6vKbLftc;DkOu6mA_&97^S4V39#Bz%Ns#`x%dX0auq5-(O8r0I CpHLG3 diff --git a/src/android/plugin/src/main/java/plugin/notifications/v2/CoronaFirebaseMessagingService.java b/src/android/plugin/src/main/java/plugin/notifications/v2/CoronaFirebaseMessagingService.java index 2716b46..67c91cf 100644 --- a/src/android/plugin/src/main/java/plugin/notifications/v2/CoronaFirebaseMessagingService.java +++ b/src/android/plugin/src/main/java/plugin/notifications/v2/CoronaFirebaseMessagingService.java @@ -9,6 +9,10 @@ package plugin.notifications.v2; +import android.content.Context; +import android.content.SharedPreferences; + +import com.ansca.corona.CoronaEnvironment; import com.ansca.corona.events.NotificationRegistrationTask; import com.google.firebase.messaging.FirebaseMessagingService; import com.google.firebase.messaging.RemoteMessage; @@ -19,18 +23,28 @@ public class CoronaFirebaseMessagingService extends FirebaseMessagingService { + public static String PREFERENCE_FILE = "fcm-notifications"; + public static String SKIP_FCM = "skipFCM"; + public CoronaFirebaseMessagingService() { super(); } + private boolean ignoreFCM() { + SharedPreferences preferences = CoronaEnvironment.getApplicationContext().getSharedPreferences(PREFERENCE_FILE, Context.MODE_PRIVATE); + return preferences.getBoolean(SKIP_FCM, false); + } + @Override public void onMessageReceived(RemoteMessage remoteMessage) { + if(ignoreFCM()) return;; super.onMessageReceived(remoteMessage); NotificationsV2Helper.processRemoteMessage(remoteMessage, getApplicationContext()); } @Override public void onNewToken( String deviceToken ) { + if(ignoreFCM()) return;; super.onNewToken(deviceToken); NotificationRegistrationTask registrationTask = new NotificationRegistrationTask(deviceToken); for (com.ansca.corona.CoronaRuntime runtime : com.ansca.corona.CoronaRuntimeProvider.getAllCoronaRuntimes()) { diff --git a/src/android/plugin/src/main/java/plugin/notifications/v2/LuaLoader.java b/src/android/plugin/src/main/java/plugin/notifications/v2/LuaLoader.java index 96ee97d..84fcfb2 100644 --- a/src/android/plugin/src/main/java/plugin/notifications/v2/LuaLoader.java +++ b/src/android/plugin/src/main/java/plugin/notifications/v2/LuaLoader.java @@ -19,6 +19,8 @@ import com.naef.jnlua.LuaType; import com.naef.jnlua.NamedJavaFunction; +import android.content.Context; +import android.content.SharedPreferences; import android.util.Log; import com.google.firebase.messaging.FirebaseMessaging; @@ -208,24 +210,24 @@ public String getName() { *

* Warning! This method is not called on the main UI thread. * - * @param luaState Reference to the Lua state. + * @param L Reference to the Lua state. * Needed to retrieve the Lua function's parameters and to return values back to Lua. * @return Returns the number of values to be returned by the Lua function. */ @Override - public int invoke(final LuaState luaState) { - functionSignature = "notifications.registerForPushNotifications( options )"; - - // check number of args - int nargs = luaState.getTop(); - if (nargs > 1) { - logMsg(ERROR_MSG, "Expected 0 or 1 argument, got " + nargs); - return 0; + public int invoke(final LuaState L) { + + if(L.isTable(1)) { + L.getField(1, "useFCM"); + if(L.type(-1) == LuaType.BOOLEAN) { + SharedPreferences preferences = CoronaEnvironment.getApplicationContext().getSharedPreferences(CoronaFirebaseMessagingService.PREFERENCE_FILE, Context.MODE_PRIVATE); + SharedPreferences.Editor editor = preferences.edit(); + editor.putBoolean(CoronaFirebaseMessagingService.SKIP_FCM, !L.toBoolean(-1)); + editor.apply(); + } + L.pop(1); } - // NOP - // iOS feature only - return 0; } }