Advertisement
Guest User

Untitled

a guest
Jan 18th, 2018
99
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.61 KB | None | 0 0
  1. The notification API for new jobs and new knowledge posts will come with four varaibles:
  2.  
  3. title: This will be the title of the notification
  4. body: This will be the body of the notification
  5. post_type: This will indicate what type of notification. 'post' for knowledge post and 'vacant-job' for job
  6. post_id: This will be the id of the 'post' or 'vacant-job' that can be used to link too the correct page
  7.  
  8.  
  9. You can use the following cURL to test a notification for a 'post':
  10. curl -X POST \
  11. https://fcm.googleapis.com/fcm/send \
  12. -H 'authorization: key=AAAA8clxIE8:APA91bEi__cjOjkI8R1mguhtEfLKBHOYzQ9t7u_BgcuA1vnmtLTEs_dMZAvpRcl03K7H81RjG3XQwv18Sdv2zP9MH8SC5FZCdF_PPVI0Xqd67AY2uS3VOZvQur4KA5VxmaPuBQn3ZnUy' \
  13. -H 'cache-control: no-cache' \
  14. -H 'content-type: application/json' \
  15. -d '{"registration_ids":["PUT_DEVICE_ID_HERE"],"notification":{"title":"Test title","body":"Test body","post_type":"post","post_id":22021},"data":{"title":"Test title","body":"Test body","post_type":"post","post_id":22021}}'
  16.  
  17.  
  18. You can use the following cURL to test a notification for a 'vacant-job':
  19. curl -X POST \
  20. https://fcm.googleapis.com/fcm/send \
  21. -H 'authorization: key=AAAA8clxIE8:APA91bEi__cjOjkI8R1mguhtEfLKBHOYzQ9t7u_BgcuA1vnmtLTEs_dMZAvpRcl03K7H81RjG3XQwv18Sdv2zP9MH8SC5FZCdF_PPVI0Xqd67AY2uS3VOZvQur4KA5VxmaPuBQn3ZnUy' \
  22. -H 'cache-control: no-cache' \
  23. -H 'content-type: application/json' \
  24. -d '{"registration_ids":["PUT_DEVICE_ID_HERE"],"notification":{"title":"Test title","body":"Test body","post_type":"vacant-job","post_id":1780},"data":{"title":"Test title","body":"Test body","post_type":"vacant-job","post_id":1780}}'
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement