안녕하세요!

3.5 version Phonegap 을 사용중입니다.


다름이 아니라 PushPlugin을 사용해서 Push를 받습니다.

문제는 Status bar에 Push를 계속 리스트형식으로 누적을 시켜서 

하나를 선택하면 선택된 목록은 Status bar에서 사라지게 할려고 합니다.


Status bar에 List형식으로 누적은 되는데

목록중에 아무거나 선택했을 경우 누적된 리스트들이 모두 날라가버리고 있습니다.


앱특성상 Status bar에 리스트 형식으로 노출을 해야하고 

리스트 목록에서 선택된건만 삭제를 해야 하는 특성으로 구현을 해야하는데여


Phonegap에서 어떤식으로 해줘야 하는지 도통 찾지를 못하겠내여 그래서 

PushPlugin을 설치하면 Plugin에서 GCM에 해당하는 클래스를 생성해줍니다


여기서 GCMIntentService  이놈을 약간 수정중입니다.



static int NOTIFICATION_ID = 0x1000;

int count = 1;

public void createNotification(Context context, Bundle extras)

{

        NotificationManager mNotificationManager = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE);

        String appName = getAppName(this);

        String message = extras.getString("message");


        Intent notificationIntent = new Intent(this, PushHandlerActivity.class);

        notificationIntent.addFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP | Intent.FLAG_ACTIVITY_CLEAR_TOP);

        notificationIntent.putExtra("pushBundle", extras);

        notificationIntent.putExtra("message", message);


       PendingIntent contentIntent = PendingIntent.getActivity(this, 0, notificationIntent, PendingIntent.FLAG_UPDATE_CURRENT);

// PendingIntent contentIntent = PendingIntent.getActivity(this, NOTIFICATION_ID, notificationIntent,  PendingIntent.FLAG_UPDATE_CURRENT);

    int defaults = Notification.DEFAULT_ALL;


    if (extras.getString("defaults") != null) {

        try {

             defaults = Integer.parseInt(extras.getString("defaults"));

         } catch (NumberFormatException e) {}

   }

   NotificationCompat.Builder mBuilder = new NotificationCompat.Builder(context)

.setDefaults(defaults)

.setSmallIcon(context.getApplicationInfo().icon)

.setWhen(System.currentTimeMillis())

.setContentTitle(extras.getString("title"))

.setTicker(extras.getString("title"))

.setContentIntent(contentIntent)

.setAutoCancel(true);

// .setNumber(count);

count++;

    if (message != null) {

        mBuilder.setContentText(message);

    } else {

        mBuilder.setContentText("<missing message content>");

    }


    String msgcnt = extras.getString("msgcnt");

    if (msgcnt != null) {

       mBuilder.setNumber(Integer.parseInt(msgcnt));

    }

    

    int notId = 0;

   try {

      notId = Integer.parseInt(extras.getString("notId"));

   }

   catch(NumberFormatException e) {

   Log.e(TAG, "Number format exception - Error parsing Notification ID: " + e.getMessage());

}

catch(Exception e) {

     Log.e(TAG, "Number format exception - Error parsing Notification ID" + e.getMessage());

}

// mNotificationManager.notify((String) appName, notId, mBuilder.build());

// mNotificationManager.notify(cappName+"", notId, mBuilder.build());

Log.d(TAG, "<<<<<<<<NOTIFICATION_ID[" + NOTIFICATION_ID+"]>>>>>>>");

mNotificationManager.notify(NOTIFICATION_ID++, mBuilder.build());

mNotificationManager.cancel(NOTIFICATION_ID); 

}


어디를 수정을 해줘야 할까요?


질문이 좀 이상한것 같기도 하고 올리면서도 뭔소리하는지 모르겠군여 

OTL