푸시 알림 클라이언트를 구현하려고합니다. onMessage (Context arg0, Intent arg1) 함수에 축배를 표시하고 싶습니다. 내가 메시지를 확인하기 위해 축배를 DISPALY하려고 수신 된 메시지를 표시하는 방법을 알고 싶어GCMBaseIntentService에서 건배를 표시합니다.
public class GCMIntentService extends GCMBaseIntentService {
static Context c;
@SuppressWarnings("hiding")
private static final String TAG = "GCMIntentService";
public GCMIntentService() {
super("717816998404");
c = this.getBaseContext();
}
/**
* Issues a notification to inform the user that server has sent a message.
*/
@Override
protected void onError(Context arg0, String arg1) {
// TODO Auto-generated method stub
}
@Override
protected void onMessage(Context arg0, Intent arg1) {
Log.d("GCM", "RECIEVED A MESSAGE");
Log.d("GCM", "RECIEVED A MESSAGE");
Log.d("GCM", "RECIEVED A MESSAGE");
Log.d("GCM", "RECIEVED A MESSAGE");
Log.d("GCM", "RECIEVED A MESSAGE");
Log.d("GCM", "RECIEVED A MESSAGE");
Log.d("GCM", "RECIEVED A MESSAGE");
String str =arg1.getExtras().getString("PVAL");
Log.i("PVAL",str);
// I want to display a toast here
}
@Override
protected void onRegistered(Context arg0, String arg1) {
// TODO Auto-generated method stub
Log.i("TEST", arg1);
Log.e("TEST", arg1);
}
@Override
protected void onUnregistered(Context arg0, String arg1) {
// TODO Auto-generated method stub
}
}
:
는이 내 코드입니다.
예를 들어 현재는 의도가 어떤 아이디어하였습니다 문제를 할 수 있도록 새로운 의도를 만들 수 있지만 무엇입니까? – user170317