Last active
November 15, 2017 05:03
-
-
Save mitchtabian/1159b148e2dd59c81ad7020ae833a5e1 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private void sendRegistrationToServer(String token) { | |
Log.d(TAG, "sendRegistrationToServer: sending token to server: " + token); | |
DatabaseReference reference = FirebaseDatabase.getInstance().getReference(); | |
reference.child(getString(R.string.dbnode_users)) | |
.child(FirebaseAuth.getInstance().getCurrentUser().getUid()) | |
.child(getString(R.string.field_messaging_token)) | |
.setValue(token); | |
} | |
private void initFCM(){ | |
String token = FirebaseInstanceId.getInstance().getToken(); | |
Log.d(TAG, "initFCM: token: " + token); | |
sendRegistrationToServer(token); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment