Android 点击通知不';t在后台打开活动

Android 点击通知不';t在后台打开活动,android,push-notification,android-notifications,firebase-notifications,Android,Push Notification,Android Notifications,Firebase Notifications,我从firebase发送通知,而在前台运行的应用程序点击通知将完美工作。但是如果应用程序在后台运行,那么点击通知将无法工作。它不会打开主活动。请帮助我哪里错了 onMessageReceived() showNotification() 请使用单击操作 例如 $noti = array ( 'icon' => 'your_icon_name', 'title' => 'title', 'body' => 'msg', 'click_act

我从firebase发送通知,而在前台运行的应用程序点击通知将完美工作。但是如果应用程序在后台运行,那么点击通知将无法工作。它不会打开主活动。请帮助我哪里错了

onMessageReceived()

showNotification()


请使用单击操作

例如

$noti = array
    (
    'icon' => 'your_icon_name',
    'title' => 'title',
    'body' => 'msg',
    'click_action' => 'your activity name comes here'
); 
在您的
android.manifest
文件中

在注册活动的位置添加以下代码

     <activity
                android:name="your activity name">
                <intent-filter>
                    <action android:name="your activity name" />
                   <category android:name="android.intent.category.DEFAULT"/>
               </intent-filter>
   </activity>

我想打开底部栏的第二个选项卡。我在firebase通知中发送标签id。如果我的应用程序在后台,如果用户单击我的应用程序打开并重定向到第二个选项卡,如何处理该问题。请你给我一些想法好吗
     <activity
                android:name="your activity name">
                <intent-filter>
                    <action android:name="your activity name" />
                   <category android:name="android.intent.category.DEFAULT"/>
               </intent-filter>
   </activity>
$noti = array
    (
    'icon' => 'your_icon_name',
    'title' => 'title',
    'body' => 'msg',
    'click_action' => 'your activity name comes here'
);