[FCM] bigtext와 알림 팝업 사용
2017.08.16 16:48
[알림 popup]
http://www.androidside.com/bbs/board.php?bo_table=B56&wr_id=30617
클래스를 새로 만들어 추가한다.
[bigtext]
http://blog.naver.com/PostView.nhn?blogId=cosmosjs&logNo=220796926090&categoryNo=0&parentCategoryNo=56&viewDate=¤tPage=1&postListTopCurrentPage=1&from=search
private void sendNotification(String messageBody) {
Intent intent = new Intent(this, MainActivity.class);
intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
PendingIntent pendingIntent = PendingIntent.getActivity(this, 0 /* Request code */, intent,
PendingIntent.FLAG_ONE_SHOT);
Uri defaultSoundUri= RingtoneManager.getDefaultUri(RingtoneManager.TYPE_NOTIFICATION);
NotificationCompat.Builder notificationBuilder = new NotificationCompat.Builder(this)
.setSmallIcon(R.mipmap.ic_launcher)
.setContentTitle("title")
.setContentText(messageBody)
.setAutoCancel(true)
.setStyle(new NotificationCompat.BigTextStyle()
.setBigContentTitle("FCM Push Big Text")
.bigText("11111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111117777777777777777777777"))
.setSound(defaultSoundUri)
.setContentIntent(pendingIntent);
NotificationManager notificationManager =
(NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE);
notificationManager.notify(0 /* ID of notification */, notificationBuilder.build());
Intent intent_ = new Intent(this, SOSPopupActivity.class);
intent_.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_SINGLE_TOP);
this.startActivity(intent_);
}
댓글 0
번호 | 제목 | 글쓴이 | 날짜 | 조회 수 |
---|---|---|---|---|
261 | [CI] CodeIgniter 설치 | lispro06 | 2018.03.20 | 45 |
260 | [frida] 일단 여기까지 | lispro06 | 2018.03.16 | 83 |
259 |
[android] 갤럭시 S6 안드로이드 7.0 루팅
![]() | lispro06 | 2018.02.20 | 243 |
258 |
[IOS] IOS 10.3.3 탈옥툴 Meridian(자오선) / Goblin
[5] ![]() | lispro06 | 2018.01.15 | 864 |
257 |
[모바일] 안드로이드 및 아이폰 관련 팁
![]() | lispro06 | 2017.12.07 | 455 |
256 |
[학습] TCP 직접 통신
![]() | lispro06 | 2017.11.26 | 861 |
» | [FCM] bigtext와 알림 팝업 사용 | lispro06 | 2017.08.16 | 616 |
254 | [flask] 외부 인자 받기 및 python 파일 실행 | lispro06 | 2017.07.16 | 1048 |
253 |
[tensorflow] 설치 및 실행
![]() | lispro06 | 2017.07.15 | 903 |
252 |
[iphone] IOS 10 https
![]() | lispro06 | 2017.06.21 | 969 |