Push Notificatin (FIrebase)

how to implement fcm in andorid project



<!-- for get access token -->
refreshedToken = FirebaseInstanceId.getInstance().getToken();





<!--register sevice in manifest-->
<!--FCM service registration--><service android:name=".pushnotification.MyFirebaseMessagingService">
    <intent-filter>
        <action android:name="com.google.firebase.MESSAGING_EVENT" />
    </intent-filter>
</service>
<service android:name=".pushnotification.MyFirebaseInstanceIDService">
    <intent-filter>
        <action android:name="com.google.firebase.INSTANCE_ID_EVENT" />
    </intent-filter>
</service>



<!-- app build.gradle -->

apply plugin: 'com.google.gms.google-services'


 <!-- project build.gradle -->
classpath 'com.google.gms:google-services:3.0.0'

Note:- dont forgot to add json file which is download by Firebase console


Full demo here:- https://drive.google.com/open?id=0B7De_mE7QNdOZUFjNFo2dW5tTEk

No comments:

Post a Comment

Run/install/debug Android applications over Wi-Fi ?

Open Teminal/cmd --------------- Below steps is for Android 10 or lower Step 1 - Connect the device via USB and make sure debugging is work...