메뉴 건너뛰기

app

[FCM] bigtext와 알림 팝업 사용

lispro062017.08.17 01:48조회 수 1979댓글 0

    • 글자 크기
[알림 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=&currentPage=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_);
}
lispro06 (비회원)
    • 글자 크기
[학습] TCP 직접 통신 (by lispro06) [flask] 외부 인자 받기 및 python 파일 실행 (by lispro06)

댓글 달기

suritam9
2021.12.15 조회 420
suritam9
2020.03.31 조회 1123
suritam9
2019.04.05 조회 2220
suritam9
2019.03.07 조회 393
suritam9
2019.03.06 조회 839
lispro06
2018.03.21 조회 945
lispro06
2018.03.16 조회 2054
lispro06
2017.11.27 조회 6609
lispro06
2017.07.16 조회 1808
lispro06
2017.06.22 조회 2056
lispro06
2016.11.02 조회 1797
lispro06
2016.11.01 조회 7585
lispro06
2016.10.27 조회 4317
lispro06
2016.10.27 조회 3098
lispro06
2016.10.27 조회 4105
lispro06
2016.10.27 조회 2740
lispro06
2015.11.20 조회 1710
첨부 (0)
위로