【问题标题】:How to open application with notification from LocalNotifications plugin in PhoneGap如何通过 PhoneGap 中 LocalNotifications 插件的通知打开应用程序
【发布时间】:2012-07-08 19:59:49
【问题描述】:

我正在开发一个 PhoneGap/Cordova 应用程序,我已经使用这个插件成功添加了 LocalNotifications:https://github.com/phonegap/phonegap-plugins/tree/master/Android/LocalNotification;但是,我有一个小问题,当我在通知窗口中点击通知时,我的应用程序没有打开,我的意思是,没有任何反应,有人可以解释一下当有人点击我的应用程序中的通知时如何打开它吗?

谢谢!

【问题讨论】:

    标签: android cordova notifications


    【解决方案1】:

    我找到了答案,在 AlarmReceiver.class 中查看以下内容:

    PendingIntent.getActivity(context, 0, new Intent(), 0);

    替换为:

    Intent notificationIntent = new Intent(context, YourApp.class); final PendingIntent contentIntent = PendingIntent.getActivity(context, 0, notificationIntent, 0);

    YourApp.class 是你要打开的类

    【讨论】:

      猜你喜欢
      • 2020-09-11
      • 2020-02-11
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2022-06-13
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多