0
您好,我正在爲使用GCM的多個移動設備實施推送通知。當我一次嘗試運行2個仿真器並通過JSP
頁面發送消息時,它的工作正常。在我的移動設備上安裝我的apk文件後,我得到註冊ID,但如果我試圖通過JSP
發送消息到該特定設備,我收到錯誤,如無效註冊。我在谷歌搜索,但仍然沒有得到妥善解決我的問題通過GCM向移動設備發送消息時註冊無效
我正在使用sender.send(message, regIdList, 1);
此語句在Servlet
發送消息從JSP
頁到android設備。
Uri sound = RingtoneManager.getDefaultUri(RingtoneManager.TYPE_NOTIFICATION);
NotificationCompat.Builder noBuilder = new NotificationCompat.Builder(this)
.setSmallIcon(R.mipmap.ic_launcher)
.setContentText("My GCM message :X:X")
.setContentText(message)
.setAutoCancel(true)
.setContentIntent(pendingIntent);
NotificationManager notificationManager = (NotificationManager)getSystemService(Context.NOTIFICATION_SERVICE);
notificationManager.notify(0,noBuilder.build());
請建議我的問題