SlideShare a Scribd company logo
FCM
Device to Device
Takuma@Android Study Group
Takuma Lee@Android Study Group
vmgsahm1@gmail.com
Individual App Developer@MangaChat
Today’s source code
https://github.com/TakumaMochizuki/FcmD2D
Download APK: http://bit.ly/2d75nfx
Licensed under the Charlie Tsai
Agenda
• FCM InstanceID token
• Firebase Database
• Firebase RemoteConfig
• GCM Parameter
• Live Debugging & Demo
FCM InstanceID Token
• Access the device registration token
• On initial startup of your app, the FCM SDK generates a registration token
for the client app instance.
• If you want to target single devices or create device groups, you'll need to
access this token by extending FirebaseInstanceIdService.
FCM InstanceID Token
• The registration token may change when
• The app deletes Instance ID
• The app is restored on a new device
• The user uninstalls/reinstall the app
• The user clears app data.
FCM InstanceID Token
Firebase Database
• Rule
• No setting, database will return “Permission denied.”
• Code in FirebaseManager.java
Firebase Database
Firebase RemoteConfig
GCM Parameter
A message request is made of 2 parts: HTTP header and HTTP body.
The HTTP header must contain the following headers:
• Server Key
• Header -> Authorization: key=YOUR_SERVER_KEY (Authorization, key=Azlxxxxxx…ic)
• Header -> Content-Type: application/json (for JSON)
• Header -> application/x-www-form-urlencoded;charset=UTF-8 (for plain text.)
• Request Url
• https://fcm.googleapis.com/fcm/send
https://developers.google.com/cloud-messaging/http
Server Key
Step #1: Log into https://cloud.google.com/console with your Google account
Step #2: In the navigation on the left, go into "APIs & auth > APIs"
Step #3: Find "Google Cloud Messaging for Android" and open this service.
Step #4: In the navigation on the left, go into "APIs & auth > Credentials
Step #5: You can see the Server key (auto created by google service)
Step #6: Copy your key
Post Format
https://firebase.google.com/docs/cloud-messaging/send-message
Receive Messages
• FirebaseMessagingService:onMessageReceived
Question?
Live Debugging & Demo
Extending
• Awesome Chat (https://github.com/TADSG/my-awesome-chat)
• Gitbook (https://www.gitbook.com/book/cateyeslin/
myawesomechat/details)
Thanks

More Related Content

PPTX
FCM & GCM
PPTX
Push Notification for Android, iOS & Sever Side Using Firebase Cloud Messaging
PPT
Google Cloud Messaging
PDF
ID Android TechTalk Series #6 : Google Service and Gradle - Andrew Kurniadi
PPTX
google cloud messaging
PPTX
Gcm presentation
PPSX
Google Cloud Messaging
PPT
Google Cloud Messaging
FCM & GCM
Push Notification for Android, iOS & Sever Side Using Firebase Cloud Messaging
Google Cloud Messaging
ID Android TechTalk Series #6 : Google Service and Gradle - Andrew Kurniadi
google cloud messaging
Gcm presentation
Google Cloud Messaging
Google Cloud Messaging

What's hot (20)

PPTX
Google cloud messaging
PPTX
Introduction to google cloud messaging in android
PDF
GCM for Android
PPTX
GCM Android
PPTX
GCM with Pushbots
PDF
Максим Щеглов - Google Cloud Messaging for Android
PPTX
PPTX
GOOGLE CLOUD MESSAGING PPT 2017
PPTX
GCM Technology for Android
PPTX
Push it! How to use Google Cloud Messaging in your Android App
PPTX
google cloud messaging
PDF
Firebase on Android: The Big Picture
PPTX
Firebase
PPTX
Firebase Android
PPTX
Discover Google Firebase Platform
PDF
Android & Monkey Web Services
PDF
Using the Google SafetyNet API for Banking & Finance
PPTX
Real time web applications with SignalR (BNE .NET UG)
PDF
Google cloud messaging
Google cloud messaging
Introduction to google cloud messaging in android
GCM for Android
GCM Android
GCM with Pushbots
Максим Щеглов - Google Cloud Messaging for Android
GOOGLE CLOUD MESSAGING PPT 2017
GCM Technology for Android
Push it! How to use Google Cloud Messaging in your Android App
google cloud messaging
Firebase on Android: The Big Picture
Firebase
Firebase Android
Discover Google Firebase Platform
Android & Monkey Web Services
Using the Google SafetyNet API for Banking & Finance
Real time web applications with SignalR (BNE .NET UG)
Google cloud messaging
Ad

Viewers also liked (20)

PDF
Proguard by android studio
PDF
FcmD2D
PDF
Android Crawler Web
PDF
Firebase Cloud Messaging for iOS
PDF
Why cloud and what's in it for you
PPTX
Df4 nuclear power
PPTX
2017.02.22 android taipei
PDF
Orm各library效能分析與使用
PPTX
Hybrid design with bootstrap
PPTX
Custom view2
PDF
ORMLite Android
PPTX
Dog point
PPTX
PDF
RxJava With retrolambda
PDF
設計師合作經驗分享
PDF
Use Firebase on iOS
PDF
Jump into cross platform development with firebase
PPTX
E ball technology by Gayatri Kumbhalkar
PDF
Unit test and ui testing with cucumber
PDF
Google Cloud Messaging
Proguard by android studio
FcmD2D
Android Crawler Web
Firebase Cloud Messaging for iOS
Why cloud and what's in it for you
Df4 nuclear power
2017.02.22 android taipei
Orm各library效能分析與使用
Hybrid design with bootstrap
Custom view2
ORMLite Android
Dog point
RxJava With retrolambda
設計師合作經驗分享
Use Firebase on iOS
Jump into cross platform development with firebase
E ball technology by Gayatri Kumbhalkar
Unit test and ui testing with cucumber
Google Cloud Messaging
Ad

Similar to Firebase Cloud Messaging Device to Device (20)

PDF
CNIT 128 6. Analyzing Android Applications (Part 2 of 3)
PDF
6 Analyzing Android Applications (Part 2)
PDF
6. Analyzing Android Applications Part 2
PPTX
Microsoft identity manoj mittal
PDF
Securing android applications
PPTX
Remotetestingfeature v1.1
PPTX
Remotetestingfeaturev1 160109071942
PPTX
High-Trust Add-Ins SharePoint for On-Premises Development
PDF
FOSS STHLM Android Cloud to Device Messaging
PDF
CNIT 128 8. Android Implementation Issues (Part 3)
PDF
CNIT 128 8. Identifying and Exploiting Android Implementation Issues (Part 3)
PDF
Push to Me: Mobile Push Notifications (Zend Framework)
PPT
Nfc sfdc mobile_sdk
PDF
NFC and the Salesforce Mobile SDK
PPTX
Spsbe15 high-trust apps for on-premises development
PPTX
SPS Belgium 2015 - High-trust Apps for On-Premises Development
PDF
Digital Locker Requester API Specification v1 0
PDF
Digital Locker Requester Api Specification v1 0
PPTX
Microsoft Teams community call - February 2020
PPTX
Mdm with config mgr nico
CNIT 128 6. Analyzing Android Applications (Part 2 of 3)
6 Analyzing Android Applications (Part 2)
6. Analyzing Android Applications Part 2
Microsoft identity manoj mittal
Securing android applications
Remotetestingfeature v1.1
Remotetestingfeaturev1 160109071942
High-Trust Add-Ins SharePoint for On-Premises Development
FOSS STHLM Android Cloud to Device Messaging
CNIT 128 8. Android Implementation Issues (Part 3)
CNIT 128 8. Identifying and Exploiting Android Implementation Issues (Part 3)
Push to Me: Mobile Push Notifications (Zend Framework)
Nfc sfdc mobile_sdk
NFC and the Salesforce Mobile SDK
Spsbe15 high-trust apps for on-premises development
SPS Belgium 2015 - High-trust Apps for On-Premises Development
Digital Locker Requester API Specification v1 0
Digital Locker Requester Api Specification v1 0
Microsoft Teams community call - February 2020
Mdm with config mgr nico

Recently uploaded (6)

DOC
Camb毕业证学历认证,格罗斯泰斯特主教大学毕业证仿冒文凭毕业证
PDF
6-UseCfgfhgfhgfhgfhgfhfhhaseActivity.pdf
DOC
证书学历UoA毕业证,澳大利亚中汇学院毕业证国外大学毕业证
PDF
heheheueueyeyeyegehehehhehshMedia-Literacy.pdf
PDF
Lesson 13- HEREDITY _ pedSAWEREGFVCXZDSASEWFigree.pdf
PPTX
ASMS Telecommunication company Profile
Camb毕业证学历认证,格罗斯泰斯特主教大学毕业证仿冒文凭毕业证
6-UseCfgfhgfhgfhgfhgfhfhhaseActivity.pdf
证书学历UoA毕业证,澳大利亚中汇学院毕业证国外大学毕业证
heheheueueyeyeyegehehehhehshMedia-Literacy.pdf
Lesson 13- HEREDITY _ pedSAWEREGFVCXZDSASEWFigree.pdf
ASMS Telecommunication company Profile

Firebase Cloud Messaging Device to Device

  • 2. Takuma Lee@Android Study Group vmgsahm1@gmail.com Individual App Developer@MangaChat Today’s source code https://github.com/TakumaMochizuki/FcmD2D Download APK: http://bit.ly/2d75nfx Licensed under the Charlie Tsai
  • 3. Agenda • FCM InstanceID token • Firebase Database • Firebase RemoteConfig • GCM Parameter • Live Debugging & Demo
  • 4. FCM InstanceID Token • Access the device registration token • On initial startup of your app, the FCM SDK generates a registration token for the client app instance. • If you want to target single devices or create device groups, you'll need to access this token by extending FirebaseInstanceIdService.
  • 5. FCM InstanceID Token • The registration token may change when • The app deletes Instance ID • The app is restored on a new device • The user uninstalls/reinstall the app • The user clears app data.
  • 7. Firebase Database • Rule • No setting, database will return “Permission denied.” • Code in FirebaseManager.java
  • 10. GCM Parameter A message request is made of 2 parts: HTTP header and HTTP body. The HTTP header must contain the following headers: • Server Key • Header -> Authorization: key=YOUR_SERVER_KEY (Authorization, key=Azlxxxxxx…ic) • Header -> Content-Type: application/json (for JSON) • Header -> application/x-www-form-urlencoded;charset=UTF-8 (for plain text.) • Request Url • https://fcm.googleapis.com/fcm/send https://developers.google.com/cloud-messaging/http
  • 11. Server Key Step #1: Log into https://cloud.google.com/console with your Google account Step #2: In the navigation on the left, go into "APIs & auth > APIs" Step #3: Find "Google Cloud Messaging for Android" and open this service. Step #4: In the navigation on the left, go into "APIs & auth > Credentials Step #5: You can see the Server key (auto created by google service) Step #6: Copy your key
  • 16. Extending • Awesome Chat (https://github.com/TADSG/my-awesome-chat) • Gitbook (https://www.gitbook.com/book/cateyeslin/ myawesomechat/details)