jeudi 30 juin 2016

FCM not open necessary Activity when app is closed

Sorry for my english. Before i use GCM for push notoifications and i have one problem when my app is closed and i click on notification opened only mainactivity.class not the one that I put for when click notification is open necessary activity. The problem was that i extends in GcmListenerService like documentation I decided it when extends IntentService and its was work. When my app is closed and i click on notification opened necessary activity.

Then i want got to FCM and i have same problem when i extends on GcmListenerService but now i extends on FirebaseMessagingService and now like before i cant open necessare activity when app is closed.

Before(when all work file) in manifest i have (GcmMessageHandler - my push class)

<receiver
            android:name="com.google.android.gms.gcm.GcmReceiver"
            android:exported="true"
            android:permission="com.google.android.c2dm.permission.SEND" >
            <intent-filter>
                <action android:name="com.google.android.c2dm.intent.RECEIVE" />
                <category android:name="com.nga.plancentral" />
            </intent-filter>
        </receiver>

        <service android:name="push.GcmMessageHandler"  
           android:exported="false" >
            <intent-filter>
                <action android:name="com.google.android.c2dm.intent.RECEIVE" />
            </intent-filter>
        </service>

        <meta-data android:name="com.google.android.gms.version"
            android:value="@integer/google_play_services_version" /> 

Now in manifest i have

 <service
        android:name="push.FBMnotification">
        <intent-filter>
            <action android:name="com.google.firebase.MESSAGING_EVENT"/>
        </intent-filter>
    </service>

Aucun commentaire:

Enregistrer un commentaire