【发布时间】:2016-12-21 10:59:06
【问题描述】:
在没有后端的android中发送通知,我们必须在android studio中编写这些代码行:
NotificationManager manager = (NotificationManager) getSystemService(NOTIFICATION_SERVICE);
Intent intentViewPost = new Intent(PostsActivity.this,BlogPostsView.class);
PendingIntent pendingIntent = PendingIntent.getActivity(PostsActivity.this,(int) System.currentTimeMillis(), intentViewPost,0);
Notification notification = new Notification.Builder(getBaseContext())
.setSmallIcon(R.mipmap.ic_app_logo)
.setContentTitle(getResources().getString(R.string.app_name))
.setContentText(postTitle)
.setContentIntent(pendingIntent)
.build();
manager.notify(111,notification);
如何在不使用控制台的情况下在 Firebase 中做同样的事情。
【问题讨论】:
标签: android firebase firebase-notifications