2013-01-18 50 views

回答

4

可以在GCM消息

在客戶端(GCMIntentService)發送網站鏈接 -

@Override 
protected void onMessage(Context context, Intent intent) { 

String uriStr = intent.getStringExtra(FIELD_MESSAGE); 
//FIELD_MESSAGE is the same key used while sending links from server 
Intent notificationIntent = new Intent(Intent.ACTION_VIEW, Uri.parse(uriStr)); 

    PendingIntent contentIntent = PendingIntent.getActivity(context, 0, notificationIntent, 0); 
    notification.setLatestEventInfo(context, contentTitle, contentText, contentIntent); 
    mNotificationManager.notify(970970, notification); 
} 
0

我將接近這樣 1)發送GCM通知到客戶端的URL 2一起)基於URL接收,下載圖像 3)一旦下載,保存圖片和設置的通知