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
package com.tabian.firebaseauthentication; | |
import android.content.Intent; | |
import android.support.annotation.NonNull; | |
import android.support.v7.app.AppCompatActivity; | |
import android.os.Bundle; | |
import android.util.Log; | |
import android.view.View; | |
import android.widget.Button; | |
import android.widget.EditText; |
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
package com.tabian.firebaseaddtodatabase; | |
import android.os.Bundle; | |
import android.support.annotation.NonNull; | |
import android.support.annotation.Nullable; | |
import android.support.v7.app.AppCompatActivity; | |
import android.util.Log; | |
import android.view.View; | |
import android.widget.Button; | |
import android.widget.EditText; |
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
<?xml version="1.0" encoding="utf-8"?> | |
<manifest xmlns:android="http://schemas.android.com/apk/res/android" | |
package="com.tabian.firebasereaddata"> | |
<uses-permission android:name="android.permission.INTERNET"></uses-permission> | |
<application | |
android:allowBackup="true" | |
android:icon="@mipmap/ic_launcher" | |
android:label="@string/app_name" |
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
<?xml version="1.0" encoding="utf-8"?> | |
<manifest xmlns:android="http://schemas.android.com/apk/res/android" | |
package="com.tabian.firebaseuploadimage"> | |
<uses-permission android:name="android.permission.INTERNET"></uses-permission> | |
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" /> | |
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" /> | |
<uses-permission android:name="android.permission.STORAGE" /> | |
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
<?xml version="1.0" encoding="utf-8"?> | |
<manifest xmlns:android="http://schemas.android.com/apk/res/android" | |
package="com.tabian.firebasepushnotifications"> | |
<uses-permission android:name="android.permission.INTERNET"></uses-permission> | |
<application | |
android:allowBackup="true" | |
android:icon="@mipmap/ic_launcher" | |
android:label="@string/app_name" |
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
/* | |
***Logging Type1*** | |
*/ | |
//to just log actions to the Firebase Dashboard you can use this | |
FirebaseCrash.log("Some message that you want to log"); | |
//This type of logging is going to be analogous to this: | |
Log.d(TAG, "Some message that you want to log"); | |
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
<?xml version="1.0" encoding="utf-8"?> | |
<manifest xmlns:android="http://schemas.android.com/apk/res/android" | |
package="com.tabian.firebasepushnotifications"> | |
<uses-permission android:name="android.permission.INTERNET"></uses-permission> | |
<application | |
android:allowBackup="true" | |
android:icon="@mipmap/ic_launcher" | |
android:label="@string/app_name" |
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
//RecyclerView | |
compile 'com.android.support:recyclerview-v7:26.+' | |
//Firebase Authentication | |
compile 'com.google.firebase:firebase-auth:11.4.0' | |
//Firebase Realtime Database | |
compile 'com.google.firebase:firebase-database:11.4.0' | |
//Firebase Cloud Messaging |
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); | |
} | |
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
public class MyFirebaseInstanceIDService extends FirebaseInstanceIdService { | |
private static final String TAG = "MyFirebaseIIDService"; | |
/** | |
* Called if InstanceID token is updated. This may occur if the security of | |
* the previous token had been compromised. Note that this is called when the InstanceID token | |
* is initially generated so this is where you would retrieve the token. | |
*/ | |
@Override | |
public void onTokenRefresh() { |
OlderNewer