本文转自: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. HTML5 模拟现实物理效果,感受 Web 技术魅力

    Ball Pool 是一个基于 HTML5 技术的实验,模拟现实物理效果,让你在 Web 中感受自然物体的运动.玩法介绍:可以随意拖动圆球.点击页面背景.晃动浏览器.双击页面背景或者按住鼠标左键,有不 ...

  2. JavaScript学习笔记2之Tab切换

    1.Tab切换简写版1 页面布局如下: <div id="tab"> <h1 id="title"> <span class=&q ...

  3. User Profile Service Application 配置同步连接时,报 MOSS MA not found

    最近在试着配置"我的网站",不知什么原因在配置同步连接时报:MOSS MA not found 搜索发现,需要启动Forefront Identity Manager Servic ...

  4. Javascript - Arraylike的7种实现

    jQuery的崛起让ArrayLike(类数组)在javascript中大放异彩,它的出现为一组数据的行为(函数)扩展提供了基础. 类数组和数组相似,具有数组的某些行为,但是它相比数组可以更加自由的扩 ...

  5. SharePoint回环检查(Loopback Check)相关问题

    Loopback Check(回环检查)本来不是一个SharePoint问题,是Windows Server为了增强自身安全性在Server 2003 SP1后引入的一个功能, 在近几个月中导致了一系 ...

  6. YARN的内存和CPU配置

    时间 2015-06-05 00:00:00  JavaChen's Blog 原文  http://blog.javachen.com/2015/06/05/yarn-memory-and-cpu- ...

  7. JavaScript学习01 语言简介、基本使用和变量声明

    JavaScript语言简介.基本使用和变量声明 JavaScript是网景(Netscape)公司开发的一种基于客户端浏览器.面向对象.事件驱动式的网页脚本语言. JavaScript的前身叫Liv ...

  8. 阿帕奇apache服务器和webDav服务器快速配置。

    当自己在家敲代码需要发请求时,就可以配置本地apache,Mac电脑自带的服务器.这个比windows上的本地服务器还要好用,下面写下最快速配置方案. 0.在开始之前需要给自己的电脑设置下开机密码,想 ...

  9. Android studio修改Logcat颜色

    Android studio默认的Logcat配色不利于阅读,我们可以修改自定义自己的颜色配置

  10. Android 图片的缩放与旋转

    本文实现Android中的图片的缩放效果 首先设计布局: <LinearLayout xmlns:android="http://schemas.android.com/apk/res ...