답변

0

이것은 의도적으로 설계된 것으로, 일반적인 UI 규칙을 따릅니다.

운좋게도 플러그인은 오픈 소스이므로 동작을 변경할 수 있습니다.


들어오는 푸시 메시지는 GCMIntentService에 의해 처리 얻을. 앱이 전경인지 아닌지

onMessage() 방법 검사 :

if (PushPlugin.isInForeground()) { 
    extras.putBoolean("foreground", true); 
    PushPlugin.sendExtras(extras); 
} 
else { 
    extras.putBoolean("foreground", false); 

    // Send a notification if there is a message 
    if (extras.getString("message") != null && extras.getString("message").length() != 0) { 
     createNotification(context, extras); 
    } 
} 

당신이 필요 달성하기 if (PushPlugin.isInForeground()) {...} 문을 수정합니다.


또 다른 방법은 자체 PushPlugin.isInForeground()의 코드를 수정하는 것입니다.

public static boolean isInForeground() 
{ 
    return gForeground; 
} 

그러나이 코드를 변경하면 부작용이 생길 수 있습니다. 이 방법에 의존하는 다른 기능이있을 수 있습니다 (현재 및 미래).


푸시 메시지를 수신하는 방법을 구문 분석의 좋은 설명은 관련 게시물을 참조 :

관련 문제