2016-01-03 54 views
1

我正在使用解析服務向設備發送推送消息。 在iOS上一切正常,但在Android上,如果我發送推送消息,它會向接收者顯示我的包名稱(「com.example.app」)。爲什麼不顯示我的應用程序的名稱(「示例應用程序」)? enter image description here 謝謝。Android解析推送

+0

錯誤的內容,因爲它是在調試模式下不釋放? – pmax1

+0

顯示您的推送接收器代碼,如果自定義 – virendrao

回答

1

你應該再次檢查你的源代碼,我跟着解析文檔,並將其正常工作,您也許發送標題

Intent intent = new Intent(context, ZHSplashActivity.class); 
    PendingIntent pIntent = PendingIntent.getActivity(context, (int) System.currentTimeMillis(), intent, 0); 
    Notification n = new Notification.Builder(context) 
      .setContentTitle(context.getResources().getString(R.string.app_name)) 
      .setContentText(message) 
      .setSmallIcon(R.drawable.app_icon) 
      .setContentIntent(pIntent) 
      .setAutoCancel(true).build(); 

    NotificationManager notificationManager = 
      (NotificationManager) context.getSystemService(Context.NOTIFICATION_SERVICE); 

    notificationManager.notify(0, n);