小编Wan*_*lex的帖子

单击通知以打开我的活动时的 firebase 消息传递

firebase 工作正常,在状态栏上推送通知,但我的挑战是点击通知时,我希望它带我到我的自定义活动而不是默认启动器,我该怎么做?

public class CustomActivity extends AppCompatActivity {

private static final String TAG = "CustomActivity";


@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);


    TextView mymessage = (TextView) findViewById(R.id.mymessage);

    // If a notification message is tapped, any data accompanying the notification
    // message is available in the intent extras. In this sample the launcher
    // intent is fired when the notification is tapped, so any accompanying data would
    // be handled here. If you want a different intent fired, set the …
Run Code Online (Sandbox Code Playgroud)

android push-notification firebase firebase-cloud-messaging

5
推荐指数
1
解决办法
6904
查看次数