HOME 개발팁 node-gcm 안드로이드 푸시 보내기

프로그램 작업하다 좋은 팁, 정보, 테스트를 기록하는 곳입니다.


node | node-gcm 안드로이드 푸시 보내기

페이지 정보

작성자 굿스웹 작성일20-01-03 11:55 조회581회 댓글0건

본문

// npm install node-gcm
var gcm = require('node-gcm');

var gcm_server_key = '';
var sender = new gcm.Sender(gcm_server_key);
 
var message = new gcm.Message({
collapseKey: 'demo',
ontentAvailable: true,
priority: 'high',
    restrictedPackageName: "com.kg.push",
    delayWhileIdle: true,
    timeToLive: 3,
//dryRun: true,
    notification: {
        title: "시간알림",
        icon: "ic_launcher",
        body: "10분남았습니다."
    },
    data: {
        key1: 'message1',
        key2: 'message2'
    }
});
 

var regTokens = [''];

sender.send(message, { registrationTokens: regTokens }, function (err, response) {
    if (err) console.error(err);
    else console.log(response);
});

[주소복사] https://www.goodsweb.kr/?u=D41ZZW3Y
SNS 알리기
핀터레스트
텔레그램로
블로그로
카카오스토리
카톡 공유

관련 블로그
로딩중


5명  IP : 3.145.♡.37
001 66.♡.66.17 양식다운로드
(/bbs/board.php?bo_table=papers)
002 34.♡.82.68 소개
(/bbs/content.php?co_id=company)
003 158.♡.235.234 오류안내 페이지
(/bbs/write.php?bo_table=free)
004 207.♡.13.14 전체검색 결과
(/bbs/search.php?sfl=wr_subject%7C%7Cwr_content&stx=1&sop=and&gr_id=&onetable=papers)
005 3.♡.74.190 개발팁
(/bbs/board.php?bo_table=tip&page=13)

접속자
  • 오늘 : 36
  • 어제 : 311
  • 최대 : 874
  • 전체 : 407,167

검색로봇(Robots) 최근 방문시간
  • GOOGLE : 8시간 전
  • NAVER : 19시간 전
  • BING : 22시간 전
  • DAUM : 1일 전

ETH : 0x8abf3B748ab78828AE07685e4fd53d1a606f18D3



페이스북 네이버 블로그 굿스웹 쇼핑몰 네이버 카페 굿스웹 트위터 굿스웹 티스토리 Google Play