【发布时间】:2017-01-18 09:32:10
【问题描述】:
我是 Ionic 的新手,我集成了 PhoneGap 推送通知插件。我能够在 Android 和 IOS 中接收通知。当用户单击通知时,我想打开一个特定页面,但我找不到任何解决方案。我什至尝试了下面的链接。
How to open detail page when click notification in Ionic
这是我的代码
ionic.Platform.ready(function() {
var push = PushNotification.init({
android: {
senderID: "61426985247",
sound: "true",
vibrate: "true",
forceShow: "true"
},
browser: {
pushServiceURL: 'http://push.api.phonegap.com/v1/push'
},
ios: {
alert: "true",
badge: true,
sound: 'false'
},
windows: {}
});
PushNotification.hasPermission(function(data) {});
push.on('registration', function(data) {
$rootScope.deviceToken = data.registrationId;
});
push.on('notification', function(data) {
$state.go("tabs.createevent", {
"eventId": "createNewEvent"
});
alert(data);
});
push.on('error', function(e) {
alert(e.message);
});
});
请帮我解决问题。 提前致谢。
【问题讨论】:
标签: cordova ionic-framework push-notification