[PLAY STEEM] 푸시 노티피케이션을 위한 Block Data

in hive-101145 •  4 years ago  (edited)

이제 푸시 노티피케이션 구현 단계입니다.

푸시 노티피케이션을 구현하려면, 다음과 같은 절차를 거칩니다.

푸시 노티피케이션

1. 블록체인의 블록 데이터 스트리밍

2. 블록 데이터 중에서 푸시 노티피케이션에 필요한 데이터 가져오기

  • 보팅 (보팅은 너무 빈번하여 지원하지 않을 예정입니다)
  • 리스팀
  • 송금
  • 팔로우
  • 멘션
  • 댓글, 대댓글
  • 베네피셔리 (베네피셔리로 지정되면 푸시)

3. 푸시 노티피케이션을 받을 대상자가 앱 사용자인지 검사

4. 푸시 노티피케이션을 생성하여 Firebase Cloud Messaging으로 전송

5. Firebase Cloud Messaging이 푸시 노티피케이션 메시지를 해당 기기로 전송

가장 먼저 블록 데이터가 어떻게 구성되어 있는지 확인해야 합니다.

보팅

block operation data {
  trx_id: '563478e3fff66be80c4d90351977d8c2b966fa03',
  block: 51519685,
  trx_in_block: 17,
  op_in_trx: 0,
  virtual_op: 0,
  timestamp: '2021-02-25T13:52:21',
  op: [
    'vote',
    {
      voter: 'lunamoon',
      author: 'davedickeyyall',
      permlink: 'rock-out-with-your-cock-out',
      weight: 10000
    }
  ]
}

댓글

block operation data {
  trx_id: 'b27d811ac4e1342b6191cf245c2a5c7bf49b22b2',
  block: 51519727,
  trx_in_block: 7,
  op_in_trx: 0,
  virtual_op: 0,
  timestamp: '2021-02-25T13:54:30',
  op: [
    'comment',
    {
      parent_author: 'etainclub',
      parent_permlink: 'qp37j6',
      author: 'nevlu123',
      permlink: 'qp37ys',
      title: '',
      body: 'welcome sir',
      json_metadata: '{"app":"steemit/0.2"}'
    }
  ]
}

멘션

block operation data {
  trx_id: '4fdc37b0661c316d1da53a954f0760aa8753cb60',
  block: 51520291,
  trx_in_block: 11,
  op_in_trx: 0,
  virtual_op: 0,
  timestamp: '2021-02-25T14:22:51',
  op: [
    'comment',
    {
      parent_author: 'rafacelis',
      parent_permlink: 'logro-1-mi-presentacion-en-steemit',
      author: 'ghostfacer99',
      permlink: 'qp39a0',
      title: '',
      body: '@rafacelis Welcome to Steemit Community! \n' + ...
       json_metadata: '{"users":["rafacelis","cryptokannon","steemitblog","ghostfacer99"],"image":["https://i.postimg.cc/k5kf7TmK/new-removebg-preview.png","https://media.giphy.com/media/wkpO3eeISXT6yuYGcr/giphy.gif"],"links":["https://steemit.com/hive-172186/@cryptokannon/notice-board-of-newcomers-community-4-november-2020","https://steemit.com/trending/hive-114435"],"app":"steemit/0.2"}'
    }
  ]
}

송금

block operation data {
  trx_id: '4b0a309b92a3efbde98bd2eb1c50fea2316e51af',
  block: 51519702,
  trx_in_block: 0,
  op_in_trx: 0,
  virtual_op: 0,
  timestamp: '2021-02-25T13:53:12',
  op: [
    'transfer',
    {
      from: 'epicdice',
      to: 'epictoken',
      amount: '0.001 STEEM',
      memo: '[Epicdice] Server Seed Reveal {"prevServerSeed": "a78e068986b4851b5a11a4ce2c76c3c87fafa68a68cf7c692dd5819bd4a106f3", "prevServerHash": "a01c8694924c3e8d617bce8fb31527b09d0c7c1daa190b03ae14221cda8854d3", "newServerHash": "4566c52cd7473325a0d4fdf80f3bc68936079e649f4e0c12bf91c5bc0b4d41d6"}'
    }
  ]
}

리스팀, 리블로그

block operation data {
  trx_id: '282501d3191c36aa371c7e5c9d9aeb30e7889458',
  block: 51519930,
  trx_in_block: 5,
  op_in_trx: 0,
  virtual_op: 0,
  timestamp: '2021-02-25T14:04:42',
  op: [
    'custom_json',
    {
      required_auths: [],
      required_posting_auths: [Array],
      id: 'follow',
      json: '["reblog",{"account":"steemvote","author":"earnxtreme","permlink":"4gbvzh-trx-and-ada-savings-rates-on-binance-flexible-and-fixed"}]'
    }
  ]
}

팔로우

block operation data {
  trx_id: 'faeb00b29c493bad807b26f5c61e5f6a432d3e3e',
  block: 51519856,
  trx_in_block: 10,
  op_in_trx: 0,
  virtual_op: 0,
  timestamp: '2021-02-25T14:01:00',
  op: [
    'custom_json',
    {
      required_auths: [],
      required_posting_auths: [Array],
      id: 'follow',
      json: '["follow",{"follower":"sindoja","following":"alstlghd15","what":["blog"]}]'
    }
  ]
}

베네피셔리

block operation data {
  trx_id: '51a58bb0ad106026945365d452e5072a07eb0c38',
  block: 51520236,
  trx_in_block: 4,
  op_in_trx: 0,
  virtual_op: 0,
  timestamp: '2021-02-25T14:20:06',
  op: [
    'comment_options',
    {
      author: 'nuahs',
      permlink: 'actifit-nuahs-20210225t142001446z',
      max_accepted_payout: '1000000.000 SBD',
      percent_steem_dollars: 10000,
      allow_votes: true,
      allow_curation_rewards: true,
      extensions: [Array]
    }
  ]
}
[beneficiaires] ======== extensions ============ [ { account: 'actifit.pay', weight: 500 } ]

??

block operation data {
  trx_id: '1f312aab6bebaffdd21ca1f54edc5680df0e9c4f',
  block: 51520150,
  trx_in_block: 13,
  op_in_trx: 0,
  virtual_op: 0,
  timestamp: '2021-02-25T14:15:45',
  op: [
    'comment_options',
    {
      author: 'cyberdemon531',
      permlink: 'qp38xx',
      max_accepted_payout: '1000000.000 SBD',
      percent_steem_dollars: 0,
      allow_votes: true,
      allow_curation_rewards: true,
      extensions: []
    }
  ]
}

??

block operation data {
  trx_id: '01d50686890853455e9fb43a629183453864e92f',
  block: 51519727,
  trx_in_block: 5,
  op_in_trx: 0,
  virtual_op: 0,
  timestamp: '2021-02-25T13:54:30',
  op: [
    'comment_options',
    {
      author: 'simaroy',
      permlink: 'actifit-simaroy-20210225t135426916z',
      max_accepted_payout: '1000000.000 SBD',
      percent_steem_dollars: 10000,
      allow_votes: true,
      allow_curation_rewards: true,
      extensions: [Array]
    }
  ]
}

Notify?

block operation data {
  trx_id: 'dcfc17dfd2112f4e1fd44f9049c83644450507dc',
  block: 51519727,
  trx_in_block: 12,
  op_in_trx: 0,
  virtual_op: 0,
  timestamp: '2021-02-25T13:54:30',
  op: [
    'custom_json',
    {
      required_auths: [],
      required_posting_auths: [Array],
      id: 'notify',
      json: '["setLastRead",{"date":"2021-02-25T13:54:28"}]'
    }
  ]
}
Authors get paid when people like you upvote their post.
If you enjoyed what you read here, create your account today and start earning FREE STEEM!
Sort Order:  

hi @etainclub
멘션 테스트