本文转自:https://github.com/phonegap-build/PushPlugin/issues/213

问:Hello, I would like to know how can I open a specific page in the application by clicking on the notification

答:

Here you have this piece of code (from my app) outside "devide ready" to recieve the push including the extra value. This works for me fine in ios and android (I can't tested it in wp8 becuse is not merged into build service until now)

    //************************************  OUTSIDE DEVICE READY
// handle APNS notifications for iOS
function onNotificationAPN(e) {
// storage the e.id value (the extra value sent in push notification)
window.localStorage.setItem("push_que", e.id);
var push_que=e.id;
// if the push notification is coming inline
if (e.foreground=="1")
{
// storage the e.numero value (the extra value sent in push notification)
window.localStorage.setItem("push_que", e.id);
var push_que=e.id;
/// some code here to open a message if a new push is recieved inline
;}
if ( event.alert )
{
navigator.notification.alert(event.alert);
}
if ( event.sound )
{
var snd = new Media(event.sound);
snd.play();
}
if ( event.badge )
{
pushNotification.setApplicationIconBadgeNumber(successHandler, errorHandler, event.badge);
}
} // handle GCM notifications for Android
function onNotificationGCM(e) { switch( e.event )
{
if (e.foreground)
{
// if the push is recieved inline
// storage the value of playoad.id, the extra value sent by push
window.localStorage.setItem("push_que", e.payload.id);
var push_que=e.payload.id; }
else
{
// otherwise we were launched because the user touched a notification in the notification tray if (e.coldstart)
{
// storage the value of playoad.numero, the extra value sent by push
window.localStorage.setItem("push_que", e.payload.id); }
else
{
// storage the value of playoad.numero, the extra value sent by push
window.localStorage.setItem("push_que", e.payload.id); }
} break; case 'error': break; default: break;
}
} //********************************** END OUTSIDE DEVICE READY

[转]How to open specific page in the application by clicking on the notification的更多相关文章

  1. page,request,session,application四个域对象的使用及区别

    转自:page,request,session,application四个域对象的使用及区别 1.page指当前页面.只在一个jsp页面里有效 .2.request 指从http请求到服务器处理结束, ...

  2. JSP属性的四种保存范围(page request session application)

    JSP提供了四种属性的保存范围,分别为page.request.session.application 其对应的类型分别为:PageContext.ServletRequest.HttpSession ...

  3. java web作用域page request session application

    转载自:http://blog.csdn.net/wyd458549392147/article/details/6944481 1.page指当前页面.只在一个jsp页面里有效 . 2.reques ...

  4. 《Springboot极简教程》问题解决:Springboot启动报错 Whitelabel Error Page: This application has no explicit mapping for(转)

    13.2 Spring Boot启动报错:Whitelabel Error Page 13.2 Spring Boot启动报错:Whitelabel Error Page 问题描述 Whitelabe ...

  5. 关于Springboot启动报错 Whitelabel Error Page: This application has no explicit mapping

    Whitelabel Error Page This application has no explicit mapping for /error, so you are seeing this as ...

  6. Page Security

    参见开发文档 Overview This document describes how to build applications that grant selected access to indi ...

  7. Page Controller页面控制器实现

    A Page Controller is one object or file declaration designed to handle the request for one logical w ...

  8. Selenium - WebDriver: Page Objects

    This chapter is a tutorial introduction to page objects design pattern. A page object represents an ...

  9. V-Play 文档翻译 Page

    V-Play 文档翻译 Page 翻译:qyvlik 应用的一个页面. VPlayApps 1.0 Inherits: MouseArea Inherited By: ListPage 属性 Item ...

随机推荐

  1. windows的IIS下的负载均衡

    来自http://www.cnblogs.com/allen0118/p/4294066.html 在大型Web应用系统中,由于请求的数据量过大以及并发的因素,导致Web系统会出现宕机的现象,解决这一 ...

  2. Node-webkit 资料笔记

    静不下心写学习笔记了,因为发现了这篇文章:<用node-webkit开发多平台的桌面客户端> 另外官网上针对“package.json”的配置参数也已经很详尽了,连我英文不好的也差不多能看 ...

  3. C#利用SqlDataAdapte对DataTable进行批量数据操作

    C#利用SqlDataAdapte对DataTable进行批量数据操作,可以让我们大大简化操作数据的代码量,我们几乎不需要循环和不关心用户到底是新增还是修改,更不用编写新增和修改以及删除的SQL语句, ...

  4. 未来的 Web:九个不可思议的 WebGL 应用试验

    WebGL 技术允许把 JavaScript 和 OpenGL ES 2.0 结合在一起,通过增加 OpenGL ES 2.0 的一个 JavaScript 绑定,WebGL 可以为 HTML5 Ca ...

  5. JavaScript 开发者经常忽略或误用的七个基础知识点(转)

    JavaScript 本身可以算是一门简单的语言,但我们也不断用智慧和灵活的模式来改进它.昨天我们将这些模式应用到了 JavaScript 框架中,今天这些框架又驱动了我们的 Web 应用程序.很多新 ...

  6. 关于WPF中文件夹浏览对话框的方式

    文件夹浏览时dialogresult要写全引用路径 string path=null; FolderBrowserDialog fbd = new FolderBrowserDialog(); fbd ...

  7. 简单代码在ABAP中实现声音的播放

    这段代码的功能是在SAP里面实现声音的播放,可以用作程序提醒功能,和SAP里面’噹噹噹’那个声音的意思差不多.将来在项目中遇到客户想要SAP ABAP发出一点声音的时候就可以参考一下这个程序. REP ...

  8. Swift安装

    Server1 .Update sudo apt-get update sudo apt-get upgrade . sudo apt-get install bridge-utils .IP 3.1 ...

  9. Android UI线程和非UI线程

    Android UI线程和非UI线程 UI线程及Android的单线程模型原则 当应用启动,系统会创建一个主线程(main thread). 这个主线程负责向UI组件分发事件(包括绘制事件),也是在这 ...

  10. 造成OOM(内存溢出)的几种情况

    数据库Cursor没关.当我们操作完数据库后,一定要调用close()释放资源. 构造Adapter没有使用缓存ContentView. @Override public View getView(i ...