CodenameOne icon indicating copy to clipboard operation
CodenameOne copied to clipboard

Local notification in IOS does'nt override with the same id

Open DurankGts opened this issue 4 years ago • 11 comments

Describe the bug Local notification in IOS does not override with the same id

To Reproduce Utils.showNotificationOnStatusBar(1, ForceSOS.appName, serviceName, elapsetTimerEvent, 0,0, REPEAT_NONE, null, null);

Use this method that work perfectly in android

public static LocalNotification showNotificationOnStatusBar(int id, String ticker, String titleKey, String contentKey, int vibrateTime, int flashlightsTime,int repeat, String imageNameRes, String alertSoundRes){

    String methodName = "showNotificationOnStatusBar";
    LocalNotification n = null;
    try {

            try {

//getLocalizeWord String title = getLocalizeWord(titleKey, ""+titleKey); String content = getLocalizeWord(contentKey, ""+contentKey); int os = Utils.getOsInt(); title = title.equals("")?ForceSOS.appName:title; Log.i(TAG, "-------------------------------------------------------"); Log.i(TAG, "SETTING LOCAL NOTIFICATION"); Log.i(TAG, "-------------------------------------------------------"); Log.i(TAG, methodName + "()->osInt :" + os); Log.i(TAG, methodName + "()->os :" + Utils.getOs()); Log.i(TAG, methodName + "()->id :" + id); Log.i(TAG, methodName + "()->firtTime :" + System.currentTimeMillis()); Log.i(TAG, methodName + "()->ticker :" + ticker); Log.i(TAG, methodName + "()->title :" + title); Log.i(TAG, methodName + "()->content :" + content); Log.i(TAG, methodName + "()->vibrateTime :" + vibrateTime); Log.i(TAG, methodName + "()->flashlights :" + flashlightsTime); Log.i(TAG, methodName + "()->imageNameRes :" + imageNameRes); Log.i(TAG, methodName + "()->alertSoundRes:" + alertSoundRes); Log.i(TAG, "-------------------------------------------------------");

                switch (os) {

                    case Utils.OsInt.BB:
                    case Utils.OsInt.WIN:
                    case Utils.OsInt.SIMULATOR:
                        break;

                    case Utils.OsInt.ANDROID:
                    case Utils.OsInt.IPHONE:

                        n = new LocalNotification();
                        n.setId(""+id);
                        n.setAlertTitle(title);
                        n.setAlertBody(content);

                        if (imageNameRes!=null)
                            n.setAlertImage(imageNameRes);

                        if (alertSoundRes != null)
                            n.setAlertSound(alertSoundRes);

                        if (vibrateTime > 0)
                            Display.getInstance().vibrate(vibrateTime);

                        if (flashlightsTime > 0)
                            Display.getInstance().flashBacklight(flashlightsTime);

                        Display.getInstance().scheduleLocalNotification(n, System.currentTimeMillis()+1000, repeat);
                        break;

                }

            } catch (Exception e) {
              Log.e(TAG, methodName + "()->Error1:" + LogCodes.ECatch.E1 + e.toString());
            }

    } catch (Exception e) {
        Log.e(TAG, methodName + "()->Error2:" + LogCodes.ECatch.E10 + e.toString());
    }

    return n;
}

Expected behavior I hope that the same notification keep in toolbar not a new created

Screenshots image

Smartphone (please complete the following information):

  • Device: iphone 6 s
  • OS:12.4.1

DurankGts avatar May 12 '21 16:05 DurankGts

some Estimate time to solve this issue?

DurankGts avatar May 13 '21 17:05 DurankGts

hello...

DurankGts avatar May 24 '21 20:05 DurankGts

hello...

DurankGts avatar Jun 22 '21 23:06 DurankGts

Hello.... any response about this?

DurankGts avatar Aug 23 '21 19:08 DurankGts

Hello.... any response about this?

DurankGts avatar Aug 25 '21 14:08 DurankGts

Hello.... any response about this?

DurankGts avatar Oct 05 '21 20:10 DurankGts

Hello.... any response about this?

DurankGts avatar Oct 15 '21 13:10 DurankGts

Hello.... any response about this? this very important please.

DurankGts avatar Dec 01 '21 16:12 DurankGts

Hello.... any response about this? this very important please.

DurankGts avatar Feb 09 '22 15:02 DurankGts

Hello what is the Schedule of this issue in ios? this issue is very important. Actually very difficult to have duplicate notification message because it can't override the message like android side.

DurankGts avatar Mar 28 '22 16:03 DurankGts